   Memory address string to pointer
  I'm trying to make a program that takes a memory address you type into a console, and return the byte value stored at that memory address. I'm not quite sure how I can do this. Lets say I type in "0x4E8" into the console and press enter. I store that string in a variable, but how do I get a pointer to that memory address?   
  Most modern OS won't let you access memory outside of the your application virtual space(so other application can't inadvertently overwrite/modify you application running on the same system). You can't just point to any memory address you feel like, since you probably be accessing something you should. Well reading from the memory should really do anything (if the OS allows it) but writing may cause unpredictable result. The address would me mapped to your process address space so I don't really see how to do it. If somehow you could get the base address of memory for the system you are running on (call it 0x00000000...) then you wouldn't have to store the input as a string. It would be an integer type and all you would have to do is add that amount to the base address and dereference it to get the value at that memory location.   ;  1. Are you aware that most addresses will be invalid and will cause an access violation when you try to access them?2. What language / OS?   ;  Accessing random addresses typed in by the user is undefined behavior at best.  Is there a reason you need to do this?  The solution is to convert the string into an integer using an std::stringstream or boost::lexical_cast, and then convert the integer into a pointer (you may even be able to convert the string directly into a pointer, however I've never done such a thing before).  But really no good can come from this.   ;  @Evil Steve1) Yes.2) Windows Vista Home Premium 32 bit.   ;  @ZipsterI'm just experimenting. There's really no need for it, but I was just wondering how I could do it, if it is possible.   ;  There might be a way using the kernel mode functions in the Windows Driver Kit (WDK). You'll have to write a stub driver for this.   ;  You just need to parse the string into a number, and then cast that number into a pointer.However, as others have said - that'll just let you access memory in your own process (And will give an access violation on almost all addresses unless you have a lot of DLLs loaded and/or have a lot of memory allocated).If you want to read another processes memory, use ReadProcessMemory (Assuming C++ / Win32).   ;  If you really want, allocate a large block of heap memory (malloc or new), and then print the address (or range) to the console, that way you will know what is valid.Even better, if you wish to retain the 0x0000 start point, simply add your heap block's base address to whatever pointer you put in, so 0x0000 will point to the beginning of that heap.To convert a string to a pointer... atoi or sscanf.   ;  The ring-0 implementation of ReadProcessMemory() (which you can use even on your own process) simply copies memory by page boundaries until an access violation occurs, which it catches via an exception handler.You can either use ReadProcessMemory() on your own process or make your own faster routine which does not have so much set-up but works the same way.// _dwRet = Parameter passed by reference.  Function returns true if the value was successfully filled.// _pcvAddress = Paramater passed.  The address to read.try {   _dwRet = (*reinterpret_cast<DWORD *>(_pcvAddress));}catch ( ... ) {   return false;}return true;L. Spiro   