| jeff.artik | 
			
				|  Posted: Sun Jun 11, 2017 9:17 am    Post subject: How to find and replace 4bytes values with another one ? |  
				| 
 |  
				| Hi, again some difficulties today   
 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
 |  |