当前位置: 首页>>代码示例>>C++>>正文


C++ MemoryArea::write方法代码示例

本文整理汇总了C++中MemoryArea::write方法的典型用法代码示例。如果您正苦于以下问题:C++ MemoryArea::write方法的具体用法?C++ MemoryArea::write怎么用?C++ MemoryArea::write使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MemoryArea的用法示例。


在下文中一共展示了MemoryArea::write方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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());
}
开发者ID:hulucc,项目名称:injectory,代码行数:13,代码来源:dllmain_remotecall.cpp

示例2: tmp

bool MemoryManagerV3::uploadFunclet(FuncletCode::Type type)
{
	const FuncletCode& funclet = parent->getFunclet(type);
	const uint8_t* code = (uint8_t*)funclet.code();
	const size_t count = funclet.codeSize();

	vector<uint32_t> tmp(code, code + count); // copy funclet into vector
	MemoryArea* ram = this->getMemoryArea("system", 0);

	return ram && ram->write(0, &tmp[0], count) && ram->sync();
}
开发者ID:AlessonDavid,项目名称:libMSP430,代码行数:11,代码来源:MemoryManagerV3.cpp

示例3: 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);
}
开发者ID:guneysu-arsiv,项目名称:injectory,代码行数:15,代码来源:process.cpp


注:本文中的MemoryArea::write方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。