Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A mysterious question, where is the pcode document? #21

Open
inshua opened this issue Jan 7, 2022 · 2 comments
Open

A mysterious question, where is the pcode document? #21

inshua opened this issue Jan 7, 2022 · 2 comments
Labels

Comments

@inshua
Copy link

inshua commented Jan 7, 2022

I've met a new pcode problem, for example:

Dim a As Word.Document

It cannot disasmed by this project. :(

Would you please tell me where the pcode come from? or all from your attempt?

@bontchev
Copy link
Owner

I've met a new pcode problem, for example:

I don't know why this happens. If you put this inside a subroutine like this

Sub Test()
    Dim a As Word.Document
End Sub

it will disassemble to

Line #0:
        FuncDefn (Sub Test())
Line #1:
        Dim
        VarDefn a (As <crash>)
Line #2:
        EndSub

In this case <crash> does not mean that the disassembler has crashed - it is one of the "internal names" used by the p-code. Take a look at function getID in pcodedmp.py.

Clearly, this is not a proper disassembly but I don't know how to process the internal structures in order to get something meaningful.

Would you please tell me where the pcode come from? or all from your attempt?

There is no public documentation describing the p-code, AFAIK. The disassembler is mostly based on my knowledge obtained by reverse-engineering Word documents containing VBA macros. Clearly, this knowledge is incomple.

@bontchev bontchev added the bug label Jan 13, 2022
@inshua
Copy link
Author

inshua commented Jan 18, 2022

There is no public documentation describing the p-code, AFAIK. The disassembler is mostly based on my knowledge obtained by reverse-engineering Word documents containing VBA macros. Clearly, this knowledge is incomple.

Wow, it's unbelievable. You can have a look if you have spare time, I've compared two samples

' sample 1
Dim a As Word.Document
' sample 2
Dim a As Word.AddIn

Their Indirect Table and Object Table are same, the difference is only some piece in Declaration Table.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants