Still more doc

This commit is contained in:
hakril
2016-01-07 23:51:17 +01:00
parent a4e61c74e5
commit 32fe601b1f
3 changed files with 24 additions and 9 deletions
+7 -3
View File
@@ -1,9 +1,9 @@
# PythonForWindows
PythonForWindows is a base of code aimed to make interaction with `Windows` (on X86/X64) easier (with both 32 and 64 bits Python).
PythonForWindows is a base of code aimed to make interaction with `Windows` (on X86/X64) easier (for both 32 and 64 bits Python).
Its goal is to offer abstractions around some of the OS features in a (I hope) pythonic way.
It also tries to make the barrier between python and native execution thiner in both ways.
There is no external dependencies but it relies heavily on the `ctypes` modules.
It also tries to make the barrier between python and native execution thinner in both ways.
There is no external dependencies but it relies heavily on the `ctypes` module.
Some of this code is clean (IMHO) and some parts are just a wreck that works for now.
@@ -11,6 +11,8 @@ Let's say that the codebase evolves with my needs and my curiosity.
You can find some examples of code in the `samples/` directory.
Parts of PythonForWindows are used in the [LKD project][LKD_GITHUB].
## Overview
### Processes / Threads
@@ -55,3 +57,5 @@ Some code are just exploration and need improvement like:
- Exception
- COM
[LKD_GITHUB]: https://github.com/sogeti-esec-lab/LKD/
+14 -5
View File
@@ -1,12 +1,21 @@
COM - Component Object Model
""""""""""""""""""""""""""""
A module to call ``COM`` interfaces from `Python` or
``COM`` vtable in python.
A module to call `COM` interfaces from `Python` or
`COM` vtable in python.
This code is only used in :mod:`windows.wmi`.
The ability to create ``COM`` vtable is used in LKD
The ability to create `COM` vtable is used in the `LKD project <https://github.com/sogeti-esec-lab/LKD/>`_ .
.. note::
TODO: link to LKD code
To call a `COM` interface you need to:
1. Describe the `COM` interface `CODE1 <https://github.com/sogeti-esec-lab/LKD/blob/ba40727d7d257b00f89fc6ca7296c9833b7b75b2/dbginterface/remote.py#L56>`_
2. Use an instance (which is a PVOID) to get the interface `CODE2 <https://github.com/sogeti-esec-lab/LKD/blob/ba40727d7d257b00f89fc6ca7296c9833b7b75b2/dbginterface/remote.py#L313>`_
3. Use the object ! `CODE3 <https://github.com/sogeti-esec-lab/LKD/blob/ba40727d7d257b00f89fc6ca7296c9833b7b75b2/dbginterface/remote.py#L366>`_
To create `COM` object you need to:
1. Describe your ComVtable `CODE4 <https://github.com/sogeti-esec-lab/LKD/blob/ba40727d7d257b00f89fc6ca7296c9833b7b75b2/simple_com.py#L89>`_
2. Implement the python functions described `CODE5 <https://github.com/sogeti-esec-lab/LKD/blob/ba40727d7d257b00f89fc6ca7296c9833b7b75b2/dbginterface/remote.py#L233>`_
3. Create an instance and pass it to whatever native function expects it `CODE6 <https://github.com/sogeti-esec-lab/LKD/blob/ba40727d7d257b00f89fc6ca7296c9833b7b75b2/dbginterface/remote.py#L438>`_
+3 -1
View File
@@ -68,7 +68,8 @@ To be able to perform those operation we must be able to execute code in the ``6
.. note::
TODO link to ``Heaven Gate``
See `Knockin on Heavens Gate Dynamic Processor Mode Switching <heaven_gate>`_
For that we need to jump to the 64bits segment of our process, execute some code then return.
To do so, we need to use some ``far jump`` / ``far ret`` with the segments selector ``0x23`` (CS_32bits) and ``0x33`` (CS_64bits).
@@ -120,3 +121,4 @@ Existing function are:
.. function:: NtGetContextThread_32_to_64
.. _heaven_gate: http://rce.co/knockin-on-heavens-gate-dynamic-processor-mode-switching/