Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › C++/C Programming › Problem loading .dll

Problem loading .dll

Posts 1–5 of 5 · Page 1 of 1
why06
why06
Problem loading .dll
I've been working on a speedhack, using Detours 2.1 (because I figure its time to move on). Anyhow the I did a bit of pruning to the detours header file so that I wouldn't have to require or ship detoured.dll with every hack I make....

The problem is its not working. I get no compile time errors, but it looks like as if in runtime there is no entry point for my .dll. At first I thought it might just be CA, but now I see it is failing in multiple applications. So if someone could take a look as to why it may not be loading properly I'd really appreciate it.

Code:
#include <windows.h>
#include <tchar.h>
#include <stdio.h>

//#pragma comment( "detours.lib" )
#include "detours.h"

DWORD (__stdcall *Real_timeGetTime)(void) = timeGetTime; 
BOOL (__stdcall *Real_QPC)(LARGE_INTEGER *lp) = QueryPerformanceCounter;

float factorset = 1.0;//initial value: 1.0
bool speedhack = 0;//initial state: off
void SpeedLoop()
{
	while(1)
	{
		if(GetAsyncKeyState(0x5A))//Z key
		{
			factorset -= .25;
		}
		if(GetAsyncKeyState(0x43))//C key
		{
			factorset += .25;
		}
		if(GetAsyncKeyState(0x54))//T key
		{
			if(speedhack)speedhack = 0;//off
			else speedhack = 1;//on
		}
		Sleep(300);
	}
}

DWORD My_timeGetTime()
{
	DWORD factor = 1.0;
	DWORD currentreal = 0.0;

	if(speedhack)factor = factorset;
	else factor = 1.0;

	static DWORD oldtGT = 0;
	if(oldtGT==0)
	{
		oldtGT = Real_timeGetTime();
		return oldtGT;
	}
	currentreal = Real_timeGetTime();

	DWORD newret;
	newret = currentreal+((currentreal-oldtGT)*(factor-1));

	oldtGT=currentreal;
	return newret; 
}

BOOL My_QPC(LARGE_INTEGER *lp)
{
	static __int64 oldfake = 0;
	static __int64 oldreal = 0;
	__int64 factor = 1;

	if(speedhack)factor = factorset;//remember this variable
	else factor = 1;

	__int64 newvalue;

	if( oldfake == 0 || oldreal == 0 )
	{
		oldfake = lp->QuadPart;
		oldreal = lp->QuadPart;
	}
	newvalue  = lp->QuadPart;

	newvalue = oldfake + (__int64)((newvalue - oldreal) * (factor-1));

	oldreal = lp->QuadPart;
	oldfake = newvalue;

	lp->QuadPart = newvalue;
	return Real_QPC(lp);
}



BOOL WINAPI DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved)
{
	switch( dwReason ) 
	{
		case DLL_PROCESS_ATTACH:
			DisableThreadLibraryCalls( hModule );
			DetourTransactionBegin();
			DetourUpdateThread( GetCurrentThread() );
			DetourAttach( &(PVOID&)Real_timeGetTime, My_timeGetTime);
			DetourAttach( &(PVOID&)Real_QPC, My_QPC );
			DetourTransactionCommit();
			CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)SpeedLoop, NULL, NULL, NULL);
			break;
		case DLL_PROCESS_DETACH:
			DetourTransactionBegin();
			DetourUpdateThread( GetCurrentThread() );
			DetourDetach( &(PVOID&)Real_timeGetTime, My_timeGetTime);
			DetourDetach( &(PVOID&)Real_QPC, My_QPC );
			DetourTransactionCommit();
			break;
	}
}
Right now it only detours QueryPerformanceCounter and timeGetTime, but I expect to add GetTickCount and implement a better UI, which you guys have already helped me with once I get the damned thing to work. =/
#1 · 16y ago
Matrix_NEO006
Matrix_NEO006
dont know much about dll but i think you should include this too.
Code:
switch( dwReason ) 
	{
		case DLL_PROCESS_ATTACH:
			DisableThreadLibraryCalls( hModule );
			DetourTransactionBegin();
			DetourUpdateThread( GetCurrentThread() );
                        My_timeGetTime();
			DetourAttach( &(PVOID&)Real_timeGetTime, My_timeGetTime);
			DetourAttach( &(PVOID&)Real_QPC, My_QPC );
			DetourTransactionCommit();
			CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)SpeedLoop, NULL, NULL, NULL);
			break;
		case DLL_PROCESS_DETACH:
			DetourTransactionBegin();
			DetourUpdateThread( GetCurrentThread() );
                        My_timeGetTime();
			DetourDetach( &(PVOID&)Real_timeGetTime, My_timeGetTime);
			DetourDetach( &(PVOID&)Real_QPC, My_QPC );
			DetourTransactionCommit();
			break;
	}
no so sure but try it.
#2 · 16y ago
why06
why06
omg! Now I notice it! I dont know why this thing didnt give me an error while compiling!

Hehe! Can you see it? I forgot to return true for the DllMain. Silly me
#3 · 16y ago
IN
InHuman
silly you
#4 · 16y ago
why06
why06
I will close this now. I'll have many more chances to make a fool of myself before Im done with this. xD
#5 · 16y ago
Posts 1–5 of 5 · Page 1 of 1

Post a Reply

Similar Threads

  • Meh problem loading Cshell.dllBy why06 in Combat Arms Hack Coding / Programming / Source Code
    9Last post 16y ago
  • Problem with loading dll.By jarno55 in WarRock Discussions
    11Last post 16y ago
  • Ashwoops bypass problems + mfc71.dll download hereBy 913982499 in Combat Arms Hacks & Cheats
    2Last post 17y ago
  • Problem loading AVABy mexicano007 in Alliance of Valiant Arms (AVA) Hacks & Cheats
    10Last post 16y ago
  • Problems loading Combat armsBy immortalxgod in Combat Arms Help
    1Last post 16y ago

Tags for this Thread

None