我想用python做二进制搜索。就像
Address = buff.find(b'\x99\x98\xB1\xFF')
我想让这个搜索模式通过JSON文件进行配置。所以我创建了一个变量来保存JSON文件中的数据,比如“Pattern”:“\x99\x98\xB1\xFF”
Search_Pattern=Data_Structure[data]["Pattern"]
print "Search Pattern:", Search_Pattern
Address = buff.find(b'***Search_Pattern***') # this won't work. How to input the function variable here?
如何将模式从ASCII格式转换为二进制格式buff.查找功能?你知道吗
数据类型转换
当} ,并将其作为参数直接传递给
json
被读取和解析时,该项可能会被读取为一个字符串,可以转换成^{buff.find()
。你知道吗更新解决方案:
JSON文件:
部分Python代码:
使用C++标准模板库的STD::vector容器,然后使用STD::Debug。然后你可以编写一个Python模块,调用C++。你知道吗
相关问题 更多 >
编程相关推荐