I'm trying to get list of weapon ids like in this thread - https://www.mpgh.net/forum/242-crossf...gun-index.html.
I need it because I want to make a weapon hack of other CF localization, not NA, and weapon ids are different.
Here is the source code of weapon logger (not mine):
Code:
#include <windows.h>
#include <fstream>
using namespace std;
#pragma comment(linker,"/MERGE:.rdata=.text")
#pragma comment(linker,"/FILEALIGN:512 /SECTION:.text,EWRX /IGNORE:4078")
#pragma comment(linker,"/BASE:0x13110000")
#pragma comment(linker,"/ENTRY:New_DllMain")
#define WeaponMgr 0xA68F90
//---
DWORD WINAPI H4X(LPVOID)
{
DWORD cshell = (DWORD)GetModuleHandleA( "CShell.dll" );
DWORD weapon = *(DWORD*)( cshell + 0xA68F90);
ofstream file;
file.open("Logger.txt");
for(int i = 0; i < 600; i++) { //You can see later how many weapons there are. Then you can lower the loop.
DWORD wapens = *(DWORD*)(weapon +(4*i));
char * weaponname = (char*)(wapens + 0x0008);
file << "Item number: " << i << " ID: " << hex << i << " Name: " << (LPCTSTR)weaponname << ".\n";
}
return 0;
}
//---
bool R2H()
{
if ( GetModuleHandleA("CShell.dll") != NULL && GetModuleHandleA("ClientFx.fxd") != NULL )
return 1;
return 0;
}
//---
DWORD WINAPI W41t(LPVOID)
{
while ( !R2H()) Sleep(200);
CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)H4X, NULL, NULL, NULL);
return 0;
}
//---
void New_DllMain(HMODULE hDll, DWORD dwReason, LPVOID lpReserved)
{
DisableThreadLibraryCalls(hDll);
if ( dwReason == DLL_PROCESS_ATTACH )
CreateThread(0, 0, (LPTHREAD_START_ROUTINE)W41t, 0, 0, 0);
}
It probably works, but when I put sxs.dll into crossfire folder and start CF, it crashes with send error report. Howewer, it creates a file with weapons indexies, but list is not complete. It has 30-40 weapons only.
Maybe someone help me, because I don't really know how to fix it.