ah... i did it
managed to get it works perfectly
managed to get it works perfectly
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu
<?PHP
set_time_limit(0);
//return the filesize in big endian format
function getMapSize($mappath)
{
$filesize = filesize($mappath);
$part1 = ($filesize ) & 0xFF;
$part2 = ($filesize >> 8) & 0xFF;
return chr($part1).chr($part2);
}
$mappath = 'treetag.w3x';
$BE_filesize = getMapSize($mappath);
echo 'Map filezie:' . filesize($mappath) . "\r\n";
$map_crc32 = "\xf9\x0d\x49\xe5";
$map_crc32 = ( ord($map_crc32[0]) ) + ( ord($map_crc32[1]) << 8) + ( ord($map_crc32[2]) << 16) + ( ord($map_crc32[3]) << 24);
$map = file_get_contents($mappath);
$map_len = strlen($map);
$content = '';
$map_crc32= sprintf("%u", $map_crc32);
for($i = 0; $i < $map_len; $i++)
{
for($x=$i; $x < $map_len; $x++)
{
$content .= $map[$x];
}
$checksum = sprintf("%u", crc32($content));
echo "Current offset: " . $i . "\n";
echo "Suppose to be: ".$map_crc32."\n";
echo "Computed value: ".$checksum."\n";
if($map_crc32 == $checksum)
{
echo "1.Matching found at offset $i\n";
exit;
}
echo "\n\n";
$content = '';
$checksum = '';
}
Quote from: Don Cullen on September 13, 2007, 01:42 PMQuote from: tinman on September 13, 2007, 07:15 AM
is the header = first 512 byte?
i cant seems to get the correct crc32 checksum :/
While I'm out of my depth here, I have an idea you could try, use it or ignore it as the babbling of someone who doesn't know what he's talking about. Your choice.
Couldn't you basically save the correct crc32 checksum to a variable, then basically brute force the map? Basically, write a program that starts with the first byte reading until the last byte, and calculates the crc32 checksum, compares it to the correct one, if it's not the same, it moves on to the second byte, then the third, until it has reached the last byte. Chances are, if UserLoser is right, that you just need to read everything after the header, the program will eventually reach the end of the header, and it'll score a match, and it can then display a message telling you exactly where the end of the header is.
0xFFFFFFFF 0x51 <---- Message Header For 0x51
0x8E 0x00 <---- Message Length? Is it taken two bytes, a WORD?
0xD2 0xAA 0x3B 0x00 <---- Client Token? DWORD = 4 bytes?
0xA8 0x14 0x00 0x01 <---- EXE Version? DWORD = 4 bytes?
0x00 0x01 0xA9 0xF3 <---- EXE Hash? DWORD = 4 bytes?
0xF4 0xB4 0x02 0x00 <---- Number of keys in this packet...(now seems a bit illogical =.=)
For Each Key:
(DWORD) Key Length
(DWORD) CD key's product value
(DWORD) CD key's public value
(DWORD) Unknown (0)
(DWORD[5]) Hashed Key Data
(STRING) Exe Information
(STRING) CD Key owner name
Page created in 0.207 seconds with 16 queries.