本文整理汇总了C++中MemoryArea::address方法的典型用法代码示例。如果您正苦于以下问题:C++ MemoryArea::address方法的具体用法?C++ MemoryArea::address怎么用?C++ MemoryArea::address使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MemoryArea
的用法示例。
在下文中一共展示了MemoryArea::address方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: remoteDllMainCall
void Process::remoteDllMainCall(LPVOID lpModuleEntry, HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
struct DLLMAINCALL dllMainCall = { (DLLMAIN)lpModuleEntry, hModule, ul_reason_for_call, lpReserved };
SIZE_T DllMainWrapperSize = (SIZE_T)DllMainWrapper_end - (SIZE_T)DllMainWrapper;
MemoryArea param = alloc(sizeof(struct DLLMAINCALL));
MemoryArea dllCallWrapper = alloc((SIZE_T)((DWORD_PTR)DllMainWrapper_end - (DWORD_PTR)DllMainWrapper));
param.write((LPCVOID)&dllMainCall, sizeof(struct DLLMAINCALL));
dllCallWrapper.write((LPCVOID)DllMainWrapper, DllMainWrapperSize);
runInHiddenThread((LPTHREAD_START_ROUTINE)dllCallWrapper.address(), param.address());
}
示例2: inject
Module Process::inject(const Library& lib)
{
if (isInjected(lib))
BOOST_THROW_EXCEPTION(ex_injection() << e_text("library already in process") << e_library(lib.path()) << e_process(*this));
// copy the pathname to the remote process
SIZE_T libPathLen = (lib.path().wstring().size() + 1) * sizeof(wchar_t);
MemoryArea libFileRemote = alloc(libPathLen, true, MEM_COMMIT, PAGE_READWRITE);
libFileRemote.write((void*)(lib.path().c_str()));
PTHREAD_START_ROUTINE loadLibraryW = (PTHREAD_START_ROUTINE)Module::kernel32().getProcAddress("LoadLibraryW");
/*DWORD exitCode =*/ runInHiddenThread(loadLibraryW, libFileRemote.address());
return isInjected(lib);
}