Created
September 12, 2016 05:27
-
-
Save kmdnet/8be48f6171ca33c368ff8c90d126ef60 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<Windows.h> | |
#include<winternl.h> | |
#include<stdio.h> | |
void GetKernel32BaseAddress() { | |
PPEB pPeb; // PEB | |
PLDR_DATA_TABLE_ENTRY pLdrDataTableEntry; | |
PLIST_ENTRY pListEntry; | |
pPeb = (PPEB)__readfsdword(0x30); | |
pLdrDataTableEntry = (PLDR_DATA_TABLE_ENTRY)pPeb->Ldr->InMemoryOrderModuleList.Flink; | |
pListEntry = pPeb->Ldr->InMemoryOrderModuleList.Flink; | |
pListEntry = pListEntry->Flink; | |
pListEntry = pListEntry->Flink; | |
pLdrDataTableEntry = (PLDR_DATA_TABLE_ENTRY)(pListEntry->Flink); | |
printf("Kernel32.dll : 0x%p\n", pLdrDataTableEntry->Reserved2[0]); | |
} | |
int main(void) { | |
GetKernel32BaseAddress(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment