Added lua scripts and fixed a typo in state machine code

This commit is contained in:
Nick Cano
2016-06-06 22:36:51 -07:00
parent 50152ef2c9
commit aceb397307
6 changed files with 131 additions and 1 deletions
@@ -0,0 +1,25 @@
BASEADDRESS = getAddress("Game.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
findString("hello")
findString("world")