Código PHP:
#ifndef _DLL_H_
#define _DLL_H_
#include <stdio.h>
#include <windows.h>
//extern "C" __declspec(dllexport) void Config();
void SetByte(DWORD dwOffset, BYTE btValeu){
*(BYTE*)(dwOffset) = btValeu;
}
//Aqui estão os offsets necessários para alterar o main para
//aceitar mais sets e armas,além dos originais
//====================================================
//Adicionando sets e armas novos (não originais)
//====================================================
bool AddSets()
{
int Sets1;
int Sets2;
int Sets3;
int Sets4;
int Sets5;
int Sets6;
int Sets7;
int Sets8;
int Sets9;
int Sets10;
int Sets11;
int Sets12;
int Sets13;
int Sets14;
int Sets15;
Sets1 = GetPrivateProfileInt("Inicio","Set1",10,"./main.ini");
Sets2 = GetPrivateProfileInt("Inicio","Set2",4,"./main.ini");
Sets3 = GetPrivateProfileInt("Inicio","Set3",5,"./main.ini");
Sets4 = GetPrivateProfileInt("Inicio","Set4",6,"./main.ini");
Sets5 = GetPrivateProfileInt("Inicio","Set5",17,"./main.ini");
Sets6 = GetPrivateProfileInt("Inicio","Axes",9,"./main.ini");
Sets7 = GetPrivateProfileInt("Inicio","Maces1",7,"./main.ini");
Sets8 = GetPrivateProfileInt("Inicio","Maces2",5,"./main.ini");
Sets9 = GetPrivateProfileInt("Inicio","Items",80,"./main.ini");
Sets10 = GetPrivateProfileInt("Inicio","Swords",17,"./main.ini");
Sets11 = GetPrivateProfileInt("Inicio","Spears",10,"./main.ini");
Sets12 = GetPrivateProfileInt("Inicio","Shields",15,"./main.ini");
Sets13 = GetPrivateProfileInt("Inicio","Staffs",17,"./main.ini");
Sets14 = GetPrivateProfileInt("Inicio","Bows",7,"./main.ini");
Sets15 = GetPrivateProfileInt("Inicio","Crossbows",7,"./main.ini");
memset((PBYTE)(0x00XXXXXX+3),Set1,1);
memset((PBYTE)(0x00XXXXXX+3),Set2,1);
memset((PBYTE)(0x00XXXXXX+3),Set3,1);
memset((PBYTE)(0x00XXXXXX+3),Set4,1);
memset((PBYTE)(0x00XXXXXX+3),Set5,1);
memset((PBYTE)(0x00XXXXXX+3),Set6,1);
memset((PBYTE)(0x00XXXXXX+3),Set7,1);
memset((PBYTE)(0x00XXXXXX+3),Set8,1);
memset((PBYTE)(0x00XXXXXX+3),Set9,1);
memset((PBYTE)(0x00XXXXXX+3),Set10,1);
memset((PBYTE)(0x00XXXXXX+3),Set11,1);
memset((PBYTE)(0x00XXXXXX+3),Set12,1);
memset((PBYTE)(0x00XXXXXX+3),Set13,1);
memset((PBYTE)(0x00XXXXXX+3),Set14,1);
memset((PBYTE)(0x00XXXXXX+3),Set15,1);
return 1;
}
void Config()
{
DWORD OldProtect;
LPVOID IpAddress = (LPVOID)0x00XXXXXX;
if( VirutalProtect (IpAddress,XXXXXX,PAGE_EXECUTE_READWRITE,&OldProtect))
{
if(ProcuraArquivo(aini) ==0)
{
MessageBox(NULL, "Main.dll Não foi carregada.","Erro",MB_OK);
::ExitProcess(0);
}
else
{
AddSets();
MessageBox(NULL, "Main.dll foi carregada.","Secesso",MB_OK);
}
}
}
additems.h