Solved CodeCave detect multiple arguments in format string

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

gergomiho

Newbie
Dank Tier Donator
Apr 5, 2015
1
62
0
Hello,

I've been doing some code cave, a debug message output has been remove from a game and I want to restore it.

Its a typical printf(Format, args) call, and its working fine, but sometimes there are multiple arguments. How do I detect them, and how do I display them correctly ?

Original code :

0049D620 $ /C3 RETN

Here is what I replace to :

void PrintDebugString()
{
printf((CHAR *)Format, Message);
printf("\n");
}

__declspec(naked) void codecave_PrintDebugStrings()
{
__asm pop returnAddress
__asm pop Format
__asm pop Message
__asm pushad
__asm pushfd
PrintDebugString();
__asm popfd
__asm popad
__asm push Message
__asm push Format
__asm push returnAddress
__asm ret
}
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods