Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[Question] About ASM in C++

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
assaf84
Expert Cheater
Reputation: 0

Joined: 03 Oct 2006
Posts: 238

PostPosted: Tue Jun 12, 2007 12:49 pm    Post subject: [Question] About ASM in C++ Reply with quote

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
View user's profile Send private message
TheSorc3r3r
I post too much
Reputation: 0

Joined: 06 Sep 2006
Posts: 2404

PostPosted: Tue Jun 12, 2007 3:14 pm    Post subject: Reply with quote

WriteProcessMemory
_________________


Don't laugh, I'm still learning photoshop!
Back to top
View user's profile Send private message
assaf84
Expert Cheater
Reputation: 0

Joined: 03 Oct 2006
Posts: 238

PostPosted: Tue Jun 12, 2007 9:10 pm    Post subject: Reply with quote

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
View user's profile Send private message
Uzeil
Moderator
Reputation: 6

Joined: 21 Oct 2006
Posts: 2411

PostPosted: Tue Jun 12, 2007 9:32 pm    Post subject: Reply with quote

You can use inline assembly then copy the bytes.
_________________


Mini Engine v3.0
Mipla v1.0

Reposted old threads out of the MS section.
Back to top
View user's profile Send private message
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Tue Jun 12, 2007 9:33 pm    Post subject: Reply with quote

inline assembly is completely unnecessary, it's even a (64 bit) compatilibity issue!
Back to top
View user's profile Send private message
Uzeil
Moderator
Reputation: 6

Joined: 21 Oct 2006
Posts: 2411

PostPosted: Tue Jun 12, 2007 9:34 pm    Post subject: Reply with quote

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?

_________________


Mini Engine v3.0
Mipla v1.0

Reposted old threads out of the MS section.
Back to top
View user's profile Send private message
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Tue Jun 12, 2007 9:36 pm    Post subject: Reply with quote

I do, but if I tell them the technique, they'll use it.
Back to top
View user's profile Send private message
Uzeil
Moderator
Reputation: 6

Joined: 21 Oct 2006
Posts: 2411

PostPosted: Tue Jun 12, 2007 9:40 pm    Post subject: Reply with quote

Oh how dreadful that would be. People actually using a technique! Shocked

Razz I'm interested myself. Is there away to specify where code goes in a high level format I don't know of? Smile Or is this totally simple/boring and you just wanted to say 'psyche'

_________________


Mini Engine v3.0
Mipla v1.0

Reposted old threads out of the MS section.
Back to top
View user's profile Send private message
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Tue Jun 12, 2007 9:48 pm    Post subject: Reply with quote

no this is for autoassembly
Back to top
View user's profile Send private message
assaf84
Expert Cheater
Reputation: 0

Joined: 03 Oct 2006
Posts: 238

PostPosted: Wed Jun 13, 2007 4:01 am    Post subject: Reply with quote

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
View user's profile Send private message
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Wed Jun 13, 2007 6:11 am    Post subject: Reply with quote

Or get the address of your function in memory and make the right address jump to your function.
Back to top
View user's profile Send private message MSN Messenger
assaf84
Expert Cheater
Reputation: 0

Joined: 03 Oct 2006
Posts: 238

PostPosted: Wed Jun 13, 2007 6:20 am    Post subject: Reply with quote

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? Shocked cause that can be ugly..

Edit: I can do this, thanks god...
Back to top
View user's profile Send private message
TheSorc3r3r
I post too much
Reputation: 0

Joined: 06 Sep 2006
Posts: 2404

PostPosted: Wed Jun 13, 2007 12:52 pm    Post subject: Reply with quote

Code:
label1:

_________________


Don't laugh, I'm still learning photoshop!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites