helper function for no_op
Closed this issue · 3 comments
- have a helper function that takes in number of bytes and takes in value to dynamically return our own no_op
- at the moment the nop_test function has Nop[ ] manually inserted to WriteProcessMemory
- would like to have a helper that dynamically creates our nops according to the bytes we input
/*
* n is the bytes of our address. in this case it was 4;
* Nop is NOP we have defined in our camera_hack.h file
* i believe this should work
*/
int no_op(int n, BYTES Nop)
{
//should return [n of Nop];
// the output should be nop = { x90, x90, x90, x90 }
}
You basically should use array at this point, in C it would be something like this, with C++ you better use the New method
char array*;
memset(array, 0x90, sizeof(char) * n);
return array
Something along the lines of
int array[n] = { 0x90 };
could work
You basically should use array at this point, in C it would be something like this, with C++ you better use the New method
char array*; memset(array, 0x90, sizeof(char) * n); return arraySomething along the lines of
ooohhhh, this is the right way of using memset. nice!
C++ prefers you use new keyword instead, I actually think you can get away with
int array[n] = { 0x90 };
return array[]
Although apparently depending on the compiler it might not allow this without a new keyword, since the size of N is unknown at a compile time, arrays made with new do no have fill in function like one above, but you can fill it up with a loop within your interface function for cooking arrays of nops