Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ** Quick VAC replayer. This will give a key and a command to a function, and VAC
- ** will reply with a result.
- */
- #include <stdio.h>
- #include <Windows.h>
- int main( int argc, char** argv ) {
- UINT8 key[8] = { 0xea, 0xbe, 0xdf, 0x61, 0x62, 0xb2, 0x77, 0x11 };
- UINT8 outKey[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
- UINT8 outBuf[6000];
- UINT32 outSize;
- HMODULE hVac = LoadLibraryA("SourceInit.dat");
- if (!hVac) {
- printf("Cannot replay - VAC module is missing.\n");
- return 1;
- }
- void (*TestFcn)( UINT8* something, UINT8* key, UINT32 mysteryarg, UINT8* response, UINT32* responseSize );
- UINT8* fcnPtr = (UINT8*)hVac + 0x3535;
- TestFcn = (void(*)(UINT8*,UINT8*,UINT32,UINT8*,UINT32*))fcnPtr;
- printf("test function pointer %p\n", TestFcn);
- // I don't actually know the correct parameters for this.
- // Just making this up as I go along.
- // In this test scenario the function always seems to return a 256-byte packet.
- TestFcn(key, outKey, 4, outBuf, &outSize);
- printf("Function finished with a buffer size of %p\n", outSize);
- FILE*f = fopen("VacSamplePacket.bin","wb");
- if (f) {
- fwrite( outBuf, outSize, 1, f );
- fclose( f );
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment