Category : memory

How would I get the base address of a specific dll loaded by a program? PsGetProcessSectionBaseAddress does not work for my situation and I’m not able to use an Image load notifier as I’m working with an uefi driver. C++ Usermode implementation: DWORD GetModuleBase(DWORD processId) { wchar_t szModuleName[] = { ‘c’,’l’,’i’,’e’,’n’,’t’,’.’,’d’,’l’,’l’, 0 }; DWORD moduleBase ..

Read more

I wrote this code: try { char* buffer = (char*)malloc(sizeof(char)); int* bytes = new(buffer) int(); *bytes = 10; std::cout<<*bytes; free(buffer); } catch(const std::exception& e) { std::cerr << e.what() << ‘n’; } I think this code have a danger when I call operator new, because the buffer variable has less memory then the bytes variable requires. ..

Read more