将 VBA(Visual Basic for Applications)生成的 p 代码转换回 VBA

逆向工程 拆卸 反汇编者 反编译 视觉基础 vba
2021-06-12 04:50:25

根据https://github.com/bontchev/pcodedmp 中的自述文件

“当每个 VBA 行被输入到 VBA 编辑器中时,它会立即被编译成 p 代码”

“在VBA编辑器中打开宏模块的源码,显示的不是解压后的源码,而是反编译成源码的p码”

这意味着 p 代码和生成它的 VBA 源代码之间存在逐行对应关系。

有没有一种工具可以获取转储的 p 代码并获取生成它的 VBA 源代码?

例如,输入将类似于

Line #0:
    FuncDefn (Private Sub Document_Open())
Line #1:
    LitStr 0x001D "This could have been a virus!"
    Ld vbOKOnly
    Ld vbInformation
    Add
    LitStr 0x0006 "Virus!"
    ArgsCall MsgBox 0x0003
Line #2:
    LitStr 0x0008 "calc.exe"
    Paren
    ArgsCall Shell 0x0001
Line #3:
    EndSub

和输出

Private Sub Document_Open()
    MsgBox "This could have been a virus!", vbOKOnly + vbInformation, "Virus!"
    Shell("calc.exe")
End Sub
0个回答
没有发现任何回复~