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 


stack simulator ce improvement

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Fresco
Grandmaster Cheater
Reputation: 4

Joined: 07 Nov 2010
Posts: 600

PostPosted: Wed Jan 02, 2013 5:39 pm    Post subject: stack simulator ce improvement Reply with quote

i would like to have a stack simulator for the aa window.
i've been working a lot with game functions and all that stuff and it's hard to keep track of the stack with notepad.
in my opinion, a built in stack simulator is required for assembly language scripts.

thanks for considering.

_________________
... Fresco
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 474

Joined: 09 May 2003
Posts: 25954
Location: The netherlands

PostPosted: Wed Jan 02, 2013 5:50 pm    Post subject: Reply with quote

I'm not really sure what you're using notepad and stacks for when using the auto assembler window

If you mean that your pushes change the esp pointer and you need to keep track of that then instead of using esp, use another variable, like ebp

Code:

push ebp
mov ebp,esp


now you can push and pop from the stack as much as you like (just don't pop more than you pushed)
and you can access the original stack using ebp
e.g
[ebp+4] is the old [esp]
[ebp+8] is the old[esp+4]

and when done (and you have popped your stack back to normal)
Code:

pop ebp



Or do you mean something else than the auto assembler ?

_________________
Tools give you results. Knowledge gives you control.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Fresco
Grandmaster Cheater
Reputation: 4

Joined: 07 Nov 2010
Posts: 600

PostPosted: Wed Jan 02, 2013 6:44 pm    Post subject: Reply with quote

i mean the auto assembler,
the thing is that i can't touch any register (to save a base pointer) because they all serve a purpose in the functions that i call (within my function) so i'm stuck using esp for the stack
i was thinking about a tiny window, that has a textbox and a button (push input and pop)
you type in the text box "anything" press enter and the text that you typed gets pushed into the "virtual stack" and when you click the pop button the last pushed string gets popped out

something like that:
________________________________
| virtual stack....................................X....|
|_______________________________|
|esp............|"user input ascii here"........|
|esp+04......|"input before (esp)"...........|
|_________|_____________________|
|____|text box input (for push) ____|....|
|_______________________________|
|__________________|pop button|___|
|_______________________________|

dots = free space

[edit]
it would also be nice to have ce calculate the last_label+offset of every valid asm line one writes in the auto assembler

.................| label:
label ....C3| ret
label+1.....|
so one can easily control the flow of the program without that many labels

_________________
... Fresco
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 474

Joined: 09 May 2003
Posts: 25954
Location: The netherlands

PostPosted: Thu Jan 03, 2013 4:02 am    Post subject: Reply with quote

Same thing, just use the "local variables" method here
After the mov ebp,esp do a sub esp,xxxxxxxx
[Ebp-4] will be your first local var
[Ebp-8] your second etc...

You can use those addresses to store registers temporarily , and even do calculations on them (if it's just to save registers then pushfd/popfd can be useful)

Just don't forget to clean up with a add esp,xxxxxxxx.


As for the label thing, thats in, but you have to wait for next version for a fix
@F/@B

But honestly, using labels like that is really not recommended as it makes your code hard to read and it's easy to lose track of things then

_________________
Tools give you results. Knowledge gives you control.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Fresco
Grandmaster Cheater
Reputation: 4

Joined: 07 Nov 2010
Posts: 600

PostPosted: Thu Jan 03, 2013 9:31 am    Post subject: Reply with quote

thank you very much. it works like a dream now Smile.
one more thing,
when i use
Code:
createthread(label)

and say i diable and enable the aa code a few times, will ce create a new thread every time i click enable or it's a one time thing ?
because i need it to create the thread just once.


i found the function that "the game" uses to add an item to the inventory, it's basically a push iteamid, call function, add esp,xx;
and i was wondering if i could just do something like:
Code:
[ENABLE]
globalalloc(thread,2048)
label(item)
label(enableit)
registersymbol(item)
registersymbol(enableit)

thread:
cmp byte ptr [enableit],00
je thread
cmp [item], (is valid value)
jne thread
push [item]
call additemfncz
add esp,xx
mov byte ptr [enableit],00

enableit:
db 01

item:
db 00 00 00 00 // add item address to the address list

[DISABLE]
enableit:
db 01

so that every time i enable/disable the code it will add the item.
will that work ?
cuz i don't want to waste time writing the code to figure that out
thanks:)

[edit]
nevermind, i found a better solution.
made a new aa code just for setting to 01 enableit

_________________
... Fresco
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine 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