Alternative Ways to Get Process Heap

Words
35
Reading
1 min
Listen
Play
5y

DTube Video Link

#include 
#include 

inline PPEB NtCurrentPeb() { return NtCurrentTeb()->ProcessEnvironmentBlock; }

int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine, int nCmdShow)
{
    //Method 1
    HANDLE procHeap1 = GetProcessHeap();

    // Method 2
    PVOID procParamAddr = &(NtCurrentPeb()->ProcessParameters);
    HANDLE procHeap2= *(PVOID*)((PUCHAR)procParamAddr + sizeof(PVOID) * 2); 

    return 0; 
}

Please Vote this post if you like it.
Please Follow me if you like my posts.
If you have any questions about this post, ask in comments.
Follow me on :
DTube

Alternative Ways to Get Process Heap | Ecency