flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
revolution 05 Oct 2024, 02:10
In Win32 all addresses and handles are dwords.
Code: MAX_MODULE_NAME32 = 255 MAX_PATH = 260 struc MODULEENTRY32 { .dwSize dd ? .th32ModuleID dd ? .th32ProcessID dd ? .GlblcntUsage dd ? .ProccntUsage dd ? .modBaseAddr dd ? .modBaseSize dd ? .hModule dd ? .szModule rb MAX_MODULE_NAME32+1 .szExePath rb MAX_PATH }struct MODULEENTRY32 |
|||
![]() |
|
bitRAKE 05 Oct 2024, 04:49
extra_12345 wrote: i'm coding in 64 bit, any ideas? Code: struct MODULEENTRY32 dwSize dd ? th32ModuleID dd ? th32ProcessID dd ? GlblcntUsage dd ? ProccntUsage dd ? __0 dd ? ; needed for alignment of following qword modBaseAddr dq ? modBaseSize dd ? __1 dd ? ; needed for alignment of following qword hModule dq ? szModule rb MAX_MODULE_NAME32+1 szExePath rb MAX_PATH __2 dd ? ; needed for alignment of structure ends assert sizeof MODULEENTRY32 = 568 |
|||
![]() |
|
macomics 05 Oct 2024, 04:55
Code: ; typedef struct tagMODULEENTRY32 { ; DWORD dwSize; ; DWORD th32ModuleID; ; DWORD th32ProcessID; ; DWORD GlblcntUsage; ; DWORD ProccntUsage; ; BYTE *modBaseAddr; ; DWORD modBaseSize; ; HMODULE hModule; ; char szModule[MAX_MODULE_NAME32 + 1]; ; char szExePath[MAX_PATH]; ; } MODULEENTRY32; MAX_MODULE_NAME32 = 255 MAX_PATH = 260 struc MODULEENTRY32A { .dwSize dd ? .th32ModuleID dd ? .th32ProcessID dd ? .GlblcntUsage dd ? .ProccntUsage dd ? .alignment32_0 dd ? ; zero .modBaseAddr dq ? .modBaseSize dd ? .alignment32_1 dd ? ; zero .hModule dq ? .szModule db (MAX_MODULE_NAME32 + 1) dup ? .szExePath db MAX_PATH dup ? } struc MODULEENTRY32W { .dwSize dd ? .th32ModuleID dd ? .th32ProcessID dd ? .GlblcntUsage dd ? .ProccntUsage dd ? .alignment32_0 dd ? ; zero .modBaseAddr dq ? .modBaseSize dd ? .alignment32_1 dd ? ; zero .hModule dq ? .szModule du (MAX_MODULE_NAME32 + 1) dup ? .szExePath du MAX_PATH dup ? } |
|||
![]() |
|
bitRAKE 05 Oct 2024, 05:12
In 64-bit, the MODULEENTRY32A structure size does need to be a multiple of eight.
|
|||
![]() |
|
extra_12345 07 Oct 2024, 16:36
thanks guys, this worked fine:
Code: struct MODULEENTRY32 dwSize dd ? ; 4 bytes th32ModuleID dd ? ; 4 bytes th32ProcessID dd ? ; 4 bytes GlblcntUsage dd ? ; 4 bytes ProccntUsage dd ? ; 4 bytes rd 1 ; Insert 4 bytes of padding for alignment of next 64-bit field modBaseAddr dq ? ; 8 bytes (64-bit pointer) modBaseSize dd ? ; 4 bytes rd 1 ; Insert 4 bytes of padding for alignment of next 64-bit field hModule dq ? ; 8 bytes (64-bit handle) szModule rb MAX_MODULE_NAME32 + 1 ; 256 bytes (char array) szExePath rb MAX_PATH ; 260 bytes (char array) rd 1 ends |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.