 |
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
Mortalkombatman2 Newbie cheater
Reputation: 0
Joined: 24 Oct 2016 Posts: 14 Location: Gilbert, AZ
|
Posted: Sat Mar 25, 2017 1:29 am Post subject: [Fixed] Scanning string in script then printing scanned item |
|
|
ok so i have a string that i need to scan in a script but then from there i need to get the address of the scanned string so i can then add 83 bytes to the address and get the string address i need (due to it being dynamic), and then i need to print the string from the final address (after the 83 bytes was added to the address gathered from the string search) as the correct length of the string, which is 456 bytes long. I can do it manually, but i have 0 clues as to how to go about doing it via a script automatically. if someone could help me that'd be great, and if you need a better / further explanation, feel free to ask, or if you need any clarification on what i'm asking for / a part of what i'm asking for, feel free to ask. I'll try to respond as fast as possible.
thanks again for helping me if you decide to. (Also, sorry for the long paragraph)
here's the initial search: https :// gyazo . com /c9d291fc10c4980c1e4aefc6a3ec6083
here's how the search is modified: https :// gyazo . com /4818ffad8c97489d1610c891f45f1aa3
so basically i want it to search for a string then go 83 bytes ahead and print that string into the lua engine. I don't usually do value modifications so i don't know how i would go about doing this
edit: forgot to mention, any of the addresses found will work since they contain the exact same string, but in the screenshots i just chose the top one to show as an example because it was closest to my mouse.
(sorry darkbyte for going around the filtering towards posting urls, pls no hate thnx )
_________________
will edit later
Last edited by Mortalkombatman2 on Tue Apr 04, 2017 7:20 pm; edited 4 times in total |
|
Back to top |
|
 |
Corroder Grandmaster Cheater Supreme
Reputation: 75
Joined: 10 Apr 2015 Posts: 1668
|
Posted: Sat Mar 25, 2017 5:05 am Post subject: |
|
|
Maybe something like this :
Code: | baseAddress = getAddress("cheatengine-i386.exe")
function findString(str)
local len = string.len(str)
local chunkSize = 4096
local chunkStep = chunkSize - len
print('Found '..str..' at: ')
for address = baseAddress, (baseAddress + 0x2ffffff), chunkStep do
local chunk = readBytes(address, chunkSize, true)
if (not chunk) then
break
end
for c = 0, chunkSize-len do
checkForString(address, chunk, c, str, len)
end
end
end
function checkForString(address, chunk, start, str, len)
for i = 1, len do
if (chunk[start+i] ~= string.byte(str, i)) then
return false
end
end
print(string.format('\t0x%x', address + start))
end
-- use :
findString('cheat')
result : [[
Found cheat at:
0x958230
0x96ceaf
0x96d108
0x96d4e5
0x96dbf5
0x96dd93
0x96ec9f
0x96fce0
0x96ffb3
0x97acaa
0x97b100
0x97d840
0x98e981
0x991b4f
0x991b84
0x993465
0x993481
0x9934a5
0x994e95
0x9a31ab
0x9a42f7
0x9a4315
0x9aa343
0x9bd7cc
0x9bd7fe
0x9bd9c7
0x9bdae3
0x9bdb09
0x9bdb3d
0x9c0128
0x9c03be
0x9c11e3
0x9c1256
0x9c2b3b
0x9c2b62
0x9c2b86
0x9c67ac
0x9f1cf3
0xa24cde
0xa263b1
0xa29651
0xa29fc4
0xa2b570
0xa5bb97
0xa5d30d
0xa5d365
0xa5d541
0xa5d84f
0xa5d873
0xa5d8c8
0xa5d903
0xa5d914
0xa5d94b
0xa5d959
0xa5d9ca
0xa5e0e7
0xa5e122
0xa5e207
0xa5e341
0xa5e5e9
0xa5fb79
0xa5fbb4
0xa601ea
0xa6027d
0xa6040e
0xa60ad3
0xa622d8
0xa67038
0xa6711c
0xa67160
0xa671e4
0xa6959a
0xa69aeb
0xa69b03
0xa6bfe0
0xa6bff8
0xa6c018
0xa74ff1
0xa7ac0e
0xa82b3c
0xa82b58
0xa82b74
0xa82b94
0xa82bb4
0xa82bd0
0xa82bec
0xa82c10
0xa82c34
0xa82c54
0xa82c74
0xa82c90
0xbeec16
]] |
|
|
Back to top |
|
 |
Mortalkombatman2 Newbie cheater
Reputation: 0
Joined: 24 Oct 2016 Posts: 14 Location: Gilbert, AZ
|
Posted: Sat Mar 25, 2017 10:39 am Post subject: |
|
|
Corroder wrote: | Maybe something like this :
Code: | baseAddress = getAddress("cheatengine-i386.exe")
function findString(str)
local len = string.len(str)
local chunkSize = 4096
local chunkStep = chunkSize - len
print('Found '..str..' at: ')
for address = baseAddress, (baseAddress + 0x2ffffff), chunkStep do
local chunk = readBytes(address, chunkSize, true)
if (not chunk) then
break
end
for c = 0, chunkSize-len do
checkForString(address, chunk, c, str, len)
end
end
end
function checkForString(address, chunk, start, str, len)
for i = 1, len do
if (chunk[start+i] ~= string.byte(str, i)) then
return false
end
end
print(string.format('\t0x%x', address + start))
end
-- use :
findString('cheat')
result : [[
Found cheat at:
0x958230
0x96ceaf
0x96d108
0x96d4e5
0x96dbf5
0x96dd93
0x96ec9f
0x96fce0
0x96ffb3
0x97acaa
0x97b100
0x97d840
0x98e981
0x991b4f
0x991b84
0x993465
0x993481
0x9934a5
0x994e95
0x9a31ab
0x9a42f7
0x9a4315
0x9aa343
0x9bd7cc
0x9bd7fe
0x9bd9c7
0x9bdae3
0x9bdb09
0x9bdb3d
0x9c0128
0x9c03be
0x9c11e3
0x9c1256
0x9c2b3b
0x9c2b62
0x9c2b86
0x9c67ac
0x9f1cf3
0xa24cde
0xa263b1
0xa29651
0xa29fc4
0xa2b570
0xa5bb97
0xa5d30d
0xa5d365
0xa5d541
0xa5d84f
0xa5d873
0xa5d8c8
0xa5d903
0xa5d914
0xa5d94b
0xa5d959
0xa5d9ca
0xa5e0e7
0xa5e122
0xa5e207
0xa5e341
0xa5e5e9
0xa5fb79
0xa5fbb4
0xa601ea
0xa6027d
0xa6040e
0xa60ad3
0xa622d8
0xa67038
0xa6711c
0xa67160
0xa671e4
0xa6959a
0xa69aeb
0xa69b03
0xa6bfe0
0xa6bff8
0xa6c018
0xa74ff1
0xa7ac0e
0xa82b3c
0xa82b58
0xa82b74
0xa82b94
0xa82bb4
0xa82bd0
0xa82bec
0xa82c10
0xa82c34
0xa82c54
0xa82c74
0xa82c90
0xbeec16
]] |
|
With that script I replaced the process with the process it's on, and the "cheat" string to the wanted string, but when it scans for the string it just says this: "Found LOGIN at: " and nothing else.
_________________
will edit later |
|
Back to top |
|
 |
panraven Grandmaster Cheater
Reputation: 61
Joined: 01 Oct 2008 Posts: 958
|
Posted: Sat Mar 25, 2017 3:55 pm Post subject: |
|
|
Hi,
I may be wrong, but it seems you want to find an address (a1) of a known string (s1), then from that address to obtain another result address (a2) and/or another string(s2) that may be changed per every run (dynamic)?
It may help to clarify by some screenshots of your manual search, or some visual to show the relationship, eg:
Code: |
memory -> content
0a0010 -> "KnownString"
0a0010 + 83 -> [address of another string]
[address of another string] -> "SomeDynamicString"(456 bytes long)
|
_________________
- Retarded. |
|
Back to top |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Sat Mar 25, 2017 5:02 pm Post subject: |
|
|
Use CE and find your initial string. Then execute this Lua:
Code: | local found = getCurrentMemscan().FoundList
for i = 0, found.Count - 1 do
local address = tonumber(found.Address[i], 16)
address = address + 83
local other = readString(address, 456)
print(other)
end |
|
|
Back to top |
|
 |
Mortalkombatman2 Newbie cheater
Reputation: 0
Joined: 24 Oct 2016 Posts: 14 Location: Gilbert, AZ
|
Posted: Sun Mar 26, 2017 1:30 am Post subject: |
|
|
panraven wrote: | Hi,
I may be wrong, but it seems you want to find an address (a1) of a known string (s1), then from that address to obtain another result address (a2) and/or another string(s2) that may be changed per every run (dynamic)?
It may help to clarify by some screenshots of your manual search, or some visual to show the relationship, eg:
Code: |
memory -> content
0a0010 -> "KnownString"
0a0010 + 83 -> [address of another string]
[address of another string] -> "SomeDynamicString"(456 bytes long)
|
|
alright i'll edit the thread with that.
-----------------------------------------------------------------
Zanzer wrote: | Use CE and find your initial string. Then execute this Lua:
Code: | local found = getCurrentMemscan().FoundList
for i = 0, found.Count - 1 do
local address = tonumber(found.Address[i], 16)
address = address + 83
local other = readString(address, 456)
print(other)
end |
|
_________________
will edit later |
|
Back to top |
|
 |
panraven Grandmaster Cheater
Reputation: 61
Joined: 01 Oct 2008 Posts: 958
|
Posted: Sun Mar 26, 2017 3:34 am Post subject: |
|
|
Zanzer's script should work , just change
address = address + 83
to
address = address + 0x83 .
_________________
- Retarded. |
|
Back to top |
|
 |
Mortalkombatman2 Newbie cheater
Reputation: 0
Joined: 24 Oct 2016 Posts: 14 Location: Gilbert, AZ
|
Posted: Sun Mar 26, 2017 4:14 am Post subject: |
|
|
panraven wrote: | Zanzer's script should work , just change
address = address + 83
to
address = address + 0x83 . |
his script worked however i was wondering if there was a way to make it just take the first address found out of the scanned items instead of all of them
_________________
will edit later |
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 467
Joined: 09 May 2003 Posts: 25704 Location: The netherlands
|
Posted: Sun Mar 26, 2017 5:02 am Post subject: |
|
|
no for loop and just use found.Address[0]
or use the memscan class directly and tell it to find only one result
_________________
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 |
|
 |
Mortalkombatman2 Newbie cheater
Reputation: 0
Joined: 24 Oct 2016 Posts: 14 Location: Gilbert, AZ
|
Posted: Sun Mar 26, 2017 5:22 am Post subject: |
|
|
Dark Byte wrote: | no for loop and just use found.Address[0]
or use the memscan class directly and tell it to find only one result |
okay thanks that helped, i fixed that part, but is there a way to make the script also do the search too?
_________________
will edit later |
|
Back to top |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Sun Mar 26, 2017 7:16 am Post subject: |
|
|
Code: | local myvalue = "blahblah"
local memscan = createMemScan()
memscan.OnlyOneResult = true
memscan.firstScan(
soExactValue, vtString, rtRounded,
myvalue, nil, 0x0, 0xffffffffffffffff, "+W*X",
fsmNotAligned, "1", false, false, false, false)
memscan.waitTillDone()
local address = memscan.Result
if address then
address = address + 0x83
local other = readString(address, 456)
print(other)
else
print("Not found")
end
memscan.Destroy() |
|
|
Back to top |
|
 |
Corroder Grandmaster Cheater Supreme
Reputation: 75
Joined: 10 Apr 2015 Posts: 1668
|
Posted: Sun Mar 26, 2017 7:51 am Post subject: |
|
|
Zanzer wrote: | Code: | local myvalue = "blahblah"
local memscan = createMemScan()
memscan.OnlyOneResult = true
memscan.firstScan(
soExactValue, vtString, rtRounded,
myvalue, nil, 0x0, 0xffffffffffffffff, "+W*X",
fsmNotAligned, "1", false, false, false, false)
memscan.waitTillDone()
local address = memscan.Result
if address then
address = address + 0x83
local other = readString(address, 456)
print(other)
else
print("Not found")
end
memscan.Destroy() |
|
I wonder if this work for roblo game. I hope this will work properly and it will great...
Regards
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|
Back to top |
|
 |
panraven Grandmaster Cheater
Reputation: 61
Joined: 01 Oct 2008 Posts: 958
|
|
Back to top |
|
 |
|
|
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
|
|