Alternative Ways to Get Process Heap

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

H2
H3
H4
3 columns
2 columns
1 column
1 Comment
Ecency