| View previous topic :: View next topic |
| Author |
Message |
etioplmld Advanced Cheater
Reputation: 0
Joined: 09 Feb 2021 Posts: 83
|
Posted: Sun Aug 28, 2022 10:22 pm Post subject: how to set the value of multiple encrypted addresses? |
|
|
A game is encrypted but can be decrypted with a custom value type,When need to change a lot of Continuous addresses,
adding them all to one table and set to custom value type. and use this.
| Code: |
local list = getAddressList()
for n = 0, list.Count - 1 do
local rec = list[n]
cp = tonumber(rec.value)
if cp ~= nil
then
if cp > 0 then
rec.value = 999
end
end
end
|
Is there any other way? |
|
| Back to top |
|
 |
cooleko Grandmaster Cheater
Reputation: 11
Joined: 04 May 2016 Posts: 717
|
|
| Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 152
Joined: 06 Jul 2014 Posts: 4721
|
Posted: Sun Aug 28, 2022 11:28 pm Post subject: |
|
|
See the CustomType class in celua.txt. In particular, the global function `getCustomType` and the methods `byteTableToValue` and `valueToByteTable`. With that, you can get a byte table with `readBytes(address, true)` and run it through a custom type handler (and vise versa w/ `writeBytes`).
Note that the `valueToByteTable` function uses uninitialized memory for the output buffer, so a `ConvertBackRoutine` implementation that reads from the output buffer may produce unpredictable results. I don't know any easy way of solving this. _________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25837 Location: The netherlands
|
|
| Back to top |
|
 |
etioplmld Advanced Cheater
Reputation: 0
Joined: 09 Feb 2021 Posts: 83
|
Posted: Mon Aug 29, 2022 2:17 am Post subject: |
|
|
It looks more complicated than repeating the encryption
about Convert assembly instructions ' xor , rol ,ror , 'to lua
Is this correct?
xor = bXor
rol num n = num * 2^n ,Rotate left is equal to multiplying by 2 to the nth power ,
ror num n = num / 2^n
someone calculate rol a number in lua ,like rol eax 14 ,he use multiply 16384(2^14=16384).
Last edited by etioplmld on Mon Aug 29, 2022 6:43 am; edited 1 time in total |
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25837 Location: The netherlands
|
Posted: Mon Aug 29, 2022 3:54 am Post subject: |
|
|
xor is value ~ x
rol and ror are a bit more tricky, as lua only has shl (value << x) and shr(value >> x), and ror/rol are also more dependand on bitsize of the value operated on _________________
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 |
|
 |
etioplmld Advanced Cheater
Reputation: 0
Joined: 09 Feb 2021 Posts: 83
|
Posted: Wed Aug 31, 2022 8:02 am Post subject: |
|
|
a related script found on other sites
| Code: |
function bRot32(i, n)
n = n & 31
return i >> n | i << (32 - n) & 0xFFFFFFFF
end
AGEbitFields3 = registerCustomTypeLua('AGEbitFields3', 4, function(...)
local v = byteTableToDword({...})
return bRot32(v ~ readInteger("AUX"), 0x0E) >> 3 & 1
end, function(b, a)
local c = bRot32(readInteger(a) ~ readInteger("AUX"), 0x0E) & ~(1 << 3) | (b & 1) << 3
return unpack(dwordToByteTable(bRot32(c, -0x0E) ~ readInteger("AUX")))
end, false)
|
it's difficult to understand
Is the function bRot32 equal to rol ? |
|
| Back to top |
|
 |
|