Exemplo n.º 1
0
static int trylock(const std::multimap<std::wstring, unsigned long long int> &pids) {

	if (! initialize(pids, L"left4dead.exe", L"client.dll")) { // Retrieve "client.dll" module's memory address
		return false;
	}

	// Server ID
	steamclient = getModuleAddr(L"steamclient.dll"); // Retrieve "steamclient.dll" module's memory address
	// This prevents the plugin from linking to the game in case something goes wrong during module's memory address retrieval.
	if (steamclient == 0)
		return false;

	// Host & Player ID
	engine = getModuleAddr(L"engine.dll"); // Retrieve "engine.dll" module's memory address
	// This prevents the plugin from linking to the game in case something goes wrong during module's memory address retrieval.
	if (engine == 0)
		return false;

	// Check if we can get meaningful data from it
	float apos[3], afront[3], atop[3], cpos[3], cfront[3], ctop[3];
	std::wstring sidentity;
	std::string scontext;

	if (fetch(apos, afront, atop, cpos, cfront, ctop, scontext, sidentity)) {
		return true;
	} else {
		generic_unlock();
		return false;
	}
}
Exemplo n.º 2
0
static int trylock() {

	h = NULL;
	posptr = faceptr = topptr = NULL;

	DWORD pid=getProcess(L"BF2142.exe");
	if (!pid)
		return false;
	BYTE *mod=getModuleAddr(pid, L"BF2142Audio.dll");
	if (!mod)
		return false;

	h=OpenProcess(PROCESS_VM_READ, false, pid);
	if (!h)
		return false;

	BYTE *cacheaddr = mod + 0x4745c;
	BYTE *cache = peekProcPtr(cacheaddr);

	posptr = peekProcPtr(cache + 0xc0);
	faceptr = peekProcPtr(cache + 0xc4);
	topptr = peekProcPtr(cache + 0xc8);

	float apos[3], afront[3], atop[3], cpos[3], cfront[3], ctop[3];
	std::string context;
	std::wstring identity;

	if (fetch(apos, afront, atop, cpos, cfront, ctop, context, identity))
		return true;

	CloseHandle(h);
	h = NULL;
	return false;
}
Exemplo n.º 3
0
static int trylock() {
	h = NULL;
	posptr = rotptr = NULL;

	DWORD pid=getProcess(L"left4dead.exe");
	if (!pid)
		return false;

	BYTE *mod=getModuleAddr(pid, L"client.dll");
	if (!mod)
		return false;

	h=OpenProcess(PROCESS_VM_READ, false, pid);
	if (!h)
		return false;

	posptr = mod + 0x580588;
	rotptr = mod + 0x4FF024;
	stateptr = mod + 0x4F8E34;

	float pos[3];
	float rot[3];
	float opos[3], top[3], front[3];

	bool ok = peekProc(posptr, pos, 12) &&
	          peekProc(rotptr, rot, 12);

	if (ok)
		return calcout(pos, rot, opos, top, front);

	CloseHandle(h);
	h = NULL;
	return false;
}
Exemplo n.º 4
0
static int trylock(const std::multimap<std::wstring, unsigned long long int> &pids) {
    posrotptr = NULL;

    if (! initialize(pids, L"hl2.exe", L"client.dll"))
        return false;

    BYTE *mod_engine=getModuleAddr(L"engine.dll");
    if (!mod_engine)
        return false;

    // Remember addresses for later
    posrotptr = pModule + 0x8D8694;
    stateptr = pModule + 0x849284;
    hostptr = mod_engine + 0x3EA20C;

    // Gamecheck
    char sMagic[13];
    if (!peekProc(mod_engine + 0x564C78, sMagic) || strncmp("DemomanTaunts", sMagic, sizeof(sMagic))!=0)
        return false;

    // Check if we can get meaningful data from it
    float apos[3], afront[3], atop[3];
    float cpos[3], cfront[3], ctop[3];
    std::wstring sidentity;
    std::string scontext;

    if (fetch(apos, afront, atop, cpos, cfront, ctop, scontext, sidentity)) {
        return true;
    } else {
        generic_unlock();
        return false;
    }
}
Exemplo n.º 5
0
static int trylock(const std::multimap<std::wstring, unsigned long long int> &pids) {

    if (! initialize(pids, L"bf3.exe"))
        return false;

    pmodule_bf3 = getModuleAddr(L"bf3.exe");
    if (!pmodule_bf3)
        return false;

    float apos[3], afront[3], atop[3], cpos[3], cfront[3], ctop[3];
    std::string context;
    std::wstring identity;

    if (!fetch(apos, afront, atop, cpos, cfront, ctop, context, identity)) {
        generic_unlock();
        return false;
    }

    return true;
}
Exemplo n.º 6
0
static int trylock(const std::multimap<std::wstring, unsigned long long int> &pids) {

	if (!initialize(pids, L"BF2142.exe")) // Retrieve game executable's memory address
		return false;

	RendDX9 = getModuleAddr(L"RendDX9.dll"); // Retrieve "RendDX9.dll" module's memory address
	// This prevents the plugin from linking to the game in case something goes wrong during module's memory address retrieval.
	if (!RendDX9)
		return false;

	// Check if we can get meaningful data from it
	float apos[3], afront[3], atop[3], cpos[3], cfront[3], ctop[3];
	std::wstring sidentity;
	std::string scontext;

	if (fetch(apos, afront, atop, cpos, cfront, ctop, scontext, sidentity)) {
		return true;
	} else {
		generic_unlock();
		return false;
	}
}