News for hackers. Stuff that matters.

zxw

Re:Opera moves to WebKit on Wednesday February 13, 2013 @12:35PM (#5214381)
10+ years here too. Recently forced to switch because it's gotten so bad. Maybe if they aren't working the render engine they will have more time to work on performance.
Re:Simple Helper to Extract Values from a String on Thursday October 04, 2012 @09:21AM (#4612148)
Looks really nice, very readable. However, I want a python version!
This is pretty cool but it needs to have a more distinctive style. Maybe the same as it is but green.
Re:Google buys 1,000 patents from IBM to defend Android on Thursday September 15, 2011 @06:46AM (#2999665)
1023 = 0b1111111111
Re:How we found the file that was used to Hack RSA on Friday August 26, 2011 @11:37AM (#2928787)
It's common for the free detectable version of popular trojans to be used as the advertisement for the paid undetectable one.

Looking at the poison ivy website they have a customer portal, so presumably this is how they did it.

There are also methods to pay without leaving a paper trail back to you (pre-paid cards I think).

Edit: It's also possible to modify detectable executables to make them undetectable if you don't want to pay. Virus scanners for the most part work by reading a few bytes from an executable at a particular point, hashing those bytes and if they match a known virus, report it as one. By finding those parts of the executable (there are often multiple signatures, and different vendors will have different signatures too) and modifying them slightly, the resultant hash will be different and the executable undetected.

Re:Why I hate the Kindle on Sunday August 14, 2011 @08:58AM (#2883523)
You can get the Kindle DX if you want a larger screen. I have one and am very happy with it.

http://www.amazon.com/dp/B002GYWHSQ/

Re:Ten Ways to Check if an Integer Is a Power Of Two in C on Tuesday July 26, 2011 @06:31PM (#2809749)
Yeh it's fairly slow going. I'm at 3,706,382,752 and am going to call it a day. Looks like the code works properly.
Re:Ten Ways to Check if an Integer Is a Power Of Two in C on Tuesday July 26, 2011 @03:58PM (#2809217)
Here is the code from the first test.[0] It increments a variable and prints a message if their is an inconsistency. I left it running till it reached 1,351,773,471 and didn't come up with any inconsistencies.

I then modified the test[1] to look for inconsistencies where they were most likely to be found, ie ±1 of 2n. I reached n being 1024 before python complained about a 'Result too large'.

[0] http://paste.pound-python.org/show/10067/

[1] http://paste.pound-python.org/show/10068/

Edit: just reread about the 1 in 2 billion chance, I'll leave the first test running longer to make sure.

Re:Ten Ways to Check if an Integer Is a Power Of Two in C on Tuesday July 26, 2011 @12:12PM (#2808001)
I'm not doing power == int(power) though which is what he warns against. I haven't done a lot of testing however as far I can tell it's working.

    >>> is_power_of_two(2 ** 31 - 1)
    False
    >>> is_power_of_two(2 ** 31)
    True
    >>> is_power_of_two(2 ** 31 + 1)
    False

    >>> is_power_of_two(2 ** 548 - 1)
    False
    >>> is_power_of_two(2 ** 548)
    True
    >>> is_power_of_two(2 ** 548 + 1)
    False
Re:Ten Ways to Check if an Integer Is a Power Of Two in C on Tuesday July 26, 2011 @11:31AM (#2807775)
Is there a reason this won't work? It's the most 'readable' way I could come up with.

    #(python code)
    def is_power_of_two(n):
        import math

        if n <= 0:
            return False

        power = round(math.log(n, 2))
        return 2 ** power == n