Packets menu

User Tag List

Thread: Packets

Results 1 to 3 of 3
  1. #1
    ntoskrnl's Avatar Corporal
    Reputation
    74
    Join Date
    Oct 2016
    Posts
    24
    Thanks G/R
    5/66
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Packets

    Hello,

    I'd like to share some code i wrote which hooks the "Encrypt" function that encrypts packet data before it is sent off. Via this hook you can monitor/modify all unencrypted packet data being sent from client->server. This is not exactly a hack of its own but i believe this will shed some light on the packet protocol of PoE. Maybe even help some people to possibly create something amazing in the future via packet manipulation.

    Code:
    0139DDC0 | 8B 86 C8 00 00 00        | mov eax,dword ptr ds:[esi+C8]           |
    0139DDC6 | 8B 11                    | mov edx,dword ptr ds:[ecx]              |
    0139DDC8 | 03 C3                    | add eax,ebx                             |
    0139DDCA | 57                       | push edi                                |
    0139DDCB | 50                       | push eax                                |
    0139DDCC | FF 52 04                 | call dword ptr ds:[edx+4]               |
    0139DDCF | 8B 86 B4 00 00 00        | mov eax,dword ptr ds:[esi+B4]           |
    0139DDD5 | 33 FF                    | xor edi,edi                             |
    0139DDD7 | 89 86 B8 00 00 00        | mov dword ptr ds:[esi+B8],eax           |
    0139DDDD | 85 C0                    | test eax,eax                            |
    0139DDDF | 74 43                    | je pathofexile.139DE24                  |
    0139DDE1 | 8B 1D CC 15 94 01        | mov ebx,dword ptr ds:[<&send>]          |
    0139DDE7 | 66 0F 1F 84 00 00 00 00  | nop word ptr ds:[eax+eax]               |
    0139DDF0 | 8B 8E C8 00 00 00        | mov ecx,dword ptr ds:[esi+C8]           |
    0139DDF6 | 8B 86 B4 00 00 00        | mov eax,dword ptr ds:[esi+B4]           |
    0139DDFC | 6A 00                    | push 0                                  |
    0139DDFE | 2B C7                    | sub eax,edi                             |
    0139DE00 | 50                       | push eax                                |
    0139DE01 | 8D 04 39                 | lea eax,dword ptr ds:[ecx+edi]          |
    0139DE04 | 50                       | push eax                                |
    0139DE05 | FF 36                    | push dword ptr ds:[esi]                 |
    0139DE07 | FF D3                    | call ebx                                |
    call dword ptr ds:[edx+4] <---- this is the encrypt function, it takes two parameters pData and size
    after breakpointing on that line I could see that edx points to hBase + 0xA3B2D4 which is in the PoE.rdata section so rather then doing a .TEXT modification hook i decided to be sneaky about it and did a vtable hook.

    Here is the final code
    Code:
    #include <Windows.h>
    #include <stdio.h>
    
    typedef DWORD(__thiscall * pEncryptT)(DWORD ecx, BYTE* pData, DWORD dwSize);
    pEncryptT pEncrypt = (pEncryptT)NULL;
    
    DWORD __fastcall EncryptHook(DWORD ecx, DWORD edx, BYTE* pData, DWORD dwSize)
    {
    
    	BYTE CmdID = *(BYTE*)(pData+1);
    
    	//if (CmdID != 0xC)
    	//{
    		for (int i = 0; i < dwSize; i++)
    		{
    			printf("%.2x ", pData[i]);
    
    			if ( (i+1) % 15 == 0)
    				printf("\n");
    		}
    		printf("\n\n");
    	//}
    
    	return pEncrypt(ecx, pData, dwSize);
    }
    
    BOOL WINAPI DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReason)
    {
    	if (dwReason == DLL_PROCESS_ATTACH)
    	{
    		AllocConsole();
    		freopen("CONOUT$", "w", stdout);
    		/*freopen("CONIN$", "r", stdin);*/
    		DWORD dwOld;
    		DWORD hBase = (DWORD)GetModuleHandle(NULL);
    
    		
    
    		DWORD dwEncryptAddr = (DWORD)(hBase + 0xA3B2D4);
    		VirtualProtect((LPVOID)(dwEncryptAddr+4), 4, PAGE_EXECUTE_READWRITE, &dwOld);
    		pEncrypt = (pEncryptT)*(DWORD*)(dwEncryptAddr+4);
    		*(DWORD*)(dwEncryptAddr+4) = (DWORD)EncryptHook;
    		VirtualProtect((LPVOID)(dwEncryptAddr+4), 4, dwOld, NULL);
    
    	}
    	return TRUE;
    }
    Heres a screenshot of what it looks like
    Packets-untitled-gif

    Btw if you want to just straight drop a packet you will have to be witty with it because the game will disconnect you if you just send some random data.
    Like u could modify the return address of your EncryptHook in [esp+4] or wherever its stored to jump straight to here after its called-->
    Code:
    0139DE81 | 5F                       | pop edi                                 |
    0139DE82 | 8B C6                    | mov eax,esi                             |
    0139DE84 | 5E                       | pop esi                                 |
    0139DE85 | 5B                       | pop ebx                                 |
    0139DE86 | 8B 4D F4                 | mov ecx,dword ptr ss:[ebp-C]            |
    0139DE89 | 64 89 0D 00 00 00 00     | mov dword ptr fs:[0],ecx                |
    0139DE90 | 8D 65 38                 | lea esp,dword ptr ss:[ebp+38]           |
    0139DE93 | 5D                       | pop ebp                                 |
    0139DE94 | C2 04 00                 | retn 4                                  |
    this would prevent the game from calling WS2_32.send after the encrypt function.


    Attached Files Attached Files

    Packets
  2. Thanks c0mrad, datz, toadskin, GameHelper, enaf3n (5 members gave Thanks to ntoskrnl for this useful post)
  3. #2
    GameHelper's Avatar ★ Elder ★ CoreCoins Purchaser
    Reputation
    3015
    Join Date
    Jun 2015
    Posts
    3,325
    Thanks G/R
    507/2700
    Trade Feedback
    0 (0%)
    Mentioned
    92 Post(s)
    Tagged
    2 Thread(s)
    WOW!!! this is amazing work, man!
    Lets make packet level bots!.
    Last edited by GameHelper; 10-23-2016 at 03:54 AM.
    If I did not reply to you, it mean the question you are asking is stupid.

  4. Thanks ntoskrnl, toadskin (2 members gave Thanks to GameHelper for this useful post)
  5. #3
    enaf3n's Avatar Elite User i like game security stuff CoreCoins Purchaser
    Reputation
    496
    Join Date
    Nov 2013
    Posts
    356
    Thanks G/R
    26/353
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Great work, and explanation!

Similar Threads

  1. LF Someone who knows more about the packets
    By Morphih in forum World of Warcraft General
    Replies: 0
    Last Post: 07-01-2008, 06:04 AM
  2. What does packet overload mean?
    By Eliteplague in forum WoW Memory Editing
    Replies: 1
    Last Post: 03-22-2008, 02:35 AM
  3. Azeroth fly mounts packet.
    By Condor in forum World of Warcraft Emulator Servers
    Replies: 18
    Last Post: 01-23-2008, 03:53 PM
  4. Packet Injecting Items
    By yungen2003 in forum World of Warcraft General
    Replies: 7
    Last Post: 08-07-2007, 07:02 AM
  5. WoW packets.. where are they?
    By Stretch in forum World of Warcraft General
    Replies: 0
    Last Post: 01-28-2007, 01:54 PM
All times are GMT -5. The time now is 07:56 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search