#include <windows.h>
#include <fstream>
using namespace std;
//Globals
ofstream ofile;
#define WeaponMgr 0x??????
void log_weapons()
{
DWORD CShell = NULL;
do
{
CShell = (DWORD)GetModuleHandleA("CShell.dll");
Sleep(100);
} while (CShell == NULL);
Sleep(1000);
DWORD pWeaponMgr = NULL;
do
{
pWeaponMgr = *(DWORD*)(CShell+WeaponMgr);
Sleep(100);
} while (pWeaponMgr == NULL);
Sleep(1000);
for(int i=0; i<600; i++)
{
if((*(DWORD*)((*(DWORD*)(CShell+WeaponMgr))+(4*i)) ) != NULL)
{
char* WepName = (char*)((*(DWORD*)((*(DWORD*)(CShell+WeaponMgr)) +(4*i))) + 8);
ofile << "GiNiYaT101: ID = " << i << " , Name = " << WepName << "\n";
}
}
ExitProcess(0);
}
bool WINAPI DllMain(HMODULE hDll, DWORD dwReason, PVOID pvReserved)
{
if(dwReason == DLL_PROCESS_ATTACH)
{
DisableThreadLibraryCalls(hDll);
ofile.open("C:\Weaponlog.txt", ios::app);
ofile << "GiNiYaT101: Weapon Log started\n\n";
CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)log_weapons, NULL, NULL, NULL);
}
else if(dwReason == DLL_PROCESS_DETACH)
{
ofile << "\nGiNiYaT101: Weapon Log ended";
ofile.close();
}
return true;
}



ofile << "GiNiYaT101: ID = " << i << " , Name = " << WepName << "\n";
}
}
ExitProcess(0);
}
bool WINAPI DllMain(HMODULE hDll, DWORD dwReason, PVOID pvReserved)
{
if(dwReason == DLL_PROCESS_ATTACH)
{
DisableThreadLibraryCalls(hDll);
ofile.open("C:\Weaponlog.txt", ios::app);
ofile << "GiNiYaT101: Weapon Log started\n\n";
CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)log_weapons, NULL, NULL, NULL);
}
else if(dwReason == DLL_PROCESS_DETACH)
{
ofile << "\nGiNiYaT101: Weapon Log ended";
ofile.close();
}
return true;
}

ofile.open("C:\Weaponlog.txt", ios::app);