Function at 0x4020dd
Capabilities:
Acquire debug privileges
Get file size
Query environment variable
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc48
mov eax, dword [0x44a004]
xor eax, ebp
mov dword [ebp - 4], eax
push edi
and dword [ebp - 0xc2c], 0
and dword [ebp - 0xc18], 0
xor eax, eax
lea edi, [ebp - 0xc28]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
push 0x208
push 0
lea eax, [ebp - 0x814]
push eax
call fcn.004042f0
add esp, 0xc
push 0x208
push 0
lea eax, [ebp - 0x60c]
push eax
call fcn.004042f0
add esp, 0xc
push 0x208
lea eax, [ebp - 0x814]
push eax
push str.Hook64_ProcessId
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
test eax, eax
jne 0x402159
xor eax, eax
jmp 0x4025cf
push 0x208
lea eax, [ebp - 0x60c]
push eax
push str.Hook64_HookDll
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
test eax, eax
jne 0x40217b
xor eax, eax
jmp 0x4025cf
lea eax, [ebp - 0x814]
push eax
call fcn.004201f8
pop ecx
push eax
push 0
push 0x1fffff
call dword [sym.imp.KERNEL32.dll_OpenProcess]
mov dword [ebp - 0xc30], eax
cmp dword [ebp - 0xc30], 0
jne 0x4021c0
push 0x10
push 0x448160
push str.There_was_an_error_while_opening_the_game_process.
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
xor eax, eax
jmp 0x4025cf
push 0
push 0x80
push 3
push 0
push 0
push 1
lea eax, [ebp - 0x60c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0xc38], eax
cmp dword [ebp - 0xc38], 0xffffffff
jne 0x40224d
push 0x400
push 0
lea eax, [ebp - 0xc14]
push eax
call fcn.004042f0
add esp, 0xc
lea eax, [ebp - 0x60c]
push eax
push str.Unable_to_access__s._nCheck_that_the_file_exists_and_isnt_open_in_another_process.
push 0x400
lea eax, [ebp - 0xc14]
push eax
call fcn.0040105c
add esp, 0x10
push 0x10
push 0x44821c
lea eax, [ebp - 0xc14]
push eax
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
push 0
push dword [ebp - 0xc30]
call fcn.00402063
pop ecx
pop ecx
xor eax, eax
jmp 0x4025cf
push 0
push dword [ebp - 0xc38]
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0xc34], eax
cmp dword [ebp - 0xc34], 0xffffffff
je 0x402273
cmp dword [ebp - 0xc34], 0
jne 0x40229d
push 0x10
push 0x448224
push 0x44819c
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
push 0
push dword [ebp - 0xc30]
call fcn.00402063
pop ecx
pop ecx
xor eax, eax
jmp 0x4025cf
push dword [ebp - 0xc34]
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebp - 0xc40], eax
cmp dword [ebp - 0xc40], 0
jne 0x4022eb
push 0x10
push 0x44822c
push str.There_was_an_error_while_injecting_Hook64.
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
push 0
push dword [ebp - 0xc30]
call fcn.00402063
pop ecx
pop ecx
xor eax, eax
jmp 0x4025cf
push 0
lea eax, [ebp - 0xc18]
push eax
push dword [ebp - 0xc34]
push dword [ebp - 0xc40]
push dword [ebp - 0xc38]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40233a
push 0x10
push 0x448260
push str.There_was_an_error_while_reading_the_hook_dll.
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
push 0
push dword [ebp - 0xc30]
call fcn.00402063
pop ecx
pop ecx
xor eax, eax
jmp 0x4025cf
lea eax, [ebp - 0xc2c]
push eax
push 0x28
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
je 0x4023b5
mov dword [ebp - 0xc28], 1
push 0xc
pop eax
imul eax, eax, 0
mov dword [ebp + eax - 0xc1c], 2
push 0xc
pop eax
imul eax, eax, 0
lea eax, [ebp + eax - 0xc24]
push eax
push str.SeDebugPrivilege
push 0
call dword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueA]
test eax, eax
je 0x4023a9
push 0
push 0
push 0
lea eax, [ebp - 0xc28]
push eax
push 0
push dword [ebp - 0xc2c]
call dword [sym.imp.ADVAPI32.dll_AdjustTokenPrivileges]
push dword [ebp - 0xc2c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp - 0xc38]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0
push 0
push 0x6654bba6
push 0
push dword [ebp - 0xc34]
push dword [ebp - 0xc40]
push dword [ebp - 0xc30]
call fcn.00401b9f
mov dword [ebp - 0xc48], eax
mov eax, dword [ebp - 0xc48]
mov dword [ebp - 0xc44], eax
cmp dword [ebp - 0xc44], 0
jge 0x402591
push 0x400
push 0
lea eax, [ebp - 0x404]
push eax
call fcn.004042f0
add esp, 0xc
mov eax, dword [ebp - 0xc44]
mov dword [ebp - 0xc3c], eax
mov eax, dword [ebp - 0xc3c]
add eax, 0xa
mov dword [ebp - 0xc3c], eax
cmp dword [ebp - 0xc3c], 8
ja case.default.0x402446
mov eax, dword [ebp - 0xc3c]
jmp dword [eax*4 + 0x4025e1]
push str.There_was_an_error_while_injecting_Hook64.__ERROR_INVALID_DATA_
push 0x400
lea eax, [ebp - 0x404]
push eax
call fcn.0040105c
add esp, 0xc
jmp 0x402568
push str.There_was_an_error_while_injecting_Hook64.__ERROR_INVALID_LIBRARY_
push 0x400
lea eax, [ebp - 0x404]
push eax
call fcn.0040105c
add esp, 0xc
jmp 0x402568
push str.There_was_an_error_while_injecting_Hook64.__ERROR_INVALID_ARCHITECTURE_
push 0x400
lea eax, [ebp - 0x404]
push eax
call fcn.0040105c
add esp, 0xc
jmp 0x402568
push str.There_was_an_error_while_injecting_Hook64.__ERROR_INVALID_OFFSET_
push 0x400
lea eax, [ebp - 0x404]
push eax
call fcn.0040105c
add esp, 0xc
jmp 0x402568
push str.There_was_an_error_while_injecting_Hook64.__ERROR_ALLOCATION_FAILED_
push 0x400
lea eax, [ebp - 0x404]
push eax
call fcn.0040105c
add esp, 0xc
jmp 0x402568
push str.There_was_an_error_while_injecting_Hook64.__ERROR_WRITE_FAILED_
push 0x400
lea eax, [ebp - 0x404]
push eax
call fcn.0040105c
add esp, 0xc
jmp 0x402568
push str.There_was_an_error_while_injecting_Hook64.__ERROR_BOOTSTRAP_FAILED_
push 0x400
lea eax, [ebp - 0x404]
push eax
call fcn.0040105c
add esp, 0xc
jmp 0x402568
push str.There_was_an_error_while_injecting_Hook64.__ERROR_INJECTION_FAILED_
push 0x400
lea eax, [ebp - 0x404]
push eax
call fcn.0040105c
add esp, 0xc
jmp 0x402568
push str.There_was_an_error_while_injecting_Hook64.__ERROR_EXCEPTION_
push 0x400
lea eax, [ebp - 0x404]
push eax
call fcn.0040105c
add esp, 0xc
jmp 0x402568
push str.There_was_an_unknown_error_while_injecting_Hook64.
push 0x400
lea eax, [ebp - 0x404]
push eax
call fcn.0040105c
add esp, 0xc
push 0x10
push 0x448414
lea eax, [ebp - 0x404]
push eax
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
push 0
push dword [ebp - 0xc30]
call fcn.00402063
pop ecx
pop ecx
xor eax, eax
jmp 0x4025cf
push 0x1388
push dword [ebp - 0xc48]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
jne 0x4025aa
xor eax, eax
jmp 0x4025cf
push 0x10
push str.Hook64
push str.Injection_of_Hook64_has_timed_out.
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
push 0
push dword [ebp - 0xc30]
call fcn.00402063
pop ecx
pop ecx
xor eax, eax
pop edi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00402d52
leave
ret 0x10