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 


C&C95 Map Reveal - Can someone explain

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
Hyperactive1337
How do I cheat?
Reputation: 0

Joined: 21 Jan 2015
Posts: 2

PostPosted: Wed Jan 21, 2015 6:12 pm    Post subject: C&C95 Map Reveal - Can someone explain Reply with quote

Hello everyone,

I managed to make a map hack for RA1 with no help. Struggling a bit more on C&C95 due to the fact there is no spysat or anything to reveal the map and find the memory addresses. I found the below assembly script in one of the cheat tables on this site. It works... but i just don't "get it"

I make my trainers in Visual Basic 6.0 and i just cant work out what the hell is going on here.

Can someone translate it into psuedocode or english? Just so i can get my head round it!!



CREATETHREAD(map_mem)

map_mem:
mov edx, 0
xor eax, eax
mov ecx,[cnc95.EXE+13DDC0]
loop1:
cmp eax,1000
jge exit
mov BYTE PTR [ecx+edx], 0c
inc eax
add edx, 21
jmp loop1
exit:
xor eax, eax
ret

[DISABLE]
CREATETHREAD(map_mem)
Back to top
View user's profile Send private message
VicTT
How do I cheat?
Reputation: 0

Joined: 28 Nov 2014
Posts: 4

PostPosted: Thu Jan 22, 2015 12:59 pm    Post subject: Reply with quote

Well...basically what this does is overwrite some memory addresses with the byte 0C.
I'll attempt to provide equivalent pseudo-code in Pseudo-VB:
Code:

Dim $ctr1=0 ;ax
Dim $ctr2=0 ;dx
Dim $offset=Get_Byte_At_Memory_Address(13DDC0) ;cx
for $ctr1=0 to 999
Set_Byte_At_Memory_Address($offset+$ctr2)
$ctr2+=21
next $ctr1
$ctr1=0

Now...unless I messed up some equivalence between cpu registers and pseudo-VB variables, that should be accurate.
Basically it just writes 0C every 21 bytes, 1000 times, from a memory address it gets in $offset (cx).
EDIT: Of course, when I say "Set/Get Byte At Memory Address", I'm referring to an offset relative to where the process is in memory. This is not absolute addressing, because only Windows (and therefore, Cheat Engine as well) knows what block of memory it allocated to the game.
EDIT2: Found a mistake. Since the jump is "jge" (jump if greater or equal to), then the loop never gets executed for ax=1000, therefore the loop starts at 0 and ends at 999.


Last edited by VicTT on Mon Jan 26, 2015 3:16 am; edited 1 time in total
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 198

Joined: 25 Jan 2006
Posts: 8517
Location: 127.0.0.1

PostPosted: Thu Jan 22, 2015 2:50 pm    Post subject: Reply with quote

Moved to general game hacking as this does not have anything to do with Lua.
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Hyperactive1337
How do I cheat?
Reputation: 0

Joined: 21 Jan 2015
Posts: 2

PostPosted: Fri Jan 23, 2015 10:55 am    Post subject: Reply with quote

Thank you so much for your help!!

It's strange though... when i test it on VB there is nothing in offset: 13DDC0 but on cheat engine it always works...

Logically it must be reading a value from 13DDC0 and which points to the correct memory address... but when i do it in VB there is nothing in 13DDC0. It's not even a readable address

am i missing something?
Back to top
View user's profile Send private message
VicTT
How do I cheat?
Reputation: 0

Joined: 28 Nov 2014
Posts: 4

PostPosted: Mon Jan 26, 2015 3:14 am    Post subject: Reply with quote

Kindly post your VB code and I'll take a whack at debugging it.
Back to top
View user's profile Send private message
Hyperactive1337
How do I cheat?
Reputation: 0

Joined: 21 Jan 2015
Posts: 2

PostPosted: Wed Jan 28, 2015 8:39 pm    Post subject: Reply with quote

Hey thanks for all your help. I worked it out (somehow)

The actual address pointer is actually 53DDC0 rather than 13DDC0
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 Gamehacking 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