| View previous topic :: View next topic |
| Author |
Message |
assaf84 Expert Cheater
Reputation: 0
Joined: 03 Oct 2006 Posts: 238
|
Posted: Tue Jun 12, 2007 12:49 pm Post subject: [Question] About ASM in C++ |
|
|
Hey
I'm trying to make a pcomdebug.dll and i'm trying to "translate" the cheat engine auto assembler codes of the hacks into C++. There is a little problem in the CRC Bypass, and all the other hacks wich requires a memory allocation. After I allocate some space with VirtualAlloc, I need to put in this memory piece the ASM code from the auto assembler codes. I know I can just auto injest the code with buffy and check the bytes in the result, and then in the C++ code i'll put them in an array and then I'll move them into the allocated memory, but i'm sure there's an easier way to do it. if i'll use __asm it'll put the asm code in the thread im working at instead of the memory i've allocated, so I don't know how to use it.
Help?
|
|
| Back to top |
|
 |
TheSorc3r3r I post too much
Reputation: 0
Joined: 06 Sep 2006 Posts: 2404
|
Posted: Tue Jun 12, 2007 3:14 pm Post subject: |
|
|
WriteProcessMemory
_________________
Don't laugh, I'm still learning photoshop! |
|
| Back to top |
|
 |
assaf84 Expert Cheater
Reputation: 0
Joined: 03 Oct 2006 Posts: 238
|
Posted: Tue Jun 12, 2007 9:10 pm Post subject: |
|
|
| I don't need this, i'm injected to maple's memory. My only question is if there's a simplier way to put ASM code in a known addresses.
|
|
| Back to top |
|
 |
Uzeil Moderator
Reputation: 6
Joined: 21 Oct 2006 Posts: 2411
|
Posted: Tue Jun 12, 2007 9:32 pm Post subject: |
|
|
You can use inline assembly then copy the bytes.
_________________
|
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Tue Jun 12, 2007 9:33 pm Post subject: |
|
|
| inline assembly is completely unnecessary, it's even a (64 bit) compatilibity issue!
|
|
| Back to top |
|
 |
Uzeil Moderator
Reputation: 6
Joined: 21 Oct 2006 Posts: 2411
|
Posted: Tue Jun 12, 2007 9:34 pm Post subject: |
|
|
Ah yes but they seem to want the quick way out of literally making __ assembly = their assembly, and telling them to get the specific bytes or to hook it to their own high level procedure probably won't be favored.
Do you have something else in mind?
_________________
|
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Tue Jun 12, 2007 9:36 pm Post subject: |
|
|
| I do, but if I tell them the technique, they'll use it.
|
|
| Back to top |
|
 |
Uzeil Moderator
Reputation: 6
Joined: 21 Oct 2006 Posts: 2411
|
Posted: Tue Jun 12, 2007 9:40 pm Post subject: |
|
|
Oh how dreadful that would be. People actually using a technique!
I'm interested myself. Is there away to specify where code goes in a high level format I don't know of? Or is this totally simple/boring and you just wanted to say 'psyche'
_________________
|
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Tue Jun 12, 2007 9:48 pm Post subject: |
|
|
| no this is for autoassembly
|
|
| Back to top |
|
 |
assaf84 Expert Cheater
Reputation: 0
Joined: 03 Oct 2006 Posts: 238
|
Posted: Wed Jun 13, 2007 4:01 am Post subject: |
|
|
Maybe i'll make a function, and i'll put all the asm code in it, and then i'll take a function pointer and copy the memory from there?...
And for checking the address inside.. I can put a NOP there and check the offset from the function start?
(Tell me if something is wrong)
|
|
| Back to top |
|
 |
Noz3001 I'm a spammer
Reputation: 26
Joined: 29 May 2006 Posts: 6220 Location: /dev/null
|
Posted: Wed Jun 13, 2007 6:11 am Post subject: |
|
|
| Or get the address of your function in memory and make the right address jump to your function.
|
|
| Back to top |
|
 |
assaf84 Expert Cheater
Reputation: 0
Joined: 03 Oct 2006 Posts: 238
|
Posted: Wed Jun 13, 2007 6:20 am Post subject: |
|
|
Cool, I'll check it.
Quick question:
In inline asm, can i add labels like:
| Code: |
blablabla
jmp label
blablabla
blablabla
label:
blablabla
blablabla
|
Or I need to make more functions? cause that can be ugly..
Edit: I can do this, thanks god...
|
|
| Back to top |
|
 |
TheSorc3r3r I post too much
Reputation: 0
Joined: 06 Sep 2006 Posts: 2404
|
Posted: Wed Jun 13, 2007 12:52 pm Post subject: |
|
|
_________________
Don't laugh, I'm still learning photoshop! |
|
| Back to top |
|
 |
|