VirtualProtect and kernel32.dll - attempt to access invalid address
问题 I'm analyzing various modules loaded by the process. Unfortunately I'm not able to create the kernel32.dll memory snapshot although the function works properly with other modules (e.g. ntddl.dll ). The problem is with the following code: /* Copy code from memory */ if (VirtualProtect((BYTE*)virtualAddress, sizeOfCode, PAGE_EXECUTE_READWRITE, &flags) == 0) { std::cout << "VirtualProtect failed!" << std::endl; std::cout << "Virtual address: " << virtualAddress << std::endl; std::cout << "Size