qModuleBase
= QString::fromUtf8(ModuleBase
);
qModuleBase = QString::fromUtf8(ModuleBase);
To copy to clipboard, switch view to plain text mode
returns a compiler error:
calculatorform.cpp:75: error: invalid conversion from `unsigned char*' to `const char*'
calculatorform.cpp:75: error: initializing argument 1 of `static QString QString::fromUtf8(const char*, int)'
mingw32-make[1]: *** [tmp\obj\release_shared\calculatorform.o] Error 1
mingw32-make[1]: Leaving directory `C:/Qt/4.2.3/Kdevelop/navui'
mingw32-make: *** [release] Error 2
so I tried:
qModuleBase
= QString::fromUtf8((char*)ModuleBase
);
qModuleBase = QString::fromUtf8((char*)ModuleBase);
To copy to clipboard, switch view to plain text mode
which compiles fine, but the program crashes.
MSDN shows MODULEENTRY32 as this:
typedef struct tagMODULEENTRY32 {
DWORD dwSize;
DWORD th32ModuleID;
DWORD th32ProcessID;
DWORD GlblcntUsage;
DWORD ProccntUsage;
BYTE* modBaseAddr;
DWORD modBaseSize;
HMODULE hModule;
TCHAR szModule[MAX_MODULE_NAME32 + 1];
TCHAR szExePath[MAX_PATH];
} MODULEENTRY32,
*PMODULEENTRY32;
typedef struct tagMODULEENTRY32 {
DWORD dwSize;
DWORD th32ModuleID;
DWORD th32ProcessID;
DWORD GlblcntUsage;
DWORD ProccntUsage;
BYTE* modBaseAddr;
DWORD modBaseSize;
HMODULE hModule;
TCHAR szModule[MAX_MODULE_NAME32 + 1];
TCHAR szExePath[MAX_PATH];
} MODULEENTRY32,
*PMODULEENTRY32;
To copy to clipboard, switch view to plain text mode
heres something interesting as well:
cout << hex << (PVOID)ModuleBase << endl;
cout << hex << (PVOID)ModuleBase << endl;
To copy to clipboard, switch view to plain text mode
This works to echo the value to the command line.
Bookmarks