简体   繁体   English

使用LUA获取Cheat Engine中字符串搜索的结果数

[英]Get number of results for a string search in Cheat Engine using LUA

I have .txt file containing search strings, each separated by a new line. 我有包含搜索字符串的.txt文件,每个字符串都用一个新行分隔。 I would like to write a LUA script that reads one line at a time from the .txt file. 我想编写一个LUA脚本,从.txt文件一次读取一行。

For each line that is read, a String memory scan should be performed on the opened process in Cheat Engine (in my case, BlueStacks). 对于读取的每一行,应在Cheat Engine(在我的例子中为BlueStacks)中打开的进程上执行String内存扫描。

The number of results for that scan should then be printed to the console. 然后应将该扫描的结果数打印到控制台。 This should repeat with new scans for each search string in the .txt file until the end is reached. 这应该重复对.txt文件中每个搜索字符串的新扫描,直到到达结尾。

I would greatly appreciate any help on this matter. 我非常感谢对此事的任何帮助。 Thanks very much! 非常感谢!

My question was answered by Dark Byte on the Cheat Engine forums . 我的问题在Cheat Engine论坛上由Dark Byte回答。 In case anyone is interested in the solution, here it is: 如果有人对解决方案感兴趣,这里是:

s=createStringlist()
s.LoadFromFile([[d:\bla.txt]])
local protectionflags='' --change this to the kind you need. empty string is everything *X*C*W
local casesensitive=true

local ms=createMemScan()
local fl=createFoundList(ms)

local i
for i=0,s.count-1 do
  ms.firstScan(soExactValue, vtString,nil,s[i],'',0,0x7fffffffffffffff,protectionflags,fsmNotAligned,'1',false,true,false,casesensitive)
  ms.waitTillDone()

  fl.initialize()
  print(s[i]..'='..fl.count)
  fl.deinitialize()
end

fl.destroy()
ms.destroy()
s.destroy()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM