c++ dll help

08/26/2012 17:17 syndrah#1
PHP Code:
#include "stdafx.h"
#include "windows.h"
#define    ADDR_GM        0xE82198
#define    ADDR_AOE    0xEC549C
void Start();
int aoecheck 1;
void Start(){
    while (
1){
        if(
GetKeyState(VK_F12) < 0){
            
//enable
            
if(aoecheck == 0){
                *(
DWORD*)ADDR_GM 2;
                *(
DWORD*)ADDR_AOE 100;
                
aoecheck 1;
            
//disable
            
}else if(aoecheck == 1){
                *(
DWORD*)ADDR_GM 0;
                *(
DWORD*)ADDR_AOE 0;
                
aoecheck 0;
            }
        }
        
Sleep(1);
    }

im trying to go back to basics but i still cant get this to work. any suggestions?
08/27/2012 11:12 mi5pogi#2
try this:

PHP Code:
#include "stdafx.h"
#include "windows.h"
#define    ADDR_GM        0xE82198
#define    ADDR_AOE    0xEC549C 
int aoecheck 1;
void Start(){
    while (
1){
        if(
GetKeyState(VK_F12) < 0){
            
//enable
            
if(aoecheck == 0){
                *(
DWORD*)ADDR_GM 2;
                *(
DWORD*)ADDR_AOE 100;
                
aoecheck 1;
            
//disable
            
}else if(aoecheck == 1){
                *(
DWORD*)ADDR_GM 0;
                *(
DWORD*)ADDR_AOE 0;
                
aoecheck 0;
            }
        }
        
Sleep(1);
    }
}  

BOOL APIENTRY DllMain(HMODULE hModuleDWORD ulReasonLPVOID lpReserved)
{
    if (
ulReason == DLL_PROCESS_ATTACH)
    {
        
CreateThread(00, (LPTHREAD_START_ROUTINE)Start000);
    }

    return 
TRUE;

08/27/2012 12:53 syndrah#3
finally someone responds.

1>Win32Project2.obj : error LNK2005: _DllMain@12 already defined in dllmain.obj
1>C:\Users\Syn\Documents\Visual Studio 2012\Projects\Win32Project2\Debug\Win32Project2.dl l : fatal error LNK1169: one or more multiply defined symbols found
08/27/2012 16:45 кev#4
Quote:
Originally Posted by syndrah View Post
finally someone responds.

1>Win32Project2.obj : error LNK2005: _DllMain@12 already defined in dllmain.obj
1>C:\Users\Syn\Documents\Visual Studio 2012\Projects\Win32Project2\Debug\Win32Project2.dl l : fatal error LNK1169: one or more multiply defined symbols found
I'm guessing you created a dll project with wizard instead of empty one, right? In that case you're redeclaring DllMain (the entry point) which is already in dllmain.cpp - just move the posted entry with createthread in there.

Or just delete dllmain.cpp. :P
08/27/2012 17:44 syndrah#5
still getting nothing, ill make a video showing exactly what im doing.
08/27/2012 23:49 кev#6
Quote:
Originally Posted by syndrah View Post
still getting nothing, ill make a video showing exactly what im doing.
Also, sleep interval is milliseconds so in other words you're checking for F12 input and thus trying to toggle the value(s) 1000 times in a second - which is probably not what you want.
08/28/2012 17:47 syndrah#7
so for the sleep interval to make sure i understand right should be changed to a second? rather then a millesecond.

ok, ill change it to 1000 for sleep.

also could the directx interfere with the keystroke with f12?
08/29/2012 14:00 кev#8
Quote:
Originally Posted by syndrah View Post
so for the sleep interval to make sure i understand right should be changed to a second? rather then a millesecond.

ok, ill change it to 1000 for sleep.

also could the directx interfere with the keystroke with f12?
Well I've usually use 100ms interval since I'm using the same loop for freezing the memory values - 1000ms too high.

Are you absolutely sure that the injection succeeds in the first place? As in checking that the dll is loaded in the process memory and the entry point is executed?

And no, DX can't interfere with the input.
08/29/2012 16:10 syndrah#9
thanks alot kev.

how can i verify that it has been injected properly. the injector says its injected but other then that i dont know for sure. ill change sleep to 100.
08/29/2012 16:24 cheatcarrot#10
what injector do you use?? hmm... some injector doesn't work anymore even though it says the dll is injected.

if your having problem with your injector i would suggest you use additedfouryou injector
[Only registered and activated users can see links. Click Here To Register...]
08/29/2012 16:51 syndrah#11
im using perx. i also got addictedforyou also but it didnt change anything.
08/29/2012 16:59 mi5pogi#12
add messagebox in injection,then youll know if its injected.and also in IF condition when F12 is triggered.
this code works without any problem.
PHP Code:
#include "stdafx.h"
#include "windows.h"
#define    ADDR_GM      0xE82198
#define    ADDR_AOE    0xEC549C 
int aoecheck 1;
void Start(){
    while (
1){
        if(
GetKeyState(VK_F12) < 0){
            
//enable
            
if(aoecheck == 0){
                *(
DWORD*)ADDR_GM 2;
                *(
DWORD*)ADDR_AOE 100;
                
aoecheck 1;
MessageBoxA(NULL"AOE enabled""Mikez"MB_OK);
            
//disable
            
}else if(aoecheck == 1){
                *(
DWORD*)ADDR_GM 0;
                *(
DWORD*)ADDR_AOE 0;
                
aoecheck 0;
MessageBoxA(NULL"AOE disabled""Mikez"MB_OK);
            }
        }
        
Sleep(1);//it will cause you lag if you make it so high,value 1 works best
    
}
}  

BOOL APIENTRY DllMain(HMODULE hModuleDWORD ulReasonLPVOID lpReserved)
{
    if (
ulReason == DLL_PROCESS_ATTACH)
    {
     
MessageBoxA(NULL"DLL successfully Injected""Mikez"MB_OK);
        
CreateThread(00, (LPTHREAD_START_ROUTINE)Start000);
    }

    return 
TRUE;

08/29/2012 18:29 syndrah#13
thanks mike, i tried the code and recommendations you set forth, unfortunately with addicted injector and perx did not work and i got nothing. i will make a quick video on what im doing and ill up it within an hour.

ok apparently my recording software isnt working atm, but rest assured its not working.

the dll isnt showing any messages at all so it seems like its not even injected at all.

i have to leave for about 10 hours hopefully i can have some more information from your generous help to get me to fix this issue.
08/29/2012 20:17 кev#14
Quote:
Originally Posted by mi5pogi View Post
PHP Code:
Sleep(1);//it will cause you lag if you make it so high,value 1 works best 
Not quite, 1ms only gives other threads some room to do work as well but it still means that the thread in question hogs all the cpu time it can have. So it's unnecessarily low for both, input checking and freezing memory values.

Not that it'd matter though as CABAL rapes your CPU as well. But still.

Quote:
Originally Posted by syndrah View Post
thanks mike, i tried the code and recommendations you set forth, unfortunately with addicted injector and perx did not work and i got nothing. i will make a quick video on what im doing and ill up it within an hour.

ok apparently my recording software isnt working atm, but rest assured its not working.

the dll isnt showing any messages at all so it seems like its not even injected at all.

i have to leave for about 10 hours hopefully i can have some more information from your generous help to get me to fix this issue.
I've had trouble with getting both of those injectors to work properly under 7 x64 (idk if those 2 don't set up debug privileges or just fail). There's quite few available in release section though, haven't tested them all.
08/30/2012 01:56 syndrah#15
hi kevin.

thanks for your input. yes cabal does hog alot of power and it does have stunning graphics even for how old the game is.

i have tried about 15 different injectors and with no luck. im at a buddies place and just so happen to be available.

i tried crckd dll he released and the perx injector and i did get a message box from it. so i know it must be my dll.

hopefully we can resolve this so i can move to the next step of education and really kick it to high gear.

Again please continue to work together to get this done.