Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Restarting the process

Restarting the process

Scheduled Pinned Locked Moved C / C++ / MFC
performancehelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mpapeo
    wrote on last edited by
    #1

    I want to restart the process using the information of the previoulsy suspended process i.e. baseAddr,region,state, allocationbase, e.t.c but now i am stuck. It does not start even though i provided info from the file where it has to read from. my restart function is below here. What am i missing... case 6://restarting the process using information from the file lpBaseAddress = 0; hProcess = mbi.BaseAddress; SetThreadContext( hThread, lpContext ); /* OpenThread( dwDesiredAccess, // handle to thread bInheritHandle, // access to process dwThreadId, GetLastError() // pointer to handle to open access token );*/ if (OpenProcess(dwDesiredAccess, bInheritHandle,dwThreadId, GetlastError()) == NULL) printf("Unable to open thread\n"); SuspendThread(pi.hThread);// identifies thread to suspend fp = fopen("info.bin","r"); if( fp ) nSize = 10000; //numbers of bytes in the file lpBuffer = 0; //pointer to the file where data is to be read WriteProcessMemory( dwDesiredAccess, // handle to process whose memory is written to lpBaseAddress, // address to start writing to lpBuffer, // pointer to buffer to write data to nSize, // number of bytes to write lpNumberOfBytesWritten // actual number of bytes written ); printf("Numbers of bytes writen: ",lpNumberOfBytesWritten); ResumeThread(dwDesiredAccess);// identifies thread to restart GetLastError(); break; oam

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups