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 


BlackMagic FASM error

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

Joined: 22 Aug 2006
Posts: 36

PostPosted: Tue Jun 16, 2009 3:31 am    Post subject: BlackMagic FASM error Reply with quote

I need help. currently i am using the newest blackmagic lib in a program i am making trying to inject the following asm using managed FASM

BlackMagic.Asm.Clear()
BlackMagic.Asm.AddLine("mov eax,[eax+10]")
BlackMagic.Asm.AddLine("mov [0x{0}],eax", Readat.tostring("X8"))
BlackMagic.Asm.AddLine("cmp byte ptr [eax+08],02")
BlackMagic.Asm.AddLine("retn")

after allocating a cave i get an error on the following line
BlackMagic.Asm.Inject(Cave) - Assembly failed! Error code: -118; Error Line: 5

from what i can see everything about that is right. there isnt even a line 5

any suggestions?

if you have no idea what blackmagic is look it up on google its mostly tied to WOW for memory editing

--EDIT--

found out what went wrong. turns out when the managed fasm parses numbers it treats them as decimals and not hex. so my .tostring("X8") was confusing it with hex values. that also meens i need to change any numbers to there decimals if i want them injected right.

injecting "mov eax,[eax+10]" will become "mov eax,[eax+0A]" because its treating it as a decimal. to properly inject it i would need "mov eax,[eax+16]"

i'm not sure if its a bug or a feature but seeing as i have the source im goig to recompile with an optional flag to treat numbers as hex or decimal

stll getting an error at flavy.AddLine("cmp byte ptr [eax+8],02") dont know why though thats part of the orginal code. im just moving it.


Last edited by sired22 on Tue Jun 16, 2009 11:29 pm; edited 3 times in total
Back to top
View user's profile Send private message Yahoo Messenger
&Vage
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Jul 2008
Posts: 1053

PostPosted: Tue Jun 16, 2009 10:18 am    Post subject: Reply with quote

I've been trying to find BlackMagic, can you possible link me to it?
Back to top
View user's profile Send private message
sired22
Cheater
Reputation: 1

Joined: 22 Aug 2006
Posts: 36

PostPosted: Tue Jun 16, 2009 4:42 pm    Post subject: Reply with quote

The compiled dll's, source code, and documentation can be found at
http://forum.gamedeception.net/showthread.php?t=14468
Back to top
View user's profile Send private message Yahoo Messenger
arigity
Advanced Cheater
Reputation: 0

Joined: 03 Jul 2008
Posts: 65
Location: middle of nowhere.

PostPosted: Thu Jun 18, 2009 1:08 pm    Post subject: Re: BlackMagic FASM error Reply with quote

sired22 wrote:
injecting "mov eax,[eax+10]" will become "mov eax,[eax+0A]" because its treating it as a decimal. to properly inject it i would need "mov eax,[eax+16]"


to do hex in fasm you can either write $10, 10h or 0x10

sired22 wrote:
stll getting an error at flavy.AddLine("cmp byte ptr [eax+8],02") dont know why though thats part of the orginal code. im just moving it.


not correct fasm syntax. try cmp byte [eax+8], 02 instead.

_________________
Back to top
View user's profile Send private message
sired22
Cheater
Reputation: 1

Joined: 22 Aug 2006
Posts: 36

PostPosted: Fri Jun 19, 2009 6:48 am    Post subject: Reply with quote

Thanks for the help arigity.

I was looking at the inject method of the source code when i noticed the hex formatters.

Also thanks for the info on the formating. Guess i will have to download fasm documentation so i can check for things like that.

Your post pointed me in the right direction while informing me there might be format issues between fasm and the asm cheat engine displays. so thanks again.
Back to top
View user's profile Send private message Yahoo Messenger
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