Skip to content

Instantly share code, notes, and snippets.

@JamesTheHacker
Last active January 3, 2019 15:51

Revisions

  1. JamesTheHacker revised this gist Jan 3, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion step2.c
    Original file line number Diff line number Diff line change
    @@ -11,7 +11,7 @@ int main(int argc, char** argv)
    */
    HANDLE pHandle = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, pid);
    if (pHandle == NULL) {
    printf("Could not find process with pid: %i", pid);
    printf("Could not find process with pid: %i with error: %i", pid, GetLastError());
    return -1;
    }

  2. JamesTheHacker revised this gist Jan 3, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion step2.c
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@ int main(int argc, char** argv)
    int pid = 10964;
    DWORD_PTR addr = 0x7FF7BD730000;

    /*
    /*
    * Get a handle for process with specific process id
    */
    HANDLE pHandle = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, pid);
  3. JamesTheHacker created this gist Jan 3, 2019.
    20 changes: 20 additions & 0 deletions step2.c
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    #include <stdio.h>
    #include <Windows.h>

    int main(int argc, char** argv)
    {
    int pid = 10964;
    DWORD_PTR addr = 0x7FF7BD730000;

    /*
    * Get a handle for process with specific process id
    */
    HANDLE pHandle = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, pid);
    if (pHandle == NULL) {
    printf("Could not find process with pid: %i", pid);
    return -1;
    }

    return 0;
    }