View previous topic :: View next topic |
Author |
Message |
YoucefHam Cheater
Reputation: 5
Joined: 19 Mar 2015 Posts: 39 Location: Algeria
|
Posted: Tue Jan 31, 2017 9:23 pm Post subject: [Solved] Simple math I neeed examples Please. |
|
|
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 |
|
 |
YoucefHam Cheater
Reputation: 5
Joined: 19 Mar 2015 Posts: 39 Location: Algeria
|
Posted: Wed Feb 01, 2017 2:16 pm Post subject: |
|
|
Please any one,
I need this, I don't have just one function.
Pleeeeeease.
|
|
Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 152
Joined: 06 Jul 2014 Posts: 4703
|
Posted: Wed Feb 01, 2017 2:20 pm Post subject: |
|
|
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 |
|
 |
YoucefHam Cheater
Reputation: 5
Joined: 19 Mar 2015 Posts: 39 Location: Algeria
|
Posted: Wed Feb 01, 2017 5:27 pm Post subject: |
|
|
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 |
Description: |
This is the table befor activating. |
|
Filesize: |
18.15 KB |
Viewed: |
5997 Time(s) |

|
Description: |
This is the table and mem viewer after activating |
|
Filesize: |
50.68 KB |
Viewed: |
5997 Time(s) |

|
Description: |
This is the addrs with the values. |
|
Filesize: |
12.08 KB |
Viewed: |
5997 Time(s) |

|
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25804 Location: The netherlands
|
Posted: Wed Feb 01, 2017 5:38 pm Post subject: |
|
|
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 |
|
 |
YoucefHam Cheater
Reputation: 5
Joined: 19 Mar 2015 Posts: 39 Location: Algeria
|
Posted: Wed Feb 01, 2017 5:42 pm Post subject: |
|
|
Thank you @Dark Byte
The Problem solved.
so if the number is too long I will use 8 not 4.
|
|
Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 152
Joined: 06 Jul 2014 Posts: 4703
|
Posted: Wed Feb 01, 2017 5:47 pm Post subject: |
|
|
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 |
|
 |
YoucefHam Cheater
Reputation: 5
Joined: 19 Mar 2015 Posts: 39 Location: Algeria
|
Posted: Wed Feb 01, 2017 6:06 pm Post subject: |
|
|
ooh that's good to know.
Thanks.
|
|
Back to top |
|
 |
|