Solved Multi-instructional assembler macro

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

Liduen

Hacker
Dank Tier VIP
May 19, 2013
702
8,478
33
Does someone know how to properly define an inline assembler macro?
I tried it like this and I get errors
C++:
#define abc __asm {pushfd; pushad; popad; popfd;}
I use it like
C++:
void func()
{
    abc
}
 
Last edited:

till0sch

Respected Hacker
Dank Tier VIP
Dank Tier Donator
Oct 14, 2012
1,104
12,593
51
This is what I found:

#define PORTIO __asm /* Port output */ { __asm mov al, 2 __asm mov dx, 0xD007 __asm out dx, al }

here: https://msdn.microsoft.com/de-de/library/352sth8z.aspx


In your case that'd be

#define SAVE _asm { _asm pushfd _asm pushad }
#define RESTORE _asm { _asm popad _asm popfd }
 
Last edited:
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