So I'm not very good with C++ yet as I am still learning the basics but I thought I would try to read process memory. For some reason I keep getting the following error messages:
Error 1 error LNK2019: unresolved external symbol "unsigned long __cdecl FindProcessId(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &)" (?FindProcessId@@YAKABV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@Z) referenced in function _main C:\Users\ThisGuy\Documents\Visual Studio 2013\Projects\ExploitConsole\ExploitConsole\ExploitConsole.obj ExploitConsole
Well all of this is very confusing. I mean I know I definitely should not be attempting this at such an early stage but it's necessary for my end goal :D. I almost need an eli5 for your explanation. I'm just a dummy :D
This is the function definition for ReadProcessMemory.
SIZE_T *lpNumberOfBytesRead
lpNumberOfBytesRead [out]
A pointer to a variable that receives the number of bytes transferred into the specified buffer. If lpNumberOfBytesRead is NULL, the parameter is ignored.
If you don't care about how many bytes are read, just pass in a nullptr, because we're using C++, while the Windows API was coded in C, so they don't have nullptr. Instead they have NULL, which is defined as 0; essentially a nullptr.
You passed in false, which is a bool. Coincidentally, when you cast false to an int, it turns out to be 0. But passing falseobscures the logic of your code.
Thank you so much :D. I'm truly sorry if this was frustrating for you to write out for me to understand. I really appreciate it. Have a great evening. P.S Your explanation makes a lot of sense :D