Register for your free account! | Forgot your password?

You last visited: Today at 06:05

  • Please register to post and access all features, it's quick, easy and FREE!

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.

Reply
 
Old   #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)(intintunsigned intlong**a3); // int __thiscall sub_52AA90(int this, unsigned int a2, const void *a3)
tHookPacketFunction oHookPacketFunction;
void OpenConsole();

void OpenConsole()
{
    
int hCrtInhCrtOut;
    
FILE *conIn, *conOut;

    
AllocConsole();
    
hCrtIn _open_osfhandle((intptr_tGetStdHandle(STD_INPUT_HANDLE), _O_TEXT);
    
hCrtOut _open_osfhandle((intptr_tGetStdHandle(STD_OUTPUT_HANDLE), _O_TEXT);
    
conIn _fdopen(hCrtIn"r");
    
conOut _fdopen(hCrtOut"w");
    *
stdin = *conIn;
    *
stdout = *conOut;
}

int __fastcall hHookPacketFunction(int a1int ebxunsigned int a2long **a3)
{
    
//int iVal = static_cast<int>(reinterpret_cast<BYTE*>(a3)[0]);
    
for (long i 0sizeof(a3); i++){
        if (
== sizeof(a3) - 1)
            
cout << static_cast<int>(reinterpret_cast<BYTE*>(a3)[i]) << endl;
        else if (
== 0)
            
cout << "Packet header : " << static_cast<int>(reinterpret_cast<BYTE*>(a3)[i]) << ", ";
        else
            
cout << static_cast<int>(reinterpret_cast<BYTE*>(a3)[i]) << ", ";
    }
    return 
oHookPacketFunction(a1ebxa2a3);
}

extern "C" __declspec(dllexportvoid __cdecl Initialize()
{
    
OpenConsole();
    
oHookPacketFunction = (tHookPacketFunctionDetourFunction((PBYTE0x0052AA90, (PBYTEhHookPacketFunction);
}

BOOL APIENTRY DllMain(HANDLE hModuleDWORD ul_reason_for_callLPVOID lpReserved)
{
    switch (
ul_reason_for_call)
    {
    case 
DLL_PROCESS_ATTACH:
        
CreateThread(NULL0reinterpret_cast<LPTHREAD_START_ROUTINE>(Initialize), NULL0NULL);
        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
File Type: rar Packet Reader.rar (231.8 KB, 650 views)
LoveCpp is offline  
Thanks
20 Users
Old 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
TheMarv :< is offline  
Old 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.
LoveCpp is offline  
Old 08/29/2013, 14:51   #4

 
elite*gold: 0
Join Date: Jan 2013
Posts: 348
Received Thanks: 353
Quote:
Originally Posted by [SA]Mentras View Post
Thanks4Share
Please use the "Thanks" button instead of making a new post
TheMarv :< is offline  
Thanks
1 User
Old 08/29/2013, 15:52   #5
 
elite*gold: 0
Join Date: Aug 2013
Posts: 28
Received Thanks: 61
#dll added
LoveCpp is offline  
Old 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!
ricky92 is offline  
Thanks
1 User
Old 08/29/2013, 17:37   #7
 
elite*gold: 0
Join Date: Aug 2013
Posts: 28
Received Thanks: 61
Quote:
Originally Posted by ricky92 View Post
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?
LoveCpp is offline  
Old 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?
ƬheGame is offline  
Old 08/29/2013, 19:18   #9
 
DexterSK's Avatar
 
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?
DexterSK is offline  
Old 08/29/2013, 19:30   #10
 
sema1995's Avatar
 
elite*gold: 0
Join Date: May 2011
Posts: 254
Received Thanks: 68
Quote:
Originally Posted by DexterSK View Post
,,NOTE : You can add this dll to your exe.(Initialize)" how to add dll to exe?
Use LordPE.
sema1995 is offline  
Old 08/29/2013, 19:36   #11
 
DexterSK's Avatar
 
elite*gold: 0
Join Date: Jun 2011
Posts: 160
Received Thanks: 161
Quote:
Originally Posted by sema1995 View Post
Use LordPE.
And short tutorial :P
DexterSK is offline  
Old 08/29/2013, 23:03   #12
 
[uLow]Beni's Avatar
 
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 ?
[uLow]Beni is offline  
Old 08/30/2013, 00:02   #13
 
KaMeR1337's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 1,415
Received Thanks: 5,444
Quote:
Originally Posted by !Beni! View Post
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
KaMeR1337 is offline  
Thanks
2 Users
Old 08/30/2013, 13:40   #14
 
Zonni's Avatar
 
elite*gold: 100
Join Date: Feb 2008
Posts: 195
Received Thanks: 270
Quote:
Originally Posted by DexterSK View Post
,,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
Zonni is offline  
Thanks
1 User
Old 05/08/2014, 12:52   #15
 
elite*gold: 0
Join Date: Jan 2012
Posts: 5
Received Thanks: 1
how to find 0x0052AA90 adress ?
TheTompa is offline  
Reply


Similar Threads 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.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.