hey RageZone
i follow chris05's tutorial "Create a DLL"
GameServer 1.00.90
I. Setting the offsets <-OK
PHP Code:
0058810B 6A 0F PUSH 0F
0058810D 6A 0C PUSH 0C
III. File offsets.h<-OK
offsets.h:
PHP Code:
#ifndef _DLL_H_
#define _DLL_H_
#include <stdio.h>
//extern "C" __declspec(dllexport) void Config();
#endif
#define GS_BC_DROP_ID (0x0058810B+1)
#define GS_BC_DROP_GROUP (0x0058810D+1)
#define LogAdd ((void(*) (BYTE,char*,...))0x00403C01)
char aini[] = ".\\data\\DSTeam.ini" ;
int ProcuraArquivo(char* Arquivo)
{
FILE *fp;
fp=fopen(Arquivo,"rb");
if (fp==0)
{
return 0;
}
else
{
fclose(fp);
return 1;
}
}
IV. File .cpp<-OK
DllMain.cpp:
PHP Code:
#include "offsets.h"
#include <string.h>
#include <windows.h>
extern "C" __declspec(dllexport) void Config();
bool BcDropIni ( char * ini)
{
BYTE Bc;
Bc = GetPrivateProfileInt("Configs","BCItemDropID",15,ini);
*(unsigned char *) GS_BC_DROP_ID = Bc ;
Bc = GetPrivateProfileInt("Configs","BCItemDropGroup",12,ini);
*(unsigned char *) GS_BC_DROP_GROUP = Bc ;
return 1;
}
bool IniciaIni()
{
//char a[255];
char aini[] = ".\\data\\DSTeam.ini" ;
bool rResultado;
rResultado = BcDropIni ( aini );
return 1;
}
void Config()
{
DWORD OldProtect;
LPVOID lpAddress = (LPVOID)0x00401000;
if ( VirtualProtect
(lpAddress,0x246000,PAGE_EXECUTE_READWRITE,&OldProtect))
{
//sprintf( a , "Dll carregada com sucesso");
//LogAdd(3 , a);//
MessageBox(NULL, "DSTeam.dll foicarregada.","Sucesso",MB_OK);
if(!ProcuraArquivo(aini))
{
MessageBox(NULL,"Arquivo de inicialização nãoencontrado.\nPor favor verifique!","DSTeam.ini",NULL);
::ExitProcess(0);
}
bool inicio ;
inicio= IniciaIni() ;
}
}
V. Compiling the DLL<-problem
Debug--> Compile with Warnings
Relase--> don't Compile --> Warning
PHP Code:
1>c:\users\alex\documents\visual studio 2008\projects\gameserver\gameserver\offsets.h(14) : warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
can you can someone help me pleas?
msn: alex-g91@hotmail.de
icq:204994380
if you don't have PM me.
Source code as download:
http://88.152.106.232/GameServer.rar