elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Arreglado, de nuevo, el registro del warzone (wargame) de EHN


  Mostrar Temas
Páginas: [1]
1  Programación / Programación C/C++ / Problema con pointer string en: 20 Diciembre 2022, 19:18 pm
Hola como estan
el nombre del juego es ao argentum, esta echo en vb6
utiliza paquetes de texto string como protocolo y estoy desarrollando un hack donde intercepto los datos que entran y salen
lo hice con una guia que encontre de otro juego pero se me esta complicando obtener los send y recv los pointer


Código
  1. typedef VOID(WINAPI *PRecvData)(BSTR data);    //Pointer Definition - Takes BSTR and returns VOID
  2. PRecvData PFunctionRecv = (PRecvData)0x; //Pointer to where the original HandleData() starts -<<<<<< esto
  3.  
  4.  
  5. typedef VOID(WINAPI *PSendData)(BSTR* data);   //Pointer Definition - Takes BSTR* and returns VOID
  6. PSendData PFunctionSend = (PSendData)0x; //Pointer to where the original SendData() starts -<<<<<< esto
  7.  
  8.  
  9. typedef int(WINAPI *PLoop)();
  10. HMODULE dllModule = LoadLibraryA("MSVBVM60.DLL");
  11. PLoop PFunctionLoop = (PLoop)GetProcAddress(dllModule, "rtcDoEvents");
  12.  
  13.  
  14. void Hooks(AORConfig _initialConfiguration)
  15. {
  16.    initialConfiguration = _initialConfiguration;
  17.    OutputDebugStringW(ConvertStringToBSTR(_initialConfiguration.playerName));
  18.    DetourTransactionBegin();
  19.    DetourUpdateThread(GetCurrentThread());
  20.    DetourAttach(&(PVOID&)PFunctionRecv, &MyRecvData);      // Hook DataHandler() to MyRecvData()
  21.    DetourAttach(&(PVOID&)PFunctionSend, &MySendData);      // Hook SendData() to MySendData()
  22.    DetourAttach(&(PVOID&)PFunctionLoop, &MyLoop);          // Hook DoEvents AKA Loop() to MyLoop()
  23.    DetourTransactionCommit();
  24. }
  25.  
  26.  
  27. VOID WINAPI MyRecvData(BSTR dataRecv)
  28. {
  29.    __asm PUSHAD;
  30.    __asm PUSHFD;
  31.  
  32.    try
  33.    {
  34.        OutputDebugStringW(ConvertStringToBSTR("Recv: " + ConvertBSTRToString(dataRecv)));
  35.  
  36.        if (StartsWith(dataRecv, L"PAIN"))
  37.        {
  38.  
  39.        }
  40.  
  41.        //
  42.        //// Returns control to the Original Function
  43.        //
  44.        PFunctionRecv(dataRecv);
  45.    }
  46.    catch (int e)
  47.    {
  48.        OutputDebugStringW(ConvertStringToBSTR("ERROR-> Place: HandleData()  Id: " + to_string(e)));
  49.    }
  50.  
  51.    __asm POPFD;
  52.    __asm POPAD;
  53.  
  54. }


para obtener el send estoy abriendo la app con ollydbg y al loguearme el breakpoint me lo marca perfecto



luego me marca el data buffer ahi debajo y hasta aqui llego no logro obtener ese pointer estatico que seria el dato que necesito para hacerlo funcionar y empezar a modificar los paquetes que envia



lo mismo para el recibir los datos llego hasta esa parte y no se como proseguir no obtengo nada que me sirva alguien puede ayudarme?


Páginas: [1]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines