I'm trying to dump a file that is stored at a place in memory with 41mb's in file size.
Any idea's how to dump a file that is stored in memory at a place in contiguous memory?
Would love to hear your opinions much appreciated.
I edited my code above.
And yes I used a hex editor to get the bytes.
Also, The bytes I gave was incorrect I fixed what I use now above.
I converted the bytes to decimal and then took the decimal value and converted it to MB'S and got the correct 41 mb's in total size at that place in memory.
So, again what can I be doing wrong?
@salem c I'm sorry for any frustration I appreciate you all taking the time to help me means a lot.
I just hope someone can guide me here to what I need to do.
You seem to want to obtain memory dump relating to the process 'gametutorial'? The given memory address relates to the current running process, not another. So you are trying to dump memory for the program dumping the memory! On Windows, to get access to the memory space of another process you have to use ReadProcessMemory() See https://docs.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-readprocessmemory Also note that you will need to acquire special privileges to do this as you need PROCESS_VM_READ privilege.
And Yes I am trying to obtain a memory dump relating to the process "gametutorial".
Okay can someone give me a code example would appreciate it very much. At least there is something I can work with to understand what you all are saying better. @seeplus
But your ReadProcessMemory_() doesn't call Windows ReadProcessMemory() - it just returns 0 ?? It needs to call ReadProcessMemory() and check that the return value is non zero. If it's zero then an error has occurred and the function has failed.
I know ReadProcessMemory_() does not call windows it is because I created the function that is part of the header file.
I wanted to create it to add another parameter to the function
Which is: CHAR* lpfile.
which handles the Wfilename, and Rfilename.
So my code compiles successfully and reads and opens and writes the cartfile in my folder.
but the total size is still 0kb file size.
I might be going about this all wrong.
I know the basics I'm not stupid I'm not a troll either.
I'm asking a question if you do not got the answer then why comment that crap.
readprocessmemory()
copies the data in the specified address range from the address space of the specified process into the specified buffer of the current process.
So my question still stands seems every time I try to ask on these sites I get this comment pointless nobody can clarify most don't even give a good answer because they cant.
So here I am again figuring it out myself.
question closed!!
I commented because there is no relationship between ReadProcessMemory_
and the kernel32.dll function which you must use ReadProcessMemory.
@seeplus reminded you of this -- you could have overlooked it: it happens. But your reaction indicates that the explanation isn't enough to diagnose the problem. Based on this and the fairly complicated topic, I thought you were a troll.