E
E
evgenyt20002020-05-12 11:43:26
C++ / C#
evgenyt2000, 2020-05-12 11:43:26

How to show LPVOID content?

Good afternoon!
It seems like after the reservation it should be initialized with zeros. The address itself is not a problem to show, but how to show the contents?

LPVOID lpVirtualAddress;
lpVirtualAddress = VirtualAlloc(NULL,pageSize,MEM_COMMIT,PAGE_READWRITE);
cout << "Virtual memory address: " << lpVirtualAddress<< endl;


Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
1
15432, 2020-05-12
@evgenyt2000

let us suppose

for(int i = 0; i < 0x100; i += 1)
    std::cout << std::hex << ((unsigned char*)lpVirtualAddress)[i] << ' ';

in a prettier way - see here
https://stackoverflow.com/questions/479373/c-cout-...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question