how to create a cabal trainer?

09/08/2012 09:30 roeben0143#16
OMG What happend?

1>------ Build started: Project: Trainer, Configuration: Debug Win32 ------
1>Build started 9/8/2012 3:19:37 PM.
1>PrepareForBuild:
1> Creating directory "c:\users\admin\documents\visual studio 2010\Projects\Trainer\Debug\".
1>InitializeBuildStatus:
1> Creating "Debug\Trainer.unsuccessfulbuild" because "AlwaysCreate" was specified.
1>ClCompile:
1> stdafx.cpp
1> dllmain.cpp
1> Trainer.cpp
1>Trainer.obj : error LNK2005: _DllMain@12 already defined in dllmain.obj
1>c:\users\admin\documents\visual studio 2010\Projects\Trainer\Debug\Trainer.dll : fatal error LNK1169: one or more multiply defined symbols found
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:06.15
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========






Code:
// Trainer.cpp : Defines the exported functions for the DLL application.
//

#include "stdafx.h"

#define    ADDR_GM      0x1076C40
#define    ADDR_AOE     0x10C730C
#define    ADDR_RANGE   0x10C7308

void Start();

BOOL APIENTRY DllMain(HMODULE hModule, DWORD ulReason, LPVOID lpReserved)
{
    if (ulReason == DLL_PROCESS_ATTACH)
    {
        CreateThread(0, 0, (LPTHREAD_START_ROUTINE)Start, 0, 0, 0);
    }

    return TRUE;
}

void Start()
{
    while (1)
    {
        if (GetKeyState(VK_F12) < 0) // Turn On
        {
            *(DWORD*)ADDR_GM = 2;
            *(DWORD*)ADDR_AOE = 100;
            *(DWORD*)ADDR_RANGE = 13;
        }
        
        if (GetKeyState(VK_F11) < 0) // Turn Off
        {
            *(DWORD*)ADDR_GM = 0;
            *(DWORD*)ADDR_AOE = 0;
            *(DWORD*)ADDR_RANGE = 0;
        }
        
        Sleep(1);
    }
}


What should I do?
09/08/2012 10:23 кev#17
Quote:
Originally Posted by roeben0143 View Post
1>Trainer.obj : error LNK2005: _DllMain@12 already defined in dllmain.obj
1>c:\users\admin\documents\visual studio 2010\Projects\Trainer\Debug\Trainer.dll : fatal error LNK1169: one or more multiply defined symbols found
You've got DllMain defined in trainer.cpp and dllmain.cpp. Like I said, don't jump the gun, take your time to learn the basics first - understanding what your compiler is telling you makes your life a lot easier.

Sorry if this sounds harsh but you won't learn anything copypasting. Next thing you're asking is why your pointers don't work or why your game crashes due to access violations.

Quote:
Originally Posted by skepjen View Post
yeeeeeeeeeeeeeeeeeeeeeeeeeeessssssssssssssssssssss ssssss!!!!!!!!!!!
atlast ive successfully create a working trainer wooooooooooo!
Just a suggestion; don't do that on your main, nor on public maps.
09/08/2012 11:07 genesisVI#18
yeah look at his char has +15 wep @_@ lol

maybe be more careful nxt tym
09/08/2012 16:07 skepjen#19
Quote:
Originally Posted by кev View Post
You've got DllMain defined in trainer.cpp and dllmain.cpp. Like I said, don't jump the gun, take your time to learn the basics first - understanding what your compiler is telling you makes your life a lot easier.

Sorry if this sounds harsh but you won't learn anything copypasting. Next thing you're asking is why your pointers don't work or why your game crashes due to access violations.


Just a suggestion; don't do that on your main, nor on public maps.
yeah my mistake ^^;)