Quantcast
Channel: Visual C forum
Viewing all articles
Browse latest Browse all 15302

Problem With Create Theard

$
0
0

HI All,

I'm Creating Trainer For Game

And This Game is Hiddin in process to i can't Inject my DLL into it

So i change my DLL Type to .asi

and run Game And it's Auto Inject it Self

But i have problem

when i Create The Theard it's give me an error So i add Sleep(500); So it's Inject And Work

But sometimes It's won't Work

And Now i Tried much to inject it It's Won't Inject Anymore

Here is my Main.cpp code

--------------------------------------

#include <Windows.h>
#include <iostream>



extern int UIMain();


DWORD WINAPI Main_thread( LPVOID lpParam )
{
 
    UIMain();
    return S_OK;
    
}




BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  _reason,
                       LPVOID lpReserved
                      
                      )
{
    
    if (_reason == DLL_PROCESS_ATTACH)
    
    {
   Sleep(2000);
   CreateThread(0, 0x1,&Main_thread, 0, 0, 0);
      
         }
        

    return TRUE;
}

------------------------------------

#include "Trainer05.h"

using namespace Trainer;

int UIMain()
{
    
   Trainer05^ NewUi = gcnew Trainer05();
    Application::Run(NewUi);
        

    return 1;
}


Viewing all articles
Browse latest Browse all 15302

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>