Jump to content
  • 0

Question

Posted (edited)

anyone can teach to make simple script search for xor key and xor value for lua multiple/prompt search?

sample

--here I want to input the known xorkey1 and 2 and the two values needed to use those xorkeys

d = gg.prompt({i='xorkey1;valueneedtobeXoredUsingxorkey1;xorkey2;valueneedtobeXoredUsingxorkey2'}, {i='0;1;5::100'})

gg.searchNumber(d.i..';1;5::100', gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)

o = gg.getResults(4)

--here wanted the edit value to be xor'ed using xorkey1 and 2 respectively instead of just replacing it by dword

o[2].value = '1000000000'
o[2].flags = gg.TYPE_DWORD

o[4].value = '2000000000'
o[4].flags = gg.TYPE_DWORD

hope someone can understand, thanks in advance guys 🙂

Edited by absolutenothing
changed code for lua func

9 answers to this question

Recommended Posts

  • 0
Posted (edited)

You mean "Make a dialog for editing Xor Key and Value to Xored" ?

Maybe this could be usefull ..
 

xor = bit32.bxor
sf	= string.format

DefaultXorKey_1	= 0xFF
DefaultXorKey_2	= 0xAA

DialogOut = gg.prompt({
'Xor Key #1',	-- [1]
"Value #1",		-- [2]
'Xor Key #2', 	-- [3]
"Value #2"		-- [4]
},
{DefaultXorKey_1, 0, DefaultXorKey_2, 0},
{number, number, number, number})

XoredValueWithKey_1	= xor(DialogOut[2], DialogOut[1])
XoredValueWithKey_2	= xor(DialogOut[4], DialogOut[3])

gg.clearResults()
gg.searchNumber(sf("%d;%d;%d;%d;1;5:100", DialogOut[1], XoredValueWithKey_1, DialogOut[3], XoredValueWithKey_2), gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)

o = gg.getResults(4)
o[2].value = xor(1000000000, DialogOut[1])
o[4].value = xor(1000000000, DialogOut[3])

 

Example.lua

Edited by saiaapiz
Adding example.
  • 0
Posted
4 hours ago, saiaapiz said:

You mean "Make a dialog for editing Xor Key and Value to Xored" ?

Maybe this could be usefull ..
 


xor = bit32.bxor
sf	= string.format

DefaultXorKey_1	= 0xFF
DefaultXorKey_2	= 0xAA

DialogOut = gg.prompt({
'Xor Key #1',	-- [1]
"Value #1",		-- [2]
'Xor Key #2', 	-- [3]
"Value #2"		-- [4]
},
{DefaultXorKey_1, 0, DefaultXorKey_2, 0},
{number, number, number, number})

XoredValueWithKey_1	= xor(DialogOut[2], DialogOut[1])
XoredValueWithKey_2	= xor(DialogOut[4], DialogOut[3])

gg.clearResults()
gg.searchNumber(sf("%d;%d;%d;%d;1;5:100", DialogOut[1], XoredValueWithKey_1, DialogOut[3], XoredValueWithKey_2), gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)

o = gg.getResults(4)
o[2].value = xor(1000000000, DialogOut[1])
o[4].value = xor(1000000000, DialogOut[3])

 

Example.lua 684 B · 1 download

thank you very much @saiaapiz 🙂 ill try it soon

  • 0
Posted (edited)

wanted this to work properly but idk why it doesn't for me...

19 hours ago, saiaapiz said:

gg.searchNumber(sf("%d;%d;%d;%d;1;5:100", DialogOut[1], XoredValueWithKey_1, DialogOut[3], XoredValueWithKey_2), gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)

o = gg.getResults(4)

o[2].value = xor(1000000000, DialogOut[1])

o[4].value = xor(1000000000, DialogOut[3])

so I did for the mean time to check if values can change was

gg.searchNumber(sf("%d;%d;%d;%d;%d;%d::45",  DialogOut[1], XorValueWithKey_1, DialogOut[1], XorvValueWithKey_2, DialogOut[1], XorValueWithKey_3), gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
gg.searchNumber(sf("%d;%d;%d", XorValueWithKey_1, XorValueWithKey_2, XorValueWithKey_2), gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)

gg.getResults(3)
gg.editAll('1222333444', gg.TYPE_DWORD)

suddenly the values changed but not the way I really like to edit each with different values.

Edited by absolutenothing
spacing/indent
  • 0
Posted
1 hour ago, absolutenothing said:

wanted this to work properly but idk why it doesn't for me...

so I did for the mean time to check if values can change was


gg.searchNumber(sf("%d;%d;%d;%d;%d;%d::45",  DialogOut[1], XorValueWithKey_1, DialogOut[1], XorvValueWithKey_2, DialogOut[1], XorValueWithKey_3), gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
gg.searchNumber(sf("%d;%d;%d", XorValueWithKey_1, XorValueWithKey_2, XorValueWithKey_2), gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)

gg.getResults(3)
gg.editAll('1222333444', gg.TYPE_DWORD)

suddenly the values changed but not the way I really like to edit each with different values.

Check gg.getResults return value, It may return less than what you expected.

That why it doesnt work, and only changed when you use gg.editAll.

  • 0
Posted (edited)
1 hour ago, saiaapiz said:

Check gg.getResults return value, It may return less than what you expected.

That why it doesnt work, and only changed when you use gg.editAll.

im sure the
o = gg.getResults(6)
value is ok forthe values to be edited by

o[2].value = xor(100, DialogOut[1])

o[4].value = xor(200, DialogOut[1])

o[6].value = xor(200, DialogOut[1])

ill soon upload a short video while doing the search.

Edited by absolutenothing
  • 0
Posted

Oh i forgot about important thing, Now i know why it failed to change value xD

gg.setValues must appended after modifiying result from gg.getResults.
 

xor = bit32.bxor
sf	= string.format

DefaultXorKey_1	= 0xFF
DefaultXorKey_2	= 0xAA

DialogOut = gg.prompt({
'Xor Key #1',	-- [1]
"Value #1",		-- [2]
'Xor Key #2', 	-- [3]
"Value #2"		-- [4]
},
{DefaultXorKey_1, 0, DefaultXorKey_2, 0},
{number, number, number, number})

XoredValueWithKey_1	= xor(DialogOut[2], DialogOut[1])
XoredValueWithKey_2	= xor(DialogOut[4], DialogOut[3])

gg.clearResults()
gg.searchNumber(sf("%d;%d;%d;%d;1;5:100", DialogOut[1], XoredValueWithKey_1, DialogOut[3], XoredValueWithKey_2), gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)

o = gg.getResults(4)
o[2].value = xor(1000000000, DialogOut[1])
o[4].value = xor(1000000000, DialogOut[3])


gg.setValues(o) -- < This api is required to apply modified value.

 

  • 0
Posted
28 minutes ago, saiaapiz said:

Oh i forgot about important thing, Now i know why it failed to change value xD

gg.setValues must appended after modifiying result from gg.getResults.

ohhh yeah I also forgot that hahaha thanks alot, learned new with the xor for lua 🙂

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.