You last visited: Today at 06:05
Advertisement
[C++]Metin2 Packet Reader
Discussion on [C++]Metin2 Packet Reader within the Metin2 PServer Guides & Strategies forum part of the Metin2 Private Server category.
08/29/2013, 14:34
#1
elite*gold: 0
Join Date: Aug 2013
Posts: 28
Received Thanks: 61
[C++]Metin2 Packet Reader
Hello guys here is a video :
It returns like : packet header , arg2, arg3....
You can check packets or find out new packets to use.(For hacks or your pserver.)
NOTE : You can add this dll to your exe.(Initialize)
Source :
PHP Code:
#include "stdafx.h" #include <iostream> #include <detours.h> #include <vector> #include <io.h> #include <fcntl.h> using namespace std ; typedef int ( __fastcall * tHookPacketFunction )( int , int , unsigned int , long ** a3 ); // int __thiscall sub_52AA90(int this, unsigned int a2, const void *a3) tHookPacketFunction oHookPacketFunction ; void OpenConsole (); void OpenConsole () { int hCrtIn , hCrtOut ; FILE * conIn , * conOut ; AllocConsole (); hCrtIn = _open_osfhandle (( intptr_t ) GetStdHandle ( STD_INPUT_HANDLE ), _O_TEXT ); hCrtOut = _open_osfhandle (( intptr_t ) GetStdHandle ( STD_OUTPUT_HANDLE ), _O_TEXT ); conIn = _fdopen ( hCrtIn , "r" ); conOut = _fdopen ( hCrtOut , "w" ); * stdin = * conIn ; * stdout = * conOut ; } int __fastcall hHookPacketFunction ( int a1 , int ebx , unsigned int a2 , long ** a3 ) { //int iVal = static_cast<int>(reinterpret_cast<BYTE*>(a3)[0]); for ( long i = 0 ; i < sizeof ( a3 ); i ++){ if ( i == sizeof ( a3 ) - 1 ) cout << static_cast < int >( reinterpret_cast < BYTE *>( a3 )[ i ]) << endl ; else if ( i == 0 ) cout << "Packet header : " << static_cast < int >( reinterpret_cast < BYTE *>( a3 )[ i ]) << ", " ; else cout << static_cast < int >( reinterpret_cast < BYTE *>( a3 )[ i ]) << ", " ; } return oHookPacketFunction ( a1 , ebx , a2 , a3 ); } extern "C" __declspec ( dllexport ) void __cdecl Initialize () { OpenConsole (); oHookPacketFunction = ( tHookPacketFunction ) DetourFunction (( PBYTE ) 0x0052AA90 , ( PBYTE ) hHookPacketFunction ); } BOOL APIENTRY DllMain ( HANDLE hModule , DWORD ul_reason_for_call , LPVOID lpReserved ) { switch ( ul_reason_for_call ) { case DLL_PROCESS_ATTACH : CreateThread ( NULL , 0 , reinterpret_cast < LPTHREAD_START_ROUTINE >( Initialize ), NULL , 0 , NULL ); break; case DLL_THREAD_ATTACH : break; case DLL_THREAD_DETACH : break; case DLL_PROCESS_DETACH : break; } return TRUE ; }
Epic credits : PoZHx
Max 8 bytes.
Compiled :
Attached Files
Packet Reader.rar
(231.8 KB, 650 views)
08/29/2013, 14:38
#2
elite*gold: 0
Join Date: Jan 2013
Posts: 348
Received Thanks: 353
Its not much, but well done :P
Can you send packets, either? Because I dont see a function for sending packets
08/29/2013, 14:42
#3
elite*gold: 0
Join Date: Aug 2013
Posts: 28
Received Thanks: 61
i dont want to share much here.
sending packets is easy , but i didnt want to do though.
08/29/2013, 14:51
#4
elite*gold: 0
Join Date: Jan 2013
Posts: 348
Received Thanks: 353
Quote:
Originally Posted by
[SA]Mentras
Thanks4Share
Please use the "Thanks" button instead of making a new post
08/29/2013, 15:52
#5
elite*gold: 0
Join Date: Aug 2013
Posts: 28
Received Thanks: 61
#dll added
08/29/2013, 17:23
#6
elite*gold: 0
Join Date: Apr 2009
Posts: 121
Received Thanks: 780
That's probably the worst code snippet I've ever seen to print a byte sequence.
Why are you using all that UINT64 stuff? Just make "a3" a LPBYTE and access its data using a3[index]; also, you're declaring "i" as a 64-bit integer, which is really unnecessary, since the maximum value it will ever reach is 8!
08/29/2013, 17:37
#7
elite*gold: 0
Join Date: Aug 2013
Posts: 28
Received Thanks: 61
Quote:
Originally Posted by
ricky92
That's probably the worst code snippet I've ever seen to print a byte sequence.
Why are you using all that UINT64 stuff? Just make "a3" a LPBYTE and access its data using a3[index]; also, you're declaring "i" as a 64-bit integer, which is really unnecessary, since the maximum value it will ever reach is 8!
yeah so?
08/29/2013, 19:03
#8
elite*gold: 198
Join Date: Mar 2011
Posts: 835
Received Thanks: 263
for (char i = 0; i < sizeof(a3); i++){ }
hätts auch getan wieso so ein UINT64 und so viel speicher vebrauchen?
08/29/2013, 19:18
#9
elite*gold: 0
Join Date: Jun 2011
Posts: 160
Received Thanks: 161
,,NOTE : You can add this dll to your exe.(Initialize)" how to add dll to exe?
08/29/2013, 19:30
#10
elite*gold: 0
Join Date: May 2011
Posts: 254
Received Thanks: 68
Quote:
Originally Posted by
DexterSK
,,NOTE : You can add this dll to your exe.(Initialize)" how to add dll to exe?
Use LordPE.
08/29/2013, 19:36
#11
elite*gold: 0
Join Date: Jun 2011
Posts: 160
Received Thanks: 161
Quote:
Originally Posted by
sema1995
Use LordPE.
And short tutorial :P
08/29/2013, 23:03
#12
elite*gold: 0
Join Date: May 2011
Posts: 1,781
Received Thanks: 618
which packet function are you using, can u post a screenshot from ida/ce/olly ?
08/30/2013, 00:02
#13
elite*gold: 0
Join Date: May 2008
Posts: 1,415
Received Thanks: 5,444
Quote:
Originally Posted by
!Beni!
which packet function are you using, can u post a screenshot from ida/ce/olly ?
just use his pseudo code he used. as a pattern
08/30/2013, 13:40
#14
elite*gold: 100
Join Date: Feb 2008
Posts: 195
Received Thanks: 270
Quote:
Originally Posted by
DexterSK
,,NOTE : You can add this dll to your exe.(Initialize)" how to add dll to exe?
change extension file from .dll to .mix and add to your metin2 client folder
it should run automatically when client starts
05/08/2014, 12:52
#15
elite*gold: 0
Join Date: Jan 2012
Posts: 5
Received Thanks: 1
how to find 0x0052AA90 adress ?
Similar Threads
Atlantica IO Packet Reader
09/02/2012 - Atlantica Online - 37 Replies
Your dear friend neuronet asked me to update a packet reader I wrote for Atlantica a while back, so, here it is. This little .dll hooks into Atlantica and logs every outgoing packet before it is encrypted as well as every incoming packet. It creates a log.txt file wherever your Atlantica.exe lies, which gives you the hex output.
Feel free to modify the code (having seen your file decryptor I'm sure you're more than capable of using this to gather information for a kickass bot, neuronet) in...
All times are GMT +1. The time now is 06:05 .