Alternative Ways to Get Process HeapsteemCreated with Sketch.

in Computer Programming3 years ago (edited)

processheap.png

Dtube Video Link

#include <Windows.h>
#include <winternl.h>

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
Hive

Coin Marketplace

STEEM 0.18
TRX 0.13
JST 0.030
BTC 58102.40
ETH 3065.94
USDT 1.00
SBD 2.26