我不知道如何将a转换 std::wstring
为aWCHAR*
std::wstring wstrProcToSearch;
WCHAR * wpProcToSearch = NULL;
std::wcin >> wstrProcToSearch; // input std::wstring
// now i need to convert the wstring to a WCHAR*
Run Code Online (Sandbox Code Playgroud)
有谁知道如何做到这一点?
您好,我正在尝试在 mac os 上的 lldb 中查找字符串的地址。
在 GDB 中,我会使用find
带有地址的命令进行搜索。但是我找不到 lldb 这样的命令,我知道该字符串在 cstring 部分中,在我的情况下是0x00000000002e4f08-0x000000000032e0a8
. 但我需要确切地知道在哪里。
我试图使用memcpy,但它给了我一个
运行时错误:分段错误(核心转储)
和编译器警告:警告:从不同大小的整数强制转换为指针[-Wint-to-pointer-cast]
这是代码
unsigned char JMP[6] = {0xE9, 0x90, 0x90, 0x90, 0x90, 0xC3};
unsigned long JMPSize = ...;
//copy jump size to jump instruction at second byte (this is where i get the error)
memcpy((uint8_t*)JMP[1],(void*)JMPSize, 4);
Run Code Online (Sandbox Code Playgroud)