Add some comments
This commit is contained in:
parent
40f59c543c
commit
bff5e90eda
3
injdll.c
3
injdll.c
@ -24,9 +24,10 @@ static PVOID FindMem( HANDLE hProcess, PBYTE base, DWORD len )
|
|||||||
if ((minfo.State & MEM_FREE) && minfo.RegionSize >= len)
|
if ((minfo.State & MEM_FREE) && minfo.RegionSize >= len)
|
||||||
{
|
{
|
||||||
#ifdef _WIN64
|
#ifdef _WIN64
|
||||||
if ((PBYTE)minfo.BaseAddress - base > 0xFfFfFfFf - len)
|
if ((PBYTE)minfo.BaseAddress - base > 0xFFFFffff - len)
|
||||||
return NULL;
|
return NULL;
|
||||||
#endif
|
#endif
|
||||||
|
// Round up to the allocation granularity, presumed to be 64Ki.
|
||||||
mem = VirtualAllocEx( hProcess, (PVOID)
|
mem = VirtualAllocEx( hProcess, (PVOID)
|
||||||
(((DWORD_PTR)minfo.BaseAddress + 0xFFFF) & ~0xFFFF),
|
(((DWORD_PTR)minfo.BaseAddress + 0xFFFF) & ~0xFFFF),
|
||||||
len, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE );
|
len, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE );
|
||||||
|
@ -63,8 +63,8 @@ int ProcessType( LPPROCESS_INFORMATION ppi, PBYTE* pBase, BOOL* gui )
|
|||||||
&& !(nt_header.FileHeader.Characteristics & IMAGE_FILE_DLL))
|
&& !(nt_header.FileHeader.Characteristics & IMAGE_FILE_DLL))
|
||||||
{
|
{
|
||||||
// Don't load into ansicon.exe, it wants to do that itself.
|
// Don't load into ansicon.exe, it wants to do that itself.
|
||||||
if (nt_header.OptionalHeader.MajorImageVersion == 20033 &&
|
if (nt_header.OptionalHeader.MajorImageVersion == 20033 && // 'AN'
|
||||||
nt_header.OptionalHeader.MinorImageVersion == 18771)
|
nt_header.OptionalHeader.MinorImageVersion == 18771) // 'SI'
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
*pBase = minfo.BaseAddress;
|
*pBase = minfo.BaseAddress;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user