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 › Calling Functions With In Classes From Address

Calling Functions With In Classes From Address

Posts 1–15 of 15 · Page 1 of 1
HW
hwfhwhfwf
Calling Functions With In Classes From Address
How would i go about calling functions within classes from thier address?
#1 · 14y ago
.::SCHiM::.
.::SCHiM::.
Code:
void CallAddress( long Address ){

  if( !Address ) return;
       
__asm{
 mov eax, Address
 call eax
} 

return;
}
use like:

Code:
long Address = 0x401000;
CallAddress( Address );
#2 · edited 14y ago · 14y ago
Jason
Jason
Quote Originally Posted by .::SCHiM::. View Post
Code:
void CallAddress( long Address ){

  if( !Address ) return;
       
__asm{
 mov eax, Address
 call eax
} 

return;
}
use like:

Code:
long Address = 0x401000;
CallAddress( Address );
It's a bit different when calling member functions. Plus that doesn't reaaaally handle any cases other than
Code:
<returntype> <functionname>(void)
You'd need different assembly for each.
#3 · 14y ago
HW
hwfhwhfwf
Are you sure that will work with calling functions within classes?
i have this function:
void GameAudio::StopAllSounds(void)
its memory address is 0x004A0656
when ever i try call it it crashes.
#4 · 14y ago
Jason
Jason
Quote Originally Posted by hwfhwhfwf View Post
Are you sure that will work with calling functions within classes?
i have this function:
void GameAudio::StopAllSounds(void)
its memory address is 0x004A0656
when ever i try call it it crashes.
You need to push the class instance pointer to the stack first.
#5 · 14y ago
HW
hwfhwhfwf
could you give me an example by any chance?

---------- Post added at 07:09 AM ---------- Previous post was at 05:56 AM ----------

i don't think this is possible
#6 · edited 14y ago · 14y ago
KI
kibbles18
mov ecx, instanceofclass
push ecx //not sure if needed
mov eax, address
call eax
#7 · 14y ago
HW
hwfhwhfwf
would an instance of the class be an address?
#8 · 14y ago
KI
kibbles18
yes. the address of the calling instance. for example
Code:
class Aclass
{
     void foo();
};

Aclass instance;
instance.foo();
ecx would be the address of instance.
ecx is just hidden in higher languages, it is basically a hidden first parameter.
#9 · edited 14y ago · 14y ago
HW
hwfhwhfwf
ok i think i get it now so...
first i would have to find the class address say its 0x004A0650
and the function that resides inside is at 0x004A0656

i would do the following
mov ecx,0x004A0650
push ecx //not sure if needed
mov eax, 0x004A0656
call eax
? is this right?

---------- Post added at 08:51 AM ---------- Previous post was at 08:50 AM ----------

if so please mark as solved thanks kibbles
#10 · 14y ago
Hassan
Hassan
Marked Solved.
#11 · 14y ago
Void
Void
The first parameter of a function called within a class is always the instance of the class.

Code:
typedef void(__cdecl* fStopAllSounds)(GameAudio);
fStopAllSounds pStopAllSounds = (fStopAllSounds)0x004A0656;

int main() 
{
      pStopAllSounds(Instanc****ameAudio); //you need to get the instance of the class, can't help you there.
}
#12 · 14y ago
KI
kibbles18
Yes there is the higher level way of doing it as void shows, but the reason it works is explained by my assembly way. And yes op, it should work
#13 · edited 14y ago · 14y ago
HW
hwfhwhfwf
thanks everyone for answering my query +rep
#14 · 14y ago
.::SCHiM::.
.::SCHiM::.
But why not just use polymorphism? That seems to be what you need. Polymorphism - C++ Documentation
#15 · 14y ago
Posts 1–15 of 15 · Page 1 of 1

Post a Reply

Similar Threads

  • With the weapone change addressBy TheRedEye in WarRock - International Hacks
    20Last post 19y ago
  • [Tutorial(C++)]How to call functions within another processBy radnomguywfq3 in Programming Tutorials
    4Last post 18y ago
  • Extracting classes from dynamically loaded libraries.By radnomguywfq3 in C++/C Programming
    3Last post 17y ago
  • grab text and write text from addressBy CodeHPro in Visual Basic Programming
    4Last post 17y ago
  • Calling functions?By Void in C++/C Programming
    6Last post 16y ago

Tags for this Thread

None