Menu Search

Borland Delphi

Guild Wars 2 Memory Thread
off_NetworkClass = $015C1DD4; // [15754]
off_EncryptCallAdd = $1CC; // [15754]
off_EncryptPacket = $00A62190; // [15754]

procedure EncryptPacket(pBuffer, pTargetBuffer: Pointer; bufferSize: Integer);
const
// delphi __thiscall hekk, ignore _eax and _edx and reverse the order
gw2Encrypt: procedure( _eax, _edx, pThis, pTargetBuffer, pBuffer: Pointer; bufferSize: Integer) = Pointer(off_EncryptPacket);
begin
gw2Encrypt(nil, nil, Pointer(PCardinal(off_NetworkClass)^ + off_EncryptCallAdd), pTargetBuffer, pBuffer, bufferSize);
end;
VOID __fastcall m_PacketEncrypt(VOID* pTargetBuffer, VOID* pBuffer, int bufferSize)
{
DWORD NetClassptr = *(DWORD*)(gw2_base + NetworkClass);
VOID* EncryptCallAdd = *(VOID**)(NetClassptr + EncryptCall);

/*for(int i = 0; i < bufferSize; i++)
{
cout << hex << pBuffer[i];
}*/

cout << "m_PacketEncrypt()" << endl;
cout << hex << NetClassptr << endl;
cout << hex << EncryptCallAdd << endl;
cout << hex << (const char*)pBuffer << endl;
cout << hex << (const char*)pTargetBuffer << endl;
cout << bufferSize << endl;
cout << "m_PacketEncrypt()" << endl;
cout << "_________________" << endl;

//m_send(m_s, (const char*)pTargetBuffer, bufferSize, NULL);

return pPacketEncrypt(NULL, NULL, EncryptCallAdd, pTargetBuffer, pBuffer, bufferSize);
}

int WINAPI m_send(SOCKET s, const char* buf, int len, int flags)
{
cout << "m_send()" << endl;
cout << buf << endl;
cout << len << endl;
cout << flags << endl;
cout << "m_send()" << endl;
cout << "________" << endl;

m_s = s;

return pSend(s, buf, len, flags);
}
procedure hk_PacketCrypt(_eax, _edx, pThis, pEncryptedBuffer, pBuffer: Pointer; packetSize: Integer);
var
buffer: Array of Byte;
i: Integer;
sLog, sOpName: string;
wOpCode: Word;
const
org_PacketCrypt: procedure(_eax, _edx, pThis, pEncryptedBuffer, pBuffer: Pointer; packetSize: Integer) = Pointer($00A62190);
begin
if (g_bLogOutgoingPackets) then
begin
SetLength(buffer, packetSize);
Move(pBuffer^, buffer[0], packetSize);

for i := Low(buffer) to High(buffer) do
begin
sLog := sLog + IntToHex(buffer[i], 2) + ´ ´;
end;

Move(buffer[0], wOpCode, SizeOf(wOpCode));

case wOpCode of
$0D:
sOpName := ´MovementHeartbeat´;
$0F:
sOpName := ´CastSpell´;
$21:
sOpName := ´MoveItem´;
$54:
sOpName := ´ChatMessage´;
$56:
sOpName := ´SlashCommand´;
$7C:
sOpName := ´Unlock bag slot´
else
sOpName := ´Unknown´;
end;

LogConsole (´======================================================´);
LogConsoleF(´C->S Packet code: %x (%s) Size: %d´, [wOpCode, sOpName, Length(buffer)]);
LogConsole (´======================================================´);
LogConsole (sLog);
LogConsole (´======================================================´);
end;

org_PacketCrypt(_eax, _edx, pThis, pEncryptedBuffer, pBuffer, packetSize);
end;

Liste

Index | List
  • Vorherige
  • Seite #n
  • #n
  • #c
  • Seite #n
  • Nächste
Index | List
  • Vorherige
  • Seite #n
  • #n
  • #c
  • Seite #n
  • Nächste

Index

Index | List
  • Vorherige
  • Seite #n
  • #n
  • #c
  • Seite #n
  • Nächste
Index | List
  • Vorherige
  • Seite #n
  • #n
  • #c
  • Seite #n
  • Nächste

LetzteChance.Org - Links -

PDF/ZIP/Word