Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[C++] Gunz chat; DLL import

Newbie Spellweaver
Joined
Apr 21, 2009
Messages
21
Reaction score
0
Code:
 /* Replace "dll.h" with the name of your header */
#include "dll.h"
#include <windows.h>

DllClass::DllClass()
{

}


DllClass::~DllClass ()
{

}


BOOL APIENTRY DllMain (HINSTANCE hInst     /* Library instance handle. */ ,
                       DWORD reason        /* Reason this function is being called. */ ,
                       LPVOID reserved     /* Not used. */ )
{
    switch (reason)
    {
      case DLL_PROCESS_ATTACH:
        break;

      case DLL_PROCESS_DETACH:
        break;

      case DLL_THREAD_ATTACH:
        break;

      case DLL_THREAD_DETACH:
        break;
    }

    /* Returns TRUE on success, FALSE on failure */
    return TRUE;
}


typedef void(__cdecl *ZChatOutputType)(const char*,int,int,DWORD);
ZChatOutputType ZChatOutput = (ZChatOutputType)0x0042A230;

DWORD *pGame = (DWORD*)0x00672F68;

int main()
{
   if (GetAsyncKeyState(VK_MENU)&0x8000 && GetAsyncKeyState('C')&0x8000);
   {
   ZChatOutput("hola!",1,0,0xFFFFFFFF);
}
   return true;
}

did i miss something?
its not saying anything in the chat room
 
Newbie Spellweaver
Joined
Jan 12, 2009
Messages
54
Reaction score
1
/* Replace "dll.h" with the name of your header */
#include "dll.h"
#include <windows.h>

DllClass::DllClass()
{

}


DllClass::~DllClass ()
{

}


BOOL APIENTRY DllMain (HINSTANCE hInst /* Library instance handle. */ ,
DWORD reason /* Reason this function is being called. */ ,
LPVOID reserved /* Not used. */ )
{
switch (reason)
{
case DLL_PROCESS_ATTACH:
break;

case DLL_PROCESS_DETACH:
break;

case DLL_THREAD_ATTACH:
break;

case DLL_THREAD_DETACH:
break;
}

/* Returns TRUE on success, FALSE on failure */
return TRUE;
}


typedef void(__cdecl *ZChatOutputType)(const char*,int,int,DWORD);
ZChatOutputType ZChatOutput = (ZChatOutputType)0x0042A230;

DWORD *pGame = (DWORD*)0x00672F68;

int main()
{
if (GetAsyncKeyState(VK_MENU)&0x8000 && GetAsyncKeyState('C')&0x8000);
{
ZChatOutput("hola!",1,0,0xFFFFFFFF);
}
return true;
}

That work? 0.0
 
Experienced Elementalist
Joined
May 30, 2009
Messages
298
Reaction score
8
*Sigh*

You forgot
Code:
void tehgoodz()

You forgot
Code:
 while(1)

No DLL Entry-Point.
 
Ginger by design.
Loyal Member
Joined
Feb 15, 2007
Messages
2,340
Reaction score
653
Create a new thread on dll attach, have it loop through a while(1) with a sleep to check for key events, then call your function like you have.
 
Back
Top