损坏的堆异常,创建子进程,但成功返回

 收藏

我编写的用于执行测试的代码在传输到NTDLL时会为已损坏的堆抛出异常,但它确实创建了进程并成功执行。在我了解内部消息之前,它没有这样做。所以我想知道是否有人可以指出我的代码在哪里出了问题。

该代码工作并返回True。我使用从中获得的所有操作正在返回true(读取,保护,写入,终止的自定义Syscall)

bool Tests::createChildProcess()
{
    //We can grab the full path from argv[0], and then removing the executable name.
    std::string programLoc = __argv[0];
    size_t found = programLoc.find("ourapp.exe");
    programLoc = programLoc.substr(0, found);
    programLoc.append("dummyapp.exe");
    char* address = (char*)ADDRESSSTRING;

    STARTUPINFOA si;
    PROCESS_INFORMATION pi;

    ZeroMemory(&si, sizeof(si));
    si.cb = sizeof(si);
    ZeroMemory(&pi, sizeof(pi));


    if (!CreateProcessA(programLoc.c_str(),   // No module name (use command line)
        address,        // Command line
        NULL,           // Process handle not inheritable
        NULL,           // Thread handle not inheritable
        FALSE,          // Set handle inheritance to FALSE
        0,              // No creation flags
        NULL,           // Use parent's environment block
        NULL,           // Use parent's starting directory 
        &si,            // Pointer to STARTUPINFO structure
        &pi))
    {
        return false; //Error starting process. TODO
    }
回复