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 


[Solved] Simple math I neeed examples Please.

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
YoucefHam
Cheater
Reputation: 5

Joined: 19 Mar 2015
Posts: 39
Location: Algeria

PostPosted: Tue Jan 31, 2017 9:23 pm    Post subject: [Solved] Simple math I neeed examples Please. Reply with quote

hello,

I have fond a function read all my inventory item count, and I want to get those addrs

in item 1 "rdx = 0"
in item 2 "rdx = 1"
.....
in item 8 "rdx = 7"

I don't want to get every addrs alone like

Code:
cmp rdx,0
mov [item1],rsi
......
cmp rdx,1
mov [item2],rsi
.....


I want it to be in single variable
Code:

mov [items+rdx*4],rsi


can I do that ???

please Help.


Last edited by YoucefHam on Wed Feb 01, 2017 5:42 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
YoucefHam
Cheater
Reputation: 5

Joined: 19 Mar 2015
Posts: 39
Location: Algeria

PostPosted: Wed Feb 01, 2017 2:16 pm    Post subject: Reply with quote

Please any one,

I need this, I don't have just one function.

Pleeeeeease.
Back to top
View user's profile Send private message Send e-mail
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4703

PostPosted: Wed Feb 01, 2017 2:20 pm    Post subject: Reply with quote

Unless I'm misunderstanding you, the code you wrote down (i.e. mov [items+rdx*4],rsi) is the solution you're looking for. If it isn't working, post your full script so others can see what's wrong.
_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
YoucefHam
Cheater
Reputation: 5

Joined: 19 Mar 2015
Posts: 39
Location: Algeria

PostPosted: Wed Feb 01, 2017 5:27 pm    Post subject: Reply with quote

Very Happy Thank you @ParkourPenguin for your reply.

you are rigth, the code is working but this is the problem

I have to get 8 letters in the addrs but there is something wrong, 16 letters in the addrs.

check the picturs.

Code:
[ENABLE]
{$lua}
LaunchMonoDataCollector()
{$asm}
alloc(newmem_ItemInventory,2048,ItemStack:IsEmpty+10)
label(returnhere_ItemInventory)
label(originalcode_ItemInventory)
label(exit_ItemInventory)
alloc(Items,$1000)
alloc(ItemsTlb,100)
alloc(ItemsCheck,100)
registersymbol(Items)
label(check)

newmem_ItemInventory:
cmp [ItemsCheck],1  //did you get the unique number??
jne check
cmp r14,[ItemsTlb] //are you the unique number??
jne originalcode_ItemInventory
cmp rdx,8  //I have 7 Items
jnl originalcode_ItemInventory
mov [Items+rdx*4],rsi
add [Items+rdx*4],18
jmp originalcode_ItemInventory

check:
cmp rdx,6 //take this item as example to get info's
jne originalcode_ItemInventory
mov [ItemsTlb],r14 //this is the unique number
mov [ItemsCheck],1 //Set as checked

originalcode_ItemInventory:
movsxd  rax,dword ptr [rsi+18]
cmp eax,01

exit_ItemInventory:
jmp returnhere_ItemInventory
ItemStack:IsEmpty+10:
jmp newmem_ItemInventory
nop
nop
returnhere_ItemInventory:
[DISABLE]
dealloc(newmem_ItemInventory)
dealloc(Items)
dealloc(ItemsTlb)
dealloc(ItemsCheck)
unregistersymbol(Items)
ItemStack:IsEmpty+10:
db 48 63 46 18 83 F8 01



Epic_Pen_2017-02-01_23-45-04.png
 Description:
This is the table befor activating.
 Filesize:  18.15 KB
 Viewed:  6004 Time(s)

Epic_Pen_2017-02-01_23-45-04.png



Epic_Pen_2017-02-01_23-48-24.png
 Description:
This is the table and mem viewer after activating
 Filesize:  50.68 KB
 Viewed:  6004 Time(s)

Epic_Pen_2017-02-01_23-48-24.png



cheatengine-x86_64_2017-02-01_23-49-19.png
 Description:
This is the addrs with the values.
 Filesize:  12.08 KB
 Viewed:  6004 Time(s)

cheatengine-x86_64_2017-02-01_23-49-19.png


Back to top
View user's profile Send private message Send e-mail
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Wed Feb 01, 2017 5:38 pm    Post subject: Reply with quote

rdx*8
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

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

Joined: 19 Mar 2015
Posts: 39
Location: Algeria

PostPosted: Wed Feb 01, 2017 5:42 pm    Post subject: Reply with quote

Thank you @Dark Byte

The Problem solved.

so if the number is too long I will use 8 not 4.
Back to top
View user's profile Send private message Send e-mail
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4703

PostPosted: Wed Feb 01, 2017 5:47 pm    Post subject: Reply with quote

I'm disappointed I missed that.

Addresses in 64-bit processes are usually 64 bits (8 bytes) big. In order to store something 8 bytes big, you need 8 bytes of space. In this case, when indexing an array, you need to multiply the index by 8 to get the correct address.

Multiplying the index by 4 would be correct for a 32-bit process where addresses take up only 4 bytes.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
YoucefHam
Cheater
Reputation: 5

Joined: 19 Mar 2015
Posts: 39
Location: Algeria

PostPosted: Wed Feb 01, 2017 6:06 pm    Post subject: Reply with quote

ooh that's good to know.

Thanks. Very Happy Very Happy Very Happy
Back to top
View user's profile Send private message Send e-mail
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