Function at 0x401030
Capabilities:
Parse pe header
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x419320
push 0x4181f0
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x29c
push ebx
push esi
push edi
mov dword [ebp - 0x18], esp
xor edi, edi
mov dword [ebp - 0x1c], edi
lea eax, [ebp - 0x140]
push eax
lea ecx, [ebp - 0x130]
push ecx
mov ebx, dword [ebp + 8]
push ebx
call sub.procs.dll_GetProcessBaseSize
test eax, eax
jne 0x40108a
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov dword [ebp - 0x20], edi
push 0x104
lea edx, [ebp - 0x248]
push edx
push ebx
call sub.procs.dll_GetProcessPath
test eax, eax
je 0x40113b
push edi
push 0x80
push 3
push edi
push 1
push 0x80000000
lea eax, [ebp - 0x248]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
je 0x40113b
push edi
lea ecx, [ebp - 0x138]
push ecx
push 0x40
lea edx, [ebp - 0x28c]
push edx
push esi
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
call edi
cmp word [ebp - 0x28c], 0x5a4d
jne 0x40112f
push 0
push 0
mov eax, dword [ebp - 0x250]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea ecx, [ebp - 0x138]
push ecx
push 0xf8
lea edx, [ebp - 0x11c]
push edx
push esi
call edi
cmp dword [ebp - 0x11c], 0x4550
jne 0x40112f
mov eax, dword [ebp - 0xcc]
mov dword [ebp - 0x20], eax
cmp esi, 0xffffffff
je 0x40113b
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x20]
test eax, eax
jne 0x4011bb
xor esi, esi
push ebx
push esi
push 0x10
call dword [sym.imp.KERNEL32.dll_OpenProcess]
mov edi, eax
test edi, edi
je 0x40119b
push 0x1000
call fcn.00401a60
add esp, 4
mov esi, eax
test esi, esi
je 0x40119b
lea ecx, [ebp - 0x138]
push ecx
push 0x1000
push esi
mov edx, dword [ebp - 0x130]
push edx
push edi
mov ebx, dword [sym.imp.KERNEL32.dll_ReadProcessMemory]
call ebx
test eax, eax
je 0x4011a1
push esi
call dword [sym.imp.IMAGEHLP.dll_ImageNtHeader]
test eax, eax
je 0x4011a1
mov eax, dword [eax + 0x50]
mov dword [ebp - 0x20], eax
jmp 0x4011a1
mov ebx, dword [sym.imp.KERNEL32.dll_ReadProcessMemory]
test edi, edi
je 0x4011ac
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test esi, esi
je 0x4011c1
push esi
call fcn.00401a90
add esp, 4
jmp 0x4011c1
mov ebx, dword [sym.imp.KERNEL32.dll_ReadProcessMemory]
mov eax, dword [ebp - 0x20]
test eax, eax
jne 0x4011db
xor eax, eax
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [0x41e3e0]
test eax, eax
jne 0x4012af
mov dword [ebp - 4], 0
call fcn.00401000
mov dword [ebp - 0x13c], eax
xor eax, dword [ebp + 8]
mov esi, eax
mov dword [ebp - 0x128], esi
cmp word [esi], 6
jne 0x401270
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov dword [ebp - 0x120], ecx
xor ecx, ecx
mov cx, word [esi + 0x2a]
mov edx, dword [ebp - 0x120]
mov eax, dword [edx + ecx*4]
mov eax, dword [eax + 4]
mov ecx, dword [eax + 0x50]
cmp ecx, dword [ebp - 0x140]
je 0x401250
mov dword [ebp - 4], 0xffffffff
xor eax, eax
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, dword [ebp - 0x20]
mov dword [eax + 0x50], edx
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp - 0x140]
mov dword [eax], ecx
mov edx, dword [ebp + 0x10]
mov eax, dword [ebp - 0x20]
mov dword [edx], eax
mov dword [ebp - 0x1c], 1
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0x1c]
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push str.ntdll
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push str.NtQueryInformationProcess
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov edi, eax
test edi, edi
jne 0x4012dd
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp + 8]
push ecx
push 0
push 0x438
call dword [sym.imp.KERNEL32.dll_OpenProcess]
mov esi, eax
test esi, esi
jne 0x401305
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea edx, [ebp - 0x138]
push edx
push 0x18
lea eax, [ebp - 0x2ac]
push eax
push 0
push esi
call edi
test eax, eax
jne 0x4013d3
lea ecx, [ebp - 0x138]
push ecx
push 4
lea edx, [ebp - 0x124]
push edx
mov eax, dword [ebp - 0x2a8]
add eax, 0xc
push eax
push esi
call ebx
test eax, eax
je 0x4013d3
lea ecx, [ebp - 0x138]
push ecx
push 4
lea edx, [ebp - 0x124]
push edx
mov eax, dword [ebp - 0x124]
add eax, 0xc
push eax
push esi
call ebx
test eax, eax
je 0x4013d3
lea ecx, [ebp - 0x138]
push ecx
push 4
lea edx, [ebp - 0x144]
push edx
mov eax, dword [ebp - 0x124]
add eax, 0x20
push eax
push esi
call ebx
test eax, eax
je 0x4013d3
mov ecx, dword [ebp - 0x144]
cmp ecx, dword [ebp - 0x140]
jne 0x4013d3
lea edx, [ebp - 0x138]
push edx
push 4
lea eax, [ebp - 0x20]
push eax
mov ecx, dword [ebp - 0x124]
add ecx, 0x20
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
je 0x4013d3
mov edx, dword [ebp + 0xc]
mov eax, dword [ebp - 0x140]
mov dword [edx], eax
mov ecx, dword [ebp + 0x10]
mov edx, dword [ebp - 0x20]
mov dword [ecx], edx
mov dword [ebp - 0x1c], 1
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x1c]
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret