lyshark / lyscript Goto Github PK
View Code? Open in Web Editor NEWx64dbgpy automated testing plugin
x64dbgpy automated testing plugin
新版assemble_code_hex("push 0xFFFFFFFF")和旧版assemble_code_size("push 0xFFFFFFFF")返回值都是bool类型false,而不是整型数值2。如果把汇编指令改成push -1就没问题。不知道是什么原因?
调用get_all_breakpoint, 经常返回False, 我把内部的exception logging下来发现是struct.error。
这个问题也不是必定出现,多跑几次可能可能又有正常情况。
ERROR:root:unpack requires a buffer of 24 bytes
Traceback (most recent call last):
File "C:\Users\xxx\AppData\Local\Programs\Python\Python39\lib\site-packages\LyScript64\__init__.py", line 326, in get_all_breakpoint
(address,enabled,hitcount,type) = struct.unpack("< q q i i",recv_bp)
struct.error: unpack requires a buffer of 24 bytes
请问这是什么问题?
尊敬的作者您好,我在物理机上安装了您的插件,使用体验非常棒!但是在Win10虚拟机上安装插件以后却导致X64dbg无法运行,而且在一两秒之后整个系统失去响应,请问该如何解决?
LyScriptTools64/LyScriptTools64/init.py 1905行
LyScriptTools32/LyScriptTools32/init.py 1634行
return self.dbg.run_command_exec(f"InitDebug {path}")
需要改成
return self.dbg.run_command_exec(f'InitDebug "{path}"')
否则如果路径中含有空格的话,就无法正常打开。
C:\>python
Python 3.11.3 (tags/v3.11.3:f3909b8, Apr 4 2023, 23:49:59) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from x64dbg import Debugger
>>> dbg = Debugger()
>>> dbg.connect()
True
>>> dbg.get_thread_id()
29796
>>> dbg.get_thread_id()
29796
>>> dbg.is_connect()
True
>>> dbg.get_thread_id()
False
>>> dbg.is_connect()
False
>>> dbg.get_thread_id()
False
>>> dbg.connect()
True
>>> dbg.get_thread_id()
29796
>>> dbg.get_thread_id()
29796
>>> dbg.is_connect()
True
>>> dbg.get_thread_id()
False
看起来Debugger.is_connect()
会导致连接异常断开 ,但是调用connect()
又能重新连接上。
检查x64dbg库的__init__.py
后发现在Debugger
类中定义了两次is_connect()
方法,第一次在L468
,该版本与本仓库中的版本一致,无问题。但是在L6420
再次定义的版本中
def is_connect(self):
try:
send_struct = MyStruct()
send_struct.ControlId = SocketIsConnectDef
send_buffer = send_struct.pack()
self.sock.send(send_buffer)
recv_flag = self.sock.recv(18)
if recv_flag.decode("utf8") == "Connection Enabled":
return True
else:
return False
except Exception:
return False
return False
虽然也能正确返回Connection Enabled
,但却会导致连接断开。
由于python在同一个类中多次定义同样签名的方法会导致覆盖,因此只有L6420
处的方法会被实际执行。
也许应该更新一下pip源上的x64dbg包?
set_debug("StepOut") 和 script_stepout() 这两条在文档内描述的是F8普通步过,运行的时候都是执行到返回。
刚接触您的插件,不知道是本身就这样,还是x32dbg升级后产生的问题。
请问还有其它方法执行普通步过吗(按F8的效果)?
64位程序 dbg.script_runcmd_ex('rip') 返回的数据为b'rip' b'' b'' b'' b'' 0 125649873 0 0 0 5002 0 0 (将收到的数据打印出来了)
print(dbg.get_thread_list()) 可以加线程信息打印出来
换个程序 dbg.script_runcmd_ex('rip') 可以得到正确的值
这样一来除了您提供的API以外 我们还可以用内置命令获取64dbg的信息
主要想实现以下功能
在send
和 recv
下了个断点
断下来了就记录函数的参数,然后继续运行
这样可以自动化收集程序的网络发包
测试脚本:
from LyScript64 import MyDebug
if name == "main":
dbg = MyDebug(address="127.0.0.1")
connect_flag = dbg.connect()
print("isok:{}".format(connect_flag))
rax = dbg.get_register("rax")
RBX = dbg.get_register("RBX")
rip = dbg.get_register("rip")
# 检测套接字是否还在
ref = dbg.is_connect()
print("是否在连接: ", ref)
ref = dbg.is_debugger()
print(ref)
ref = dbg.is_running()
print(ref)
提示信息中isdebug以及isrunning均为false:
$ python test64.py
isok:1
是否在连接: True
False
False
测试程序目前在入口断点处
感谢!
测试发现,遍历模块导入表或者导出表时,如果其中某个模块导入表/导出表为空,返回值是false。再调用get_module_import或者export访问其它模块,返回值也会出错。后来发现在返回值false的同时,dbg.is_connect()也变成false了,需要重新再执行一次dbg.connect()后,get_module_import/export才能返回正确结果。
安装Python包:pip install LyScript32 或者 pip install LyScript64 这个包在哪呢 插件载入失败是因为它吗
作者您好,这款插件很不错,使用x64dbg调试时感觉更轻松了,有些东西也能够很轻松的实现。
希望能继续更新下去。
t = ['00 00 00 04','CC']
t.reverse()
processid = dbg.get_process_id()
for x in t:
print(dbg.find_memory_any(str(x),dbg.get_peb_address(processid)))
return False
return False
t = ['00 00 00 04','CC']
#t.reverse()
processid = dbg.get_process_id()
for x in t:
print(dbg.find_memory_any(str(x),dbg.get_peb_address(processid)))
return [973816303616, 973816307973, 973816309901, 973816316165, 973816321859, 973816324357, 973816332549]
return False
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.