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

Pr python3 #35

Merged
merged 22 commits into from Jul 21, 2017
Merged

Pr python3 #35

merged 22 commits into from Jul 21, 2017

Conversation

lucasg
Copy link
Contributor

@lucasg lucasg commented Jul 17, 2017

Hi,

I've ported your library over Python3 (believe it or not, people still preferentially use pdbparse when working with PDB). Sorry for the massive code changes, but it's not possible to do it incrementally.

I've tested it on:

  • Linux with python 2.7.6 and 3.4.3
  • Windows with python 2.7.6 and 3.5.2

There is probably still some kinks to iron out, even though I tried to be thorough (I even had to do some software archeology to get my hands on a pre-WinXP dll and pdb) :

coverage

(I've ignored undecorate.py, undname.py and postfix_eval.py which not actually used by the library)

Anyway, I'm at your disposal if you have any questions or suggestions about this PR.

L.

lucasg added 22 commits July 17, 2017 17:58
xrange is deprecated in Python3. builtins.range is the correct
compatilibity layer for range functionality
As usual, some bytes/str incompatibilities.
Doing so allow us to import example scripts as modules.
That was done for PDB7RootStream but not for PDB2 (which is understandable
since that PDB format is deprecated for 20 years)
PadAlign rely on ctx._pad. However this attribute may not be defined since
_pad is a construct.Peek(Something) and Peek return None if the sub
construct raise an Error (end of stream for example).

It may be better to use an Adapter instead
…vinfo.h

Microsoft is nice enough to finally provide documentation for pdb, we
might as well use it.
Same as for basic types, leaf types enum is now public.
@moyix
Copy link
Owner

moyix commented Jul 18, 2017

Wow, this is awesome! Thanks so much for putting this together! I'm going to run this by the Volatility folks since I believe pdbparse is still in their critical path, but it should be OK to merge after they verify it doesn't break their workflow :)

@lucasg
Copy link
Contributor Author

lucasg commented Jul 20, 2017

I just realized my PR fixes those issues :

@moyix
Copy link
Owner

moyix commented Jul 21, 2017

I haven't heard back definitively from the Volatility folks, but they tell me that they will be switching to an LLVM-based parser from version 3, so I don't see any harm in merging this now. Thanks again for the PR!

@moyix moyix merged commit cc38267 into moyix:master Jul 21, 2017
@lucasg
Copy link
Contributor Author

lucasg commented Jul 21, 2017

Whoops I've just noticed I haven't upstreamed the modifications on the undame C module for the support of Python3 compilation. I'll create another pull request right away.

@lucasg lucasg deleted the PR_Python3 branch July 21, 2017 18:29
@@ -1099,16 +1100,16 @@ def enum_pretty_str(enum):
structs = topological_sort(dep_graph)
structs.reverse()

print "/******* Enumerations *******/"
print ("/******* Enumerations *******/")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There shouldn't be a space between print and (.

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

Successfully merging this pull request may close these issues.

None yet

3 participants