Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Metin2
You last visited: Today at 02:27

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

Advertisement



I need packet reader

Discussion on I need packet reader within the Metin2 forum part of the Popular Games category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Apr 2021
Posts: 1
Received Thanks: 0
I need packet reader

I need packet reader
I tested this code but not working
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;
}
if i need pointer how to i get this pointer ?
ProKKC is offline  
Old 04/12/2021, 12:55   #2
 
elite*gold: 0
Join Date: Feb 2015
Posts: 26
Received Thanks: 8
The code works fine, you just read the header as I see.

You can easly get the pointer from following a function ( for example selling something to the general store and following the SendShopSellPacket ) to the main SendPacket function and pass that.
Aeryas is offline  
Reply


Similar Threads Similar Threads
[Buying] Packet Reader & Packet Editor
02/15/2017 - Coders Trading - 2 Replies
English Hello, looking for a good Coder who can make me a Tool where i can Read Packets and Edit them. Send me a PM or Answer in this Thread. German Hallo,
Reader with Foxit PDF reader is not faulty?
04/18/2014 - Technical Support - 0 Replies
Today I read a file into PDF with Foxit Reader software that error message "D: \ study \ ***********.pdf Couldnot open file. File not found " This error alone today because last week my newly found normal users do not see the error. I tried many PDF files are so off. I brought it to another computer open. You know how to help me see this error!
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 02:27.


Powered by vBulletin®
Copyright ©2000 - 2024, 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 ©2024 elitepvpers All Rights Reserved.