• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

Useful Stuff

Status
Not open for further replies.
Experienced Elementalist
Joined
Nov 28, 2007
Messages
235
Reaction score
261
Managed to scrape this from my browser cache - the last 24 hours wasn't the best time to post stuff :rolleyes:

What's this section for? Sharing useful information on GunZ 2!!


Packets

Code:
struct pktHead
{
        unsigned char type;

        unsigned short size;
        unsigned short checksum;

        unsigned int unknown1;

        unsigned short packetid;

        unsigned int unknown2;
}

packet types:

const unsigned char PACKET_STANDARD  = 0xB;
const unsigned char PACKET_HANDSHAKE = 0xC;

/*

  showing how similar the key is to gunz 1
  it seems only bytes 0x?? change with a new handshake

  other bytes (02 00 00 00 03) seem to be used in encryption - please help on that :)

unsigned char cryptHash[] = {
    0x57, 0x02, 0x5B, 0x04,    0x??, 0x??, 0x01, 0x08,
    //                           xx    xx

    0x37, 0x0A, 0x12, 0x69,    0x41, 0x38, 0x0F, 0x78,
    //
    0x1B, 0x04, 0x24, 0x22,    0x43, 0x01, 0x49, 0x53,
    //            5d    2e             3a            
    0x50, 0x05, 0x13, 0x35,    0x4F, 0x02, 0x4D, 0x05,    0x02, 0x00, 0x00, 0x00, 0x03
    //                  c9       28    a4  
};

*/


void encPacket( unsigned char *pkt, unsigned int len )
{
        unsigned int EDX;

        for(unsigned int i = 0; i < len; i++)
        {
                EDX = pkt[i] ^ cryptHash[ i % 20 ];

                // 0x20 may refer to the DWORD at the end of the cryptHash
                EDX = (unsigned short)( EDX << cryptHash[ 0x20 ] );

                EDX |= (EDX >> 8);

                EDX ^= 0xF0;


                pkt[i] = (unsigned char)EDX; // dl!
        }

}



void decPacket( unsigned char *pkt, unsigned int len )
{
        unsigned int EAX, EBX;

        // i = edx
        // len = eax

        for(unsigned int i = 0; i < len; i++)
        {
                EAX = pkt[i] ^ 0xF0;

                EBX = EAX;
                EBX &= 0x03; // end of cryptHash structure thing


                // Again, no idea where the 0x2 comes into it
                EBX <<= (8 - 0x02);


                EBX |= (EAX >> cryptHash[0x20]);

                EBX ^= cryptHash[ i % 0x20 ];

                pkt[i] = (unsigned char)EBX;
        }
}




unsigned short makeChecksum(unsigned char *pkt, unsigned int len)
{
        unsigned int chksm = 0;

        if( len > 0xF )
        {
                for(unsigned int i = 0xF; i < len; i++)
                {
                        chksm += pkt[i];
                }
        }

        chksm -= (pkt[0] + len);
        
        chksm += (chksm >> 0x10);

        return (unsigned short)chksm;
}


Models
Had a look at the new RaiderZ section yet? I started sharing some code for reading the newest ELU format: http://forum.ragezone.com/f697/model-formats-761223/

Also, check out Phantom*'s Blender WIP: http://forum.ragezone.com/f700/help-bad-number-version-759203/index2.html#post6445022


Maps

Managed to launch the client yet? Me neither.. but I did managed to read some geometry from the new ship map (test_cargo_ship_01.elu):

x1nixmzeng - Useful Stuff - RaGEZONE Forums
 
DRGunZ 2 Creator
Loyal Member
Joined
Jan 21, 2007
Messages
4,493
Reaction score
161
Very nice, I like the geometry on that map. That looks sexy :3
Good luck on this.
 
Status
Not open for further replies.
Back
Top