Add some comments

This commit is contained in:
Jason Hood 2017-10-26 12:58:17 +10:00
parent 40f59c543c
commit bff5e90eda
2 changed files with 4 additions and 3 deletions

View File

@ -24,9 +24,10 @@ static PVOID FindMem( HANDLE hProcess, PBYTE base, DWORD len )
if ((minfo.State & MEM_FREE) && minfo.RegionSize >= len)
{
#ifdef _WIN64
if ((PBYTE)minfo.BaseAddress - base > 0xFfFfFfFf - len)
if ((PBYTE)minfo.BaseAddress - base > 0xFFFFffff - len)
return NULL;
#endif
// Round up to the allocation granularity, presumed to be 64Ki.
mem = VirtualAllocEx( hProcess, (PVOID)
(((DWORD_PTR)minfo.BaseAddress + 0xFFFF) & ~0xFFFF),
len, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE );

View File

@ -63,8 +63,8 @@ int ProcessType( LPPROCESS_INFORMATION ppi, PBYTE* pBase, BOOL* gui )
&& !(nt_header.FileHeader.Characteristics & IMAGE_FILE_DLL))
{
// Don't load into ansicon.exe, it wants to do that itself.
if (nt_header.OptionalHeader.MajorImageVersion == 20033 &&
nt_header.OptionalHeader.MinorImageVersion == 18771)
if (nt_header.OptionalHeader.MajorImageVersion == 20033 && // 'AN'
nt_header.OptionalHeader.MinorImageVersion == 18771) // 'SI'
return -1;
*pBase = minfo.BaseAddress;