• Welcome to Valhalla Legends Archive.
 
Menu

Show posts

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

Messages - tinman

#1
ah... i did it  ;D
managed to get it works perfectly  ;D
#2
I'm trying to do the same thing also...





#3
How do i generate a window from within a DLL?
#4
the crc32 function generate the correct results for other packets that logged by me... so i assume they are both using the same crc32 function as php. maybe i should try different variants / find out whats wrong with the crc32 function in war3.
#5
i'm using the php crc32 since my script is written in php.


<?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 = '';
}
#6
Quote from: Don Cullen on September 13, 2007, 01:42 PM
Quote 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.

I did written a script to do the job...  it is now at offset 2074. still no luck :<
#7
is the header = first 512 byte?

i cant seems to get the correct crc32 checksum :/
#8
Anyone know how?
i tried throwing every bytes of the map file into the crc32 function and end up with different crc32 value when compared with the packets log.  ???
i suppose i should start reading from a specified offset?
#9
i'm doing some research about the packets (c->s)that telling the server which game port the host is using.
i did logged 0x1C but i found no changes when i changed the game port.
#10
thx for the info.
#11
oh yes...
i'm looking for explanations for coding point of view...
i'm actually writting a proxy that can redirect the users to suitable gateways that matched their versions.
#12
hmm.. let's make it simple.

actually i still dont understand how to read bnet binary messages

for what i understood for SID_AUTH_CHECK


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


please guide me to parse whole message till the cdkey owner.
#13
i wish to manupulate the  0x50 c->s (and 0x51 c->s  ?? ) to change the version info and exehash send by warcraft 3
how to parse the the packets send by warcraft3 and manupulate it (in C/C++) ?

P/S: i'm new to bnet binary bot development.