Function at 0x4016e0
Capabilities:
Read file on windows

Disassembly:
push ebp
push edi
push esi
push ebx
mov ebx, edx
mov esi, eax
sub esp, 0x2c
mov dword [esp], edx
call sub.msvcrt.dll_ftell
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 1
mov edi, eax
mov dword [esp + 4], 0x10
mov dword [esp], 0x4270a0
call sub.msvcrt.dll_fread
cmp eax, 1
je 0x401740
mov dword [esp], str._s:_Failed_to_read_ELF_header_n
call fcn.00403920
mov dword [esp + 4], esi
mov dword [esp], eax
call fcn.004022e0
mov eax, 1
add esp, 0x2c
pop ebx
pop esi
pop edi
pop ebp
ret
cmp byte [0x4270a5], 2
je 0x401795
movzx edx, byte [0x4270a4]
mov dword [0x427ec4], 0x402960
mov dword [0x427ec8], 0x402840
cmp dl, 1
je 0x4017b5
cmp dl, 2
mov byte [esp + 0x18], dl
je 0x401971
mov dword [esp], str.Unsupported_EI_CLASS:__d_n
call fcn.00403920
movzx edx, byte [esp + 0x18]
mov dword [esp], eax
mov dword [esp + 4], edx
call fcn.004022e0
jmp 0x40171a
movzx edx, byte [0x4270a4]
mov dword [0x427ec4], 0x402340
mov dword [0x427ec8], 0x4028d0
cmp dl, 1
jne 0x401769
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 1
mov dword [esp + 4], 0x24
mov dword [esp], 0x427070
call sub.msvcrt.dll_fread
cmp eax, 1
jne 0x40171a
mov dword [esp + 4], 2
mov dword [esp], 0x427070
call dword [0x427ec4]
mov dword [esp + 4], 2
mov word [0x4270d0], ax
mov dword [esp], 0x427072
call dword [0x427ec4]
mov dword [esp + 4], 4
mov word [0x4270d2], ax
mov dword [esp], 0x427074
call dword [0x427ec4]
mov dword [esp + 4], 4
mov dword [0x4270c8], eax
mov dword [esp], 0x427078
call dword [0x427ec4]
mov dword [esp + 4], 4
mov dword [0x4270b0], eax
mov dword [0x4270b4], edx
mov dword [esp], 0x42707c
call dword [0x427ec4]
mov dword [esp + 4], 4
mov dword [0x4270b8], eax
mov dword [0x4270bc], edx
mov dword [esp], 0x427080
call dword [0x427ec4]
mov dword [esp + 4], 4
mov dword [0x4270c0], eax
mov dword [0x4270c4], edx
mov dword [esp], 0x427084
call dword [0x427ec4]
mov dword [esp + 4], 2
mov dword [0x4270cc], eax
mov dword [esp], 0x427088
call dword [0x427ec4]
mov dword [esp + 4], 2
mov dword [0x4270d4], eax
mov dword [esp], 0x42708a
call dword [0x427ec4]
mov dword [esp + 4], 2
mov dword [0x4270d8], eax
mov dword [esp], 0x42708c
call dword [0x427ec4]
mov dword [esp + 4], 2
mov dword [0x4270dc], eax
mov dword [esp], 0x42708e
call dword [0x427ec4]
mov dword [esp + 4], 2
mov dword [0x4270e0], eax
mov dword [esp], 0x427090
call dword [0x427ec4]
mov dword [esp + 4], 2
mov dword [0x4270e4], eax
mov dword [esp], 0x427092
call dword [0x427ec4]
mov dword [0x4270e8], eax
mov eax, dword [0x4270a0]
mov dword [0x427060], eax
mov eax, dword [0x4270a4]
mov dword [0x427064], eax
mov eax, dword [0x4270a8]
mov dword [0x427068], eax
mov eax, dword [0x4270ac]
mov dword [0x42706c], eax
jmp 0x401b28
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 1
mov dword [esp + 4], 0x30
mov dword [esp], 0x427030
call sub.msvcrt.dll_fread
cmp eax, 1
jne 0x40171a
mov dword [esp + 4], 2
mov dword [esp], 0x427030
call dword [0x427ec4]
mov dword [esp + 4], 2
mov word [0x4270d0], ax
mov dword [esp], 0x427032
call dword [0x427ec4]
mov dword [esp + 4], 4
mov word [0x4270d2], ax
mov dword [esp], 0x427034
call dword [0x427ec4]
mov dword [esp + 4], 8
mov dword [0x4270c8], eax
mov dword [esp], 0x427038
call dword [0x427ec4]
mov dword [esp + 4], 8
mov dword [0x4270b0], eax
mov dword [0x4270b4], edx
mov dword [esp], 0x427040
call dword [0x427ec4]
mov dword [esp + 4], 8
mov dword [0x4270b8], eax
mov dword [0x4270bc], edx
mov dword [esp], 0x427048
call dword [0x427ec4]
mov dword [esp + 4], 4
mov dword [0x4270c0], eax
mov dword [0x4270c4], edx
mov dword [esp], 0x427050
call dword [0x427ec4]
mov dword [esp + 4], 2
mov dword [0x4270cc], eax
mov dword [esp], 0x427054
call dword [0x427ec4]
mov dword [esp + 4], 2
mov dword [0x4270d4], eax
mov dword [esp], 0x427056
call dword [0x427ec4]
mov dword [esp + 4], 2
mov dword [0x4270d8], eax
mov dword [esp], 0x427058
call dword [0x427ec4]
mov dword [esp + 4], 2
mov dword [0x4270dc], eax
mov dword [esp], 0x42705a
call dword [0x427ec4]
mov dword [esp + 4], 2
mov dword [0x4270e0], eax
mov dword [esp], 0x42705c
call dword [0x427ec4]
mov dword [esp + 4], 2
mov dword [0x4270e4], eax
mov dword [esp], 0x42705e
call dword [0x427ec4]
mov dword [0x4270e8], eax
mov eax, dword [0x4270a0]
mov dword [0x427020], eax
mov eax, dword [0x4270a4]
mov dword [0x427024], eax
mov eax, dword [0x4270a8]
mov dword [0x427028], eax
mov eax, dword [0x4270ac]
mov dword [0x42702c], eax
mov dword [esp + 8], 0
mov dword [esp + 4], edi
mov dword [esp], ebx
call fcn.00413490
test eax, eax
jne 0x401c10
cmp dword [0x4270a0], 0x464c457f
jne 0x401c00
movzx edx, byte [0x4270a6]
cmp dl, 1
mov byte [esp + 0x18], dl
jne 0x401c30
movzx ebp, word [0x4270d2]
mov ecx, dword [0x41c0c8]
cmp ebp, ecx
mov eax, ebp
je 0x401cd0
movzx edi, byte [0x4270a4]
mov edx, edi
mov dword [esp + 0x18], edi
mov edi, dword [0x41c0b4]
cmp edi, 0xffffffff
je 0x401cf0
cmp edi, 3
setne al
cmp dword [esp + 0x18], edi
setne byte [esp + 0x1f]
and al, byte [esp + 0x1f]
test al, al
jne 0x401ce0
mov edi, dword [0x41c0b0]
cmp edi, 3
je 0x401c70
cmp dword [esp + 0x18], edi
je 0x401c70
mov dword [esp], str._s:_Unmatched_output_EI_CLASS:__d_is_not__d_n
call fcn.00403920
mov ecx, dword [esp + 0x18]
mov dword [esp], eax
mov dword [esp + 0xc], edi
mov dword [esp + 4], esi
mov dword [esp + 8], ecx
call fcn.004022e0
mov eax, 1
jmp 0x401737
mov dword [esp], str._s:_Not_an_ELF_file___wrong_magic_bytes_at_the_start_n
jmp 0x401721
mov dword [esp], str._s:_Failed_to_seek_to_ELF_header_n
call fcn.00403920
mov dword [esp + 4], esi
mov dword [esp], eax
call fcn.004022e0
jmp 0x401b44
mov dword [esp], str._s:_Unsupported_EI_VERSION:__d_is_not__d_n
call fcn.00403920
movzx edx, byte [esp + 0x18]
mov dword [esp + 4], esi
mov dword [esp], eax
mov dword [esp + 0xc], 1
mov dword [esp + 8], edx
call fcn.004022e0
add esp, 0x2c
mov eax, 1
pop ebx
pop esi
pop edi
pop ebp
ret
mov edi, dword [0x41c0cc]
cmp edi, 0xffffffff
je 0x401cb0
cmp ebp, edi
je 0x401cb0
mov dword [esp], str._s:_Unmatched_e_machine:__d_is_not__d_n
call fcn.00403920
mov dword [esp + 0xc], edi
mov dword [esp], eax
mov dword [esp + 8], ebp
mov dword [esp + 4], esi
call fcn.004022e0
mov eax, 1
jmp 0x401737
mov edi, dword [0x41c0c4]
movzx ebp, word [0x4270d0]
cmp edi, 0xffffffff
je 0x401d20
cmp ebp, edi
je 0x401d20
mov dword [esp], str._s:_Unmatched_e_type:__d_is_not__d_n
jmp 0x401c86
xor eax, eax
jmp 0x401737
mov dword [esp], str._s:_Unmatched_input_EI_CLASS:__d_is_not__d_n
jmp 0x401bd6
cmp bp, 6
je 0x401d66
jbe 0x401d60
sub ax, 0xb4
cmp ax, 1
ja 0x401d55
cmp dword [esp + 0x18], 2
mov edi, 2
setne al
mov dword [0x41c0b4], edi
jmp 0x401bae
movzx ebp, byte [0x4270a7]
mov edi, dword [0x41c0bc]
cmp ebp, edi
je 0x401d42
cmp edi, 0xffffffff
je 0x401d42
mov dword [esp], str._s:_Unmatched_EI_OSABI:__d_is_not__d_n
jmp 0x401c86
cmp dl, 1
je 0x401e40
cmp dl, 2
je 0x401d75
call sub.msvcrt.dll_abort
xor eax, eax
mov edi, 3
jmp 0x401d0f
cmp bp, 3
jne 0x401d55
cmp dword [esp + 0x18], 1
mov edi, 1
setne al
jmp 0x401d0f
cmp ecx, 0xffffffff
je 0x401d9a
mov dword [esp + 4], ecx
sar ecx, 0x1f
mov dword [esp + 0xc], 2
mov dword [esp + 8], ecx
mov dword [esp], 0x427032
call dword [0x427ec8]
mov eax, dword [0x41c0c0]
cmp eax, 0xffffffff
je 0x401dc4
mov dword [esp + 4], eax
sar eax, 0x1f
mov dword [esp + 0xc], 2
mov dword [esp + 8], eax
mov dword [esp], 0x427030
call dword [0x427ec8]
mov eax, dword [0x41c0b8]
cmp eax, 0xffffffff
je 0x401dd3
mov byte [0x427027], al
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 1
mov dword [esp + 4], 0x40
mov dword [esp], 0x427020
call fcn.004134b0
cmp eax, 1
sete al
movzx eax, al
cmp eax, 1
je 0x401cd0
call sub.msvcrt.dll__errno
mov eax, dword [eax]
mov dword [esp], eax
call sub.msvcrt.dll_strerror
mov dword [esp], str._s:_Failed_to_update_ELF_header:__s_n
mov ebx, eax
call fcn.00403920
mov dword [esp + 8], ebx
mov dword [esp], eax
mov dword [esp + 4], esi
call fcn.004022e0
mov eax, 1
jmp 0x401737
cmp ecx, 0xffffffff
je 0x401e65
mov dword [esp + 4], ecx
sar ecx, 0x1f
mov dword [esp + 0xc], 2
mov dword [esp + 8], ecx
mov dword [esp], 0x427072
call dword [0x427ec8]
mov eax, dword [0x41c0c0]
cmp eax, 0xffffffff
je 0x401e8f
mov dword [esp + 4], eax
sar eax, 0x1f
mov dword [esp + 0xc], 2
mov dword [esp + 8], eax
mov dword [esp], 0x427070
call dword [0x427ec8]
mov eax, dword [0x41c0b8]
cmp eax, 0xffffffff
je 0x401e9e
mov byte [0x427067], al
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 1
mov dword [esp + 4], 0x34
mov dword [esp], 0x427060
call fcn.004134b0
cmp eax, 1
sete al
movzx eax, al
jmp 0x401dfc