9 Commits

Author SHA1 Message Date
Wesley Shields
b4ad87819e Support section, symbols and characteristics.
While here, make it easier to extend by providing macros to eliminate
the mundane that goes into writing getset members.
2013-11-29 21:56:12 -05:00
Wesley Shields
912a892e47 Switch from using members to getseters.
This means I don't have to store anything in the pepy_parsed object (PyObject
pointers or native C types). Use a macro to get things out of the parsed
structures and into python objects.
2013-11-29 19:04:45 -05:00
Wesley Shields
3c7d1c1052 Turns out I like using native types.
Switch back to using native types. This is less memory for me to manage.
2013-11-29 16:29:45 -05:00
Wesley Shields
53fb7e7d2c Fix crash, convert back to PyObject pointers.
There was some weird memory corruption caused by how pepy_parsed_init()
was parsing arguments. The result was that accessing attributes or methods
which didn't exist would periodically cause segfaults. This code was leftover
from an earlier way of doing things and doesn't need to be done this way.
Just parse straight to a C style string instead of this crap.

Also implement support for signature, machine support.

Also, add Py_TPFLAGS_BASETYPE as you should.
2013-11-29 16:20:44 -05:00
Wesley Shields
860fbff4e4 Don't store parsed values in python objects.
Convert the PyObject pointers used inside pepy_parsed into their corresponding
native types and use those. Teach the members array to return them accordingly.

While here might as well add support for signature and machine values.

Also, convert test.py to have shorter output by not using pprint.
2013-11-29 14:28:39 -05:00
Wesley Shields
ed77443f31 Implement timedatestamp member.
While here, DECREF the string used in init. Also, make a note that I really
want to use a bytearray instead of a list for get_bytes().
2013-11-29 14:11:01 -05:00
Wesley Shields
6d8a39ad72 Add a bunch of constants.
These are useful for checking values I'll be adding support for later.

import pepy
print hex(pepy.MZ_MAGIC)
2013-11-27 16:17:22 -05:00
Wesley Shields
20869810cf Silence warnings in pepy.cpp. 2013-11-27 16:16:55 -05:00
Wesley Shields
a928a15b8b Initial commit of pepy (pronounced p-pie).
This is a set of python bindings to pe-parse. It is nowhere near feature
complete yet but I'll keep working on it.
2013-11-27 15:52:24 -05:00