Author Message
atom0s
PostPosted: Sun Jun 11, 2017 1:34 pm    Post subject:

writeBytes expects either an endless list of bytes or a table. You are giving it a string. Use writeInteger instead. The way you are printing the results should work fine. If you are not getting any results your scan may be off due to invalid protection flags.

Something else I noticed though is your firstScan call has extra parameters it shouldn't have.

Code:
firstScan(ms, soExactValue, ...


ms shouldn't be there.
jeff.artik
PostPosted: Sun Jun 11, 2017 9:17 am    Post subject: How to find and replace 4bytes values with another one ?

Hi, again some difficulties today Wink

I'm trying to replace after a scan all "398EE33F" values (addresses always change) with another one: "8EE31840"

When I do a manual scan, and I replace all results, it works. So I wanted to script it with LUA as much as I can (and after few hours of search haha)


Here is my script, but doesn't work:

Code:
--Scan
local scan = createMemScan(true);
scan.setOnlyOneResult(false);
scan.firstScan(ms, soExactValue, vtDword, rtRounded, "398EE33F", nil, 0, 0xffffffffffffffff, "+W", fsmAligned, 4, true, false, false, false);
scan.waitTillDone();

--Fetch result
local FoundList=createFoundList(scan);
FoundList.initialize();

--Overwite
for i=0,FoundList.Count-1 do
  print(FoundList.Address[i]);
  writeBytes(FoundList.Address[i],"8EE31840");
end

--Cleanup
FoundList.deinitialize();
FoundList.destroy();
FoundList=nil;
scan.destroy();
scan=nil;


In my case I think my scan works (how to print results?)
But then I suppose "writeBytes" is not correct. Help is welcome

Powered by phpBB © 2001, 2005 phpBB Group