Change a hardcoded value to user input

In my memory scanner program which is a win32 Console Application the value for the initial offset to start scanning is hard-coded what i would like is to make it a user input value instead.

unsigned long initialoffset = 0x01300000;
Last edited on
Can you make use of arguments to main with argc & argv ?
I should be able to since the main is already using argc & argv i've just never messed with them myself so any help would be appreciated. Going to start doing some reasearch also.

int main(int argc, char **argv)
Here is a link to K&R book on C programming:

http://zanasi.chem.unisa.it/download/C.pdf


It is a quite good reference I think, even though it is really old.

Here is link to a post by Duoas
on this site.
http://www.cplusplus.com/forum/beginner/5404/#msg23839


HTH
1
2
unsigned long initialoffset;
cin >> initialoffset;
Aww Gee - I was hoping the OP had heard of cin !!!! :=D
I have and even tried it but not sure where i was messing up later in the code i ended up doing the following and it worked fine and thanks for the help. :)
The main reason i wanted to do it this way was to keep from recompiling every single time since the address changes on each restart. My end game is to implement a findpattern function to get the inital offset which is above my pay grade currently and most documentation i find is using it via injecting a dll into the process and not a external like the collector is i'm using.


1
2
	cout << "enter initileoffset / maxoffset:\n";
	cin >> hex >> initialoffset >> hex >> maxoffset;
Last edited on
Topic archived. No new replies allowed.