prosess memory.?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Register456
    New Member
    • Feb 2008
    • 4

    prosess memory.?

    the above stack works but it does not reads anything.
    i trying to read memory char by char.
    but it wants it void.and do not show anything.

    [CODE=c]int n=10;
    int M1;
    unsigned char M2;
    DWORD *N;
    int state;
    while(n--){
    unsigned char M2[1];
    void *E=(void *) n;
    state=ReadProce ssMemory(A,E,M2 , 1, N);

    printf("\n%h:", M2);

    }[/CODE]
    Last edited by Ganon11; Feb 12 '08, 02:37 PM. Reason: Please use the [CODE] tags provided.
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    First, what is A ??
    Second, ReadProcessMemo ry returns a BOOL and not an int.
    Third, you do not check the return value from ReadProcessMemo ry. If it's calse, you need to call GetLastError() to see what happened.
    Fourth, the second argument is a void* because the function wants it that way.
    Fifth, the third argument is a void* and not an int.
    Sixth, the last argument is a pointer to a variable that receives the number of bytes transferred. You are supplying an uninitialized pointer.

    So considering this code won't even compile without warnings, I 'm not surprised that it's not working.

    Comment

    Working...