cough-0.2.1
توضیحات
Write COFF object files
| ویژگی | مقدار |
|---|---|
| سیستم عامل | Microsoft :: Windows |
| نام فایل | cough-0.2.1 |
| نام | cough |
| نسخه کتابخانه | 0.2.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | David D. Dorfman |
| ایمیل نویسنده | d3dave@users.noreply.github.com |
| آدرس صفحه اصلی | https://github.com/d3dave/cough |
| آدرس اینترنتی | https://pypi.org/project/cough/ |
| مجوز | MIT |
cough
=====
A library for building COFF object files.
Tutorial
--------
Start with the ObjectModule class::
module = ObjectModule()
Now, let's create a '.text' section::
section = Section(b'.text', SectionFlags.MEM_EXECUTE)
Add a bit of code::
section.data = b'\x29\xC0\xC3' # return 0
section.size_of_raw_data = len(section.data)
Good enough, let's add it to our module::
module.sections.append(section)
To make use of that bit of code, we are going to need an exported symbol::
main = SymbolRecord(b'main', section_number=1, storage_class=StorageClass.EXTERNAL)
Set the value to the offset in the section::
main.value = 0
And add it to our module::
module.symbols.append(main)
That's enough, let's write our module to a file::
with open('test.obj', 'wb') as obj_file:
obj_file.write(module.get_buffer())
نحوه نصب
نصب پکیج whl cough-0.2.1:
pip install cough-0.2.1.whl
نصب پکیج tar.gz cough-0.2.1:
pip install cough-0.2.1.tar.gz