Function at 0x4016f0
Capabilities:
Read file on windows

Disassembly:
push ebp
push edi
push esi
mov esi, eax
push ebx
mov ebx, edx
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], 0x41b0a0
call sub.msvcrt.dll_fread
cmp eax, 1
je 0x401750
mov dword [esp], str._s:_Failed_to_read_ELF_header_n
call fcn.00403a80
mov dword [esp + 4], esi
mov dword [esp], eax
call fcn.00402350
mov eax, 1
add esp, 0x2c
pop ebx
pop esi
pop edi
pop ebp
ret
cmp dword [0x41b0a0], 0x464c457f
jne 0x40172a
cmp byte [0x41b0a5], 2
je 0x401950
mov dword [0x41bb64], fcn.004029c0
mov dword [0x41bb68], 0x4028d0
movzx eax, byte [0x41b0a4]
cmp al, 1
je 0x401970
cmp al, 2
jne 0x40172a
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 1
mov dword [esp + 4], 0x30
mov dword [esp], 0x41b030
call sub.msvcrt.dll_fread
cmp eax, 1
jne 0x40172a
mov dword [esp + 4], 2
mov dword [esp], 0x41b030
call dword [0x41bb64]
mov dword [esp + 4], 2
mov word [0x41b0d0], ax
mov dword [esp], 0x41b032
call dword [0x41bb64]
mov dword [esp + 4], 4
mov word [0x41b0d2], ax
mov dword [esp], 0x41b034
call dword [0x41bb64]
mov dword [esp + 4], 8
mov dword [0x41b0c8], eax
mov dword [esp], 0x41b038
call dword [0x41bb64]
mov dword [esp + 4], 8
mov dword [0x41b0b0], eax
mov dword [0x41b0b4], edx
mov dword [esp], 0x41b040
call dword [0x41bb64]
mov dword [esp + 4], 8
mov dword [0x41b0b8], eax
mov dword [0x41b0bc], edx
mov dword [esp], 0x41b048
call dword [0x41bb64]
mov dword [esp + 4], 4
mov dword [0x41b0c0], eax
mov dword [0x41b0c4], edx
mov dword [esp], 0x41b050
call dword [0x41bb64]
mov dword [esp + 4], 2
mov dword [0x41b0cc], eax
mov dword [esp], 0x41b054
call dword [0x41bb64]
mov dword [esp + 4], 2
mov dword [0x41b0d4], eax
mov dword [esp], 0x41b056
call dword [0x41bb64]
mov dword [esp + 4], 2
mov dword [0x41b0d8], eax
mov dword [esp], 0x41b058
call dword [0x41bb64]
mov dword [esp + 4], 2
mov dword [0x41b0dc], eax
mov dword [esp], 0x41b05a
call dword [0x41bb64]
mov dword [esp + 4], 2
mov dword [0x41b0e0], eax
mov dword [esp], 0x41b05c
call dword [0x41bb64]
mov dword [esp + 4], 2
mov dword [0x41b0e4], eax
mov dword [esp], 0x41b05e
call dword [0x41bb64]
mov dword [0x41b0e8], eax
mov eax, dword [0x41b0a0]
mov dword [0x41b020], eax
mov eax, dword [0x41b0a4]
mov dword [0x41b024], eax
mov eax, dword [0x41b0a8]
mov dword [0x41b028], eax
mov eax, dword [0x41b0ac]
mov dword [0x41b02c], eax
jmp 0x401b27
mov dword [0x41bb64], fcn.004023b0
mov dword [0x41bb68], 0x402950
jmp 0x40177d
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 1
mov dword [esp + 4], 0x24
mov dword [esp], 0x41b070
call sub.msvcrt.dll_fread
cmp eax, 1
jne 0x40172a
mov dword [esp + 4], 2
mov dword [esp], 0x41b070
call dword [0x41bb64]
mov dword [esp + 4], 2
mov word [0x41b0d0], ax
mov dword [esp], 0x41b072
call dword [0x41bb64]
mov dword [esp + 4], 4
mov word [0x41b0d2], ax
mov dword [esp], 0x41b074
call dword [0x41bb64]
mov dword [esp + 4], 4
mov dword [0x41b0c8], eax
mov dword [esp], 0x41b078
call dword [0x41bb64]
mov dword [esp + 4], 4
mov dword [0x41b0b0], eax
mov dword [0x41b0b4], edx
mov dword [esp], 0x41b07c
call dword [0x41bb64]
mov dword [esp + 4], 4
mov dword [0x41b0b8], eax
mov dword [0x41b0bc], edx
mov dword [esp], 0x41b080
call dword [0x41bb64]
mov dword [esp + 4], 4
mov dword [0x41b0c0], eax
mov dword [0x41b0c4], edx
mov dword [esp], 0x41b084
call dword [0x41bb64]
mov dword [esp + 4], 2
mov dword [0x41b0cc], eax
mov dword [esp], 0x41b088
call dword [0x41bb64]
mov dword [esp + 4], 2
mov dword [0x41b0d4], eax
mov dword [esp], 0x41b08a
call dword [0x41bb64]
mov dword [esp + 4], 2
mov dword [0x41b0d8], eax
mov dword [esp], 0x41b08c
call dword [0x41bb64]
mov dword [esp + 4], 2
mov dword [0x41b0dc], eax
mov dword [esp], 0x41b08e
call dword [0x41bb64]
mov dword [esp + 4], 2
mov dword [0x41b0e0], eax
mov dword [esp], 0x41b090
call dword [0x41bb64]
mov dword [esp + 4], 2
mov dword [0x41b0e4], eax
mov dword [esp], 0x41b092
call dword [0x41bb64]
mov dword [0x41b0e8], eax
mov eax, dword [0x41b0a0]
mov dword [0x41b060], eax
mov eax, dword [0x41b0a4]
mov dword [0x41b064], eax
mov eax, dword [0x41b0a8]
mov dword [0x41b068], eax
mov eax, dword [0x41b0ac]
mov dword [0x41b06c], eax
mov dword [esp + 4], edi
sar edi, 0x1f
mov dword [esp + 0xc], 0
mov dword [esp + 8], edi
mov dword [esp], ebx
call fcn.0040ac00
test eax, eax
jne 0x401d10
movzx edx, byte [0x41b0a6]
cmp dl, 1
jne 0x401cd3
movzx ebp, word [0x41b0d2]
mov eax, dword [0x4130c8]
mov edx, ebp
cmp ebp, eax
je 0x401d30
movzx edi, byte [0x41b0a4]
mov ecx, edi
mov dword [esp + 0x18], edi
mov edi, dword [0x4130b4]
cmp edi, 0xffffffff
je 0x401d40
cmp edi, 3
setne dl
cmp dword [esp + 0x18], edi
setne byte [esp + 0x1f]
and dl, byte [esp + 0x1f]
test dl, dl
jne 0x401e25
mov edi, dword [0x4130b0]
cmp edi, 3
je 0x401bbc
cmp dword [esp + 0x18], edi
jne 0x401e60
mov edi, dword [0x4130cc]
cmp edi, 0xffffffff
je 0x401bcf
cmp ebp, edi
jne 0x401e70
movzx ebp, word [0x41b0d0]
mov edi, dword [0x4130c4]
cmp ebp, edi
je 0x401be9
cmp edi, 0xffffffff
jne 0x401ea0
movzx ebp, byte [0x41b0a7]
mov edi, dword [0x4130bc]
cmp ebp, edi
je 0x401c03
cmp edi, 0xffffffff
jne 0x401ec2
cmp cl, 1
jne 0x401d90
cmp eax, 0xffffffff
je 0x401c31
mov dword [esp + 4], eax
sar eax, 0x1f
mov dword [esp + 0xc], 2
mov dword [esp + 8], eax
mov dword [esp], 0x41b072
call dword [0x41bb68]
mov eax, dword [0x4130c0]
cmp eax, 0xffffffff
je 0x401c5b
mov dword [esp + 4], eax
sar eax, 0x1f
mov dword [esp + 0xc], 2
mov dword [esp + 8], eax
mov dword [esp], 0x41b070
call dword [0x41bb68]
mov eax, dword [0x4130b8]
cmp eax, 0xffffffff
je 0x401c6a
mov byte [0x41b067], al
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 1
mov dword [esp + 4], 0x34
mov dword [esp], 0x41b060
call fcn.0040ac40
cmp eax, 1
sete al
movzx eax, al
cmp eax, 1
je 0x401d30
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.00403a80
mov dword [esp + 8], ebx
mov dword [esp], eax
mov dword [esp + 4], esi
call fcn.00402350
mov eax, 1
jmp 0x401747
mov dword [esp], str._s:_Unsupported_EI_VERSION:__d_is_not__d_n
mov byte [esp + 0x18], dl
call fcn.00403a80
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.00402350
add esp, 0x2c
mov eax, 1
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp], str._s:_Failed_to_seek_to_ELF_header_n
call fcn.00403a80
mov dword [esp + 4], esi
mov dword [esp], eax
call fcn.00402350
jmp 0x401b4a
add esp, 0x2c
xor eax, eax
pop ebx
pop esi
pop edi
pop ebp
ret
cmp bp, 6
je 0x401eb0
jbe 0x401d70
sub dx, 0xb4
cmp dx, 1
ja 0x401d7a
cmp dword [esp + 0x18], 2
mov edi, 2
setne dl
mov dword [0x4130b4], edi
jmp 0x401b9f
cmp bp, 3
je 0x401eb0
mov dword [0x4130b4], 3
jmp 0x401ba7
cmp cl, 2
jne 0x401ecb
cmp eax, 0xffffffff
je 0x401dbe
mov dword [esp + 4], eax
sar eax, 0x1f
mov dword [esp + 0xc], 2
mov dword [esp + 8], eax
mov dword [esp], 0x41b032
call dword [0x41bb68]
mov eax, dword [0x4130c0]
cmp eax, 0xffffffff
je 0x401de8
mov dword [esp + 4], eax
sar eax, 0x1f
mov dword [esp + 0xc], 2
mov dword [esp + 8], eax
mov dword [esp], 0x41b030
call dword [0x41bb68]
mov eax, dword [0x4130b8]
cmp eax, 0xffffffff
je 0x401df7
mov byte [0x41b027], al
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 1
mov dword [esp + 4], 0x40
mov dword [esp], 0x41b020
call fcn.0040ac40
cmp eax, 1
sete al
movzx eax, al
jmp 0x401c93
mov dword [esp], str._s:_Unmatched_input_EI_CLASS:__d_is_not__d_n
call fcn.00403a80
mov ecx, dword [esp + 0x18]
mov dword [esp + 0xc], edi
mov dword [esp + 4], esi
mov dword [esp], eax
mov dword [esp + 8], ecx
call fcn.00402350
add esp, 0x2c
mov eax, 1
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp], str._s:_Unmatched_output_EI_CLASS:__d_is_not__d_n
jmp 0x401e2c
mov dword [esp], str._s:_Unmatched_e_machine:__d_is_not__d_n
call fcn.00403a80
mov dword [esp + 0xc], edi
mov dword [esp + 8], ebp
mov dword [esp + 4], esi
mov dword [esp], eax
call fcn.00402350
add esp, 0x2c
mov eax, 1
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp], str._s:_Unmatched_e_type:__d_is_not__d_n
jmp 0x401e77
cmp dword [esp + 0x18], 1
mov edi, 1
setne dl
jmp 0x401d64
mov dword [esp], str._s:_Unmatched_EI_OSABI:__d_is_not__d_n
jmp 0x401e77
call sub.msvcrt.dll_abort