![]() |
#31 |
Enthusiast
![]() ![]() Posts: 49
Karma: 123
Join Date: Jun 2004
|
I think part of the problem is PHPs total lack of support for unsigned data types. Whilst I could write a bunch of UINT arithmatic functions, I don't think that is an elegant solution. So if you give me a while, I may write a PHP extension using the ASM code.
|
![]() |
![]() |
![]() |
#32 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 914
Karma: 3410461
Join Date: May 2004
Device: Kindle Touch
|
Yes and no. I have been working on the script for the past hour and also noticed that the problem is PHP automatic type cast conversion. While UINT is not supported, forcing all the operations to (int) should do the trick as well. Lemme finish the editing and see what the result will be. Another small fix:
if($url_length > 12) { should be if($url_length >= 12) { |
![]() |
![]() |
Advert | |
|
![]() |
#33 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 914
Karma: 3410461
Join Date: May 2004
Device: Kindle Touch
|
Another small fix:
when you load the string chars to the $variables, we must convert the ascii value first using ord(), e.g. $eax = ord($ecx{7+$ebp});// ;load 8th $edx = ord($ecx{6+$ebp});// ;load 7th |
![]() |
![]() |
![]() |
#34 |
Junior Member
![]() Posts: 6
Karma: 22
Join Date: Jun 2004
|
I hope I can get the PHP script too. I have been looking at google.com for these past 4 weeks and all of them require money in order to get the script. I found this thread actually from google.com. Please share it if it is done. Many many thanks in advance.
![]() |
![]() |
![]() |
![]() |
#35 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 914
Karma: 3410461
Join Date: May 2004
Device: Kindle Touch
|
Ok while normal operations work ok even with signed integers, bit shifting operations (>>) can really mess up when the integer is negative. Hmm. Stinks
![]() |
![]() |
![]() |
Advert | |
|
![]() |
#36 |
Enthusiast
![]() ![]() Posts: 49
Karma: 123
Join Date: Jun 2004
|
I already did ord() conversion on the entire url. Theres a for loop that does it around line 40. PHP also has a tendency to convert the large values to floats. Which it shouldnt as the algorithm relies to some extent on overflow it seems. And er. It is >= on my script. Are you looking at googlehash.php? That has the full source of googlehash-test.php up to date in it.
|
![]() |
![]() |
![]() |
#37 |
Enthusiast
![]() ![]() Posts: 49
Karma: 123
Join Date: Jun 2004
|
|
![]() |
![]() |
![]() |
#38 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 914
Karma: 3410461
Join Date: May 2004
Device: Kindle Touch
|
ok... btw I think you should use e.g.
$eax = (int)($eax+$edx); instead of $eax = (int)$eax+$edx; otherwise the typecast only applies to the right operator of the operation and the result could still be a long. |
![]() |
![]() |
![]() |
#39 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 914
Karma: 3410461
Join Date: May 2004
Device: Kindle Touch
|
btw, i downloaded the update now and will look at it again.
|
![]() |
![]() |
![]() |
#40 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 914
Karma: 3410461
Join Date: May 2004
Device: Kindle Touch
|
signed/unsigned in general is not a problem, except for the rightshift operator >> ... a right shift fills the left bits with whatever the original sign bit (leftmost bit) held... so if the number was negative, the bits will be all filled with 1's, but they should be filled with zeros instead (unsigned right shift).
|
![]() |
![]() |
![]() |
#41 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 914
Karma: 3410461
Join Date: May 2004
Device: Kindle Touch
|
I found the needed snipped from a SHA1 implementation for PHP:
Use $eax = (int)(zerofill($eax, 0x0c)); instead of $eax = (int)(eax >> 0x0c); and define the following function: PHP Code:
|
![]() |
![]() |
![]() |
#42 |
Enthusiast
![]() ![]() Posts: 49
Karma: 123
Join Date: Jun 2004
|
Updated with what you said. I've been running the Komodo debugger on it to check for floats and things, and I havent seen anything turn into a float with just (int) yet, but ill add the extra brackets anyway.
|
![]() |
![]() |
![]() |
#43 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 914
Karma: 3410461
Join Date: May 2004
Device: Kindle Touch
|
Ok, it's working
![]() I will clean up the code a bit and then contact you, Alex! |
![]() |
![]() |
![]() |
#44 |
Enthusiast
![]() ![]() Posts: 49
Karma: 123
Join Date: Jun 2004
|
And why arent you on AIM?:P
|
![]() |
![]() |
![]() |
#45 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 914
Karma: 3410461
Join Date: May 2004
Device: Kindle Touch
|
heh same reason like yesterday... my "better half"....
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Seriously thoughtful Dekker's Algorithm help. | Catire | Lounge | 13 | 03-19-2010 10:03 AM |
Bulk Pagerank Checker Script? | SNaRe | Lounge | 2 | 10-22-2006 04:36 PM |
Google Toolbar Pagerank Checksum Revealed! | Alexander Turcic | Lounge | 5 | 02-17-2006 08:09 AM |
Google Checksum CH calculator | cyberax | Lounge | 2 | 08-17-2004 09:37 PM |