Jump to content
  • 0

Xor in Lua Script


sammax71

Question

What I'm trying to achieve is a prompt to come up for the player to input the value of coins they have. Then I want GG to search their valueX4.

I've read these three posts:

Find XOR values - LUA script (#9lyllu5v)

Xor keys in Script (#3ckvqdrl)

XOR search Guide - GG 8.29.0+ (#2pt9z7db)

and tried to implement things from those posts into my script to no avail.

Can anybody point me in the right direction? Is what I'm trying to do achievable? Is there anything in any of those posts that will do what I need? 

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

On 6/29/2021 at 11:22 AM, MAARS said:

There was a librarie bit32 in lua 5.2 it is not available in the latest lua version but in gameguardian you can use cause enyby keeped it.


local myValue = tostring(bit32.bxor(40, 444444))
gg.searchNumber(myValue, gg.TYPE_DWORD)

What does it mean ?

the function bit32.bxor returns the bitwise or of its operands. so here the 444444 is my xor encryption key, you will replace it with the key used by your game

just for info, in 5.4 bit32.bxor is removed, but we can still do same operation by "~" operator :

local myValue = tostring(40~444444)
gg.searchNumber(myValue, gg.TYPE_DWORD)

 

Link to comment
Share on other sites

16 hours ago, TopGEOYT said:

just for info, in 5.4 bit32.bxor is removed, but we can still do same operation by "~" operator :


local myValue = tostring(40~444444)
gg.searchNumber(myValue, gg.TYPE_DWORD)

 

Enyby keeped it, in gameguardian bit32 library still exists

Link to comment
Share on other sites

15 hours ago, sammax71 said:

What I'm trying to achieve is a prompt to come up for the player to input the value of coins they have. Then I want GG to search their valueX4.

I've read these three posts:

Find XOR values - LUA script (#9lyllu5v)

Xor keys in Script (#3ckvqdrl)

XOR search Guide - GG 8.29.0+ (#2pt9z7db)

and tried to implement things from those posts into my script to no avail.

Can anybody point me in the right direction? Is what I'm trying to do achievable? Is there anything in any of those posts that will do what I need?

Well, about xor i cant advice you anything, but for editing coins its better to find value which is same all time when game exeutes and jump from this value to coin value by offsets.

Link to comment
Share on other sites

17 minutes ago, TopGEOYT said:

Well, about xor i cant advice you anything, but for editing coins its better to find value which is same all time when game exeutes and jump from this value to coin value by offsets.

I was trying to use offsets to start with which I am familiar with but wasn't able to find a decent search to start with where the values never change.

I'll take another look.

Thanks for your input 👍🏻

Link to comment
Share on other sites

3 hours ago, sammax71 said:

I was trying to use offsets to start with which I am familiar with but wasn't able to find a decent search to start with where the values never change.

I'll take another look.

Thanks for your input 👍🏻

Ohk, Welcome

Link to comment
Share on other sites

There was a librarie bit32 in lua 5.2 it is not available in the latest lua version but in gameguardian you can use cause enyby keeped it.

local myValue = tostring(bit32.bxor(40, 444444))
gg.searchNumber(myValue, gg.TYPE_DWORD)

What does it mean ?

the function bit32.bxor returns the bitwise or of its operands. so here the 444444 is my xor encryption key, you will replace it with the key used by your game

Link to comment
Share on other sites

For your template you can use this :

gg.clearResults()
local input = gg.prompt({"Input number"},{},{'number'})
if input == nil then os.exit() end
local num = tostring(bit32.bxor(tonumber(input[1]), 444444)) -- i saw that your key is X4 so keep the key here 444444
gg.searchNumber(num, gg.TYPE_DWORD) -- you can even concat num, if there is a group search
gg.refineNumber(num, gg.TYPE_DWORD)

 

Link to comment
Share on other sites

37 minutes ago, MAARS said:

For your template you can use this :


gg.clearResults()
local input = gg.prompt({"Input number"},{},{'number'})
if input == nil then os.exit() end
local num = tostring(bit32.bxor(tonumber(input[1]), 444444)) -- i saw that your key is X4 so keep the key here 444444
gg.searchNumber(num, gg.TYPE_DWORD) -- you can even concat num, if there is a group search
gg.refineNumber(num, gg.TYPE_DWORD)

 

I'm still not getting it to work but you've given me something to work with. I shall keep trying. Thank you 👍🏻

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.