MasterHide icon indicating copy to clipboard operation
MasterHide copied to clipboard

Dangerous assignment

Open boris768 opened this issue 5 years ago • 0 comments

https://github.com/crvvdev/MasterHide/blob/3e79de125c690663d88272dcb9855c5ec216293c/MasterHide/tools.cpp#L32 https://github.com/crvvdev/MasterHide/blob/3e79de125c690663d88272dcb9855c5ec216293c/MasterHide/tools.cpp#L66

More better:

wchar_t lpModuleName[ MAX_PATH ];
status = ZwQueryVirtualMemory( NtCurrentProcess(), PsGetProcessSectionBaseAddress( Process ), static_cast<MEMORY_INFORMATION_CLASS>(2), lpModuleName, sizeof( lpModuleName ), nullptr );
if ( NT_SUCCESS( status ) )
{
	const auto unModuleNameSize = wcslen(lpModuleName);
	if (unModuleNameSize > 0 )
	{
		AllocateUnicodeString( ProcessImageName, static_cast<USHORT>(unModuleNameSize));
		wcscpy_s( ProcessImageName->Buffer, unModuleNameSize, lpModuleName );
		bReturn = true;
	}
}

boris768 avatar Nov 01 '20 10:11 boris768