Skip to content

Commit

Permalink
Merge pull request #58 from hakril/improv_simple_assembly
Browse files Browse the repository at this point in the history
Improve handling of some instructions in simple x86/x64
  • Loading branch information
hakril authored Jun 27, 2024
2 parents 7475c88 + cbadada commit 13d0b6b
Show file tree
Hide file tree
Showing 17 changed files with 3,409 additions and 8 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/mypytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@ jobs:
with:
python-version: ${{ matrix.python-version}}
architecture: x86
update-environment: false
## Install the 64bits version of python3 asked
- name: Set up Python3 ${{ matrix.python-version }} x64
if: ${{ matrix.python-version != '2.7' }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version}}
architecture: x64
update-environment: false

# Manually install python2.7 (both version at once)
- name: Set up Python2.7 ${{ matrix.python-version }} x86 & x64
Expand All @@ -64,7 +66,7 @@ jobs:
run: py -${{ matrix.python-version}}-${{ matrix.python-bitness-to-test}} -m pytest --junitxml=junit/test-results.xml -s -k "not known_to_fail" -v tests/

- name: Publish PyTest Results
uses: EnricoMi/publish-unit-test-result-action/composite@v1
uses: EnricoMi/publish-unit-test-result-action/windows@v2
if: always()
with:
files: junit/test-results.xml
Expand Down
1 change: 1 addition & 0 deletions ctypes_generation/definitions/defines/section.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#define MEM_EXTENDED_PARAMETER_TYPE_BITS 8
25 changes: 25 additions & 0 deletions ctypes_generation/definitions/functions/syscall.txt
Original file line number Diff line number Diff line change
Expand Up @@ -367,3 +367,28 @@ NTSTATUS NtTerminateProcess(
HANDLE ProcessHandle,
NTSTATUS ExitStatus
);


NTSTATUS NtReadFile(
_In_ HANDLE FileHandle,
_In_opt_ HANDLE Event,
_In_opt_ PIO_APC_ROUTINE ApcRoutine,
_In_opt_ PVOID ApcContext,
_Out_ PIO_STATUS_BLOCK IoStatusBlock,
_Out_ PVOID Buffer,
_In_ ULONG Length,
_In_opt_ PLARGE_INTEGER ByteOffset,
_In_opt_ PULONG Key
);

NTSTATUS NtWriteFile(
[in] HANDLE FileHandle,
[in, optional] HANDLE Event,
[in, optional] PIO_APC_ROUTINE ApcRoutine,
[in, optional] PVOID ApcContext,
[out] PIO_STATUS_BLOCK IoStatusBlock,
[in] PVOID Buffer,
[in] ULONG Length,
[in, optional] PLARGE_INTEGER ByteOffset,
[in, optional] PULONG Key
);
32 changes: 32 additions & 0 deletions ctypes_generation/definitions/structures/section.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
typedef enum MEM_EXTENDED_PARAMETER_TYPE {
MemExtendedParameterInvalidType = 0,
MemExtendedParameterAddressRequirements = 1,
MemExtendedParameterNumaNode = 2,
MemExtendedParameterPartitionHandle = 3,
MemExtendedParameterUserPhysicalHandle = 4,
MemExtendedParameterAttributeFlags = 5,
MemExtendedParameterImageMachine = 6,
MemExtendedParameterMax
} *PMEM_EXTENDED_PARAMETER_TYPE;


typedef struct _MEM_ADDRESS_REQUIREMENTS {
PVOID LowestStartingAddress;
PVOID HighestEndingAddress;
SIZE_T Alignment;
} MEM_ADDRESS_REQUIREMENTS, *PMEM_ADDRESS_REQUIREMENTS;


typedef struct MEM_EXTENDED_PARAMETER {
struct {
ULONG64 Type : 8; // MEM_EXTENDED_PARAMETER_TYPE_BITS -> define not handled in parser here
ULONG64 Reserved : 56; // 64 - MEM_EXTENDED_PARAMETER_TYPE_BITS -> define not handled in parser here
} DUMMYSTRUCTNAME;
union {
ULONG64 ULong64;
PVOID Pointer;
SIZE_T Size;
HANDLE Handle;
ULONG ULong;
} DUMMYUNIONNAME;
} MEM_EXTENDED_PARAMETER, *PMEM_EXTENDED_PARAMETER;
Loading

0 comments on commit 13d0b6b

Please sign in to comment.