Function at 0x460870
Capabilities:
Get system information on windows
Parse pe header

Disassembly:
push ebp
mov ebp, esp
mov ecx, dword [ebp + 0xc]
sub esp, 0x2c
push ebx
xor ebx, ebx
cmp ecx, 0x40
jae 0x460890
push 0xd
call dword [sym.imp.KERNEL32.DLL_SetLastError]
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp + 8]
mov edx, 0x5a4d
cmp word [eax], dx
je 0x4608af
push 0xc1
call dword [sym.imp.KERNEL32.DLL_SetLastError]
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
push edi
mov edi, dword [eax + 0x3c]
lea edx, [edi + 0xf8]
cmp ecx, edx
jae 0x4608cd
push 0xd
call dword [sym.imp.KERNEL32.DLL_SetLastError]
pop edi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
add edi, eax
cmp dword [edi], 0x4550
mov dword [ebp - 8], edi
jne 0x4608eb
mov eax, 0x14c
cmp word [edi + 4], ax
jne 0x4608eb
test byte [edi + 0x38], 1
je 0x4608fe
push 0xc1
call dword [sym.imp.KERNEL32.DLL_SetLastError]
pop edi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
movzx eax, word [edi + 6]
movzx ecx, word [edi + 0x14]
push esi
lea ecx, [ecx + edi + 0x24]
test eax, eax
je 0x46092d
mov esi, eax
mov edx, dword [ecx + 4]
mov eax, dword [ecx]
test edx, edx
jne 0x46091f
add eax, dword [edi + 0x38]
jmp 0x460921
add eax, edx
cmp eax, ebx
jbe 0x460927
mov ebx, eax
add ecx, 0x28
dec esi
jne 0x460911
lea edx, [ebp - 0x2c]
push edx
call dword [sym.imp.KERNEL32.DLL_GetNativeSystemInfo]
mov ecx, dword [ebp - 0x28]
mov edx, dword [edi + 0x50]
lea eax, [ecx - 1]
lea esi, [edx + ecx - 1]
not eax
lea ecx, [ecx + ebx - 1]
and esi, eax
and ecx, eax
cmp esi, ecx
je 0x460966
push 0xc1
call dword [sym.imp.KERNEL32.DLL_SetLastError]
pop esi
pop edi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [edi + 0x34]
push 4
push 0x3000
push esi
push eax
call dword [sym.imp.KERNEL32.DLL_VirtualAlloc]
mov ebx, eax
test ebx, ebx
jne 0x460993
push 4
push 0x3000
push esi
push eax
call dword [sym.imp.KERNEL32.DLL_VirtualAlloc]
mov ebx, eax
test ebx, ebx
je 0x4609b9
push 0x44
push 8
call dword [sym.imp.KERNEL32.DLL_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.DLL_HeapAlloc]
mov esi, eax
xor eax, eax
cmp esi, eax
jne 0x4609ca
push 0x8000
push eax
push ebx
call dword [sym.imp.KERNEL32.DLL_VirtualFree]
push 0xe
call dword [sym.imp.KERNEL32.DLL_SetLastError]
pop esi
pop edi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
mov dword [esi + 4], ebx
movzx edx, word [edi + 0x16]
shr edx, 0xd
and edx, 1
mov dword [esi + 0x38], eax
mov dword [esi + 0x1c], edx
mov dword [esi + 0x24], 0x460740
mov dword [esi + 0x28], 0x460760
mov dword [esi + 0x2c], 0x460780
mov dword [esi + 0x30], 0x460790
mov dword [esi + 0x34], 0x4607b0
mov ecx, dword [ebp - 0x28]
mov dword [esi + 0x18], eax
mov eax, dword [ebp + 0xc]
mov dword [esi + 0x40], ecx
mov edx, dword [edi + 0x54]
push edx
call fcn.004601e0
add esp, 4
test eax, eax
je 0x460ad1
mov eax, dword [edi + 0x54]
push 4
push 0x1000
push eax
push ebx
call dword [sym.imp.KERNEL32.DLL_VirtualAlloc]
mov ecx, dword [edi + 0x54]
mov edx, dword [ebp + 8]
push ecx
push edx
push eax
mov dword [ebp - 4], eax
call fcn.0047a300
mov ecx, dword [ebp + 8]
mov eax, dword [ecx + 0x3c]
add eax, dword [ebp - 4]
push edi
mov dword [esi], eax
mov dword [eax + 0x34], ebx
mov eax, dword [ebp + 0xc]
push eax
push ecx
mov edi, esi
call fcn.00460200
add esp, 0x18
test eax, eax
je 0x460ad1
mov ecx, dword [esi]
mov eax, dword [ecx + 0x34]
mov edx, dword [ebp - 8]
sub eax, dword [edx + 0x34]
je 0x460a82
push eax
mov eax, esi
call fcn.00460520
add esp, 4
mov dword [esi + 0x20], eax
jmp 0x460a89
mov dword [esi + 0x20], 1
call fcn.004605c0
test eax, eax
je 0x460ad1
push esi
call fcn.004603a0
add esp, 4
test eax, eax
je 0x460ad1
mov eax, esi
call fcn.004604e0
test eax, eax
je 0x460ad1
mov eax, dword [esi]
mov eax, dword [eax + 0x28]
test eax, eax
je 0x460afb
add eax, ebx
cmp dword [esi + 0x1c], 0
je 0x460aef
push 0
push 1
push ebx
call eax
test eax, eax
jne 0x460adf
push 0x45a
call dword [sym.imp.KERNEL32.DLL_SetLastError]
call fcn.00460c10
pop esi
pop edi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
mov dword [esi + 0x10], 1
mov eax, esi
pop esi
pop edi
pop ebx
mov esp, ebp
pop ebp
ret
mov dword [esi + 0x3c], eax
mov eax, esi
pop esi
pop edi
pop ebx
mov esp, ebp
pop ebp
ret
mov dword [esi + 0x3c], 0
mov eax, esi
pop esi
pop edi
pop ebx
mov esp, ebp
pop ebp
ret