Function at 0x4016a0
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], 0x4130c0
call sub.msvcrt.dll_fread
cmp eax, 1
je 0x401700
mov dword [esp + 4], esi
mov dword [esp], str._s:_Failed_to_read_ELF_header_n
call fcn.004022f0
mov eax, 1
add esp, 0x2c
pop ebx
pop esi
pop edi
pop ebp
ret
cmp byte [0x4130c5], 2
je 0x401742
movzx eax, byte [0x4130c4]
mov dword [0x413da4], 0x402a10
mov dword [0x413da8], 0x402900
cmp al, 1
je 0x401761
cmp al, 2
je 0x401920
mov dword [esp + 4], eax
mov dword [esp], str.Unsupported_EI_CLASS:__d_n
call fcn.004022f0
jmp 0x4016da
movzx eax, byte [0x4130c4]
mov dword [0x413da4], 0x402340
mov dword [0x413da8], 0x402980
cmp al, 1
jne 0x401728
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 1
mov dword [esp + 4], 0x24
mov dword [esp], 0x413090
call sub.msvcrt.dll_fread
cmp eax, 1
jne 0x4016da
mov dword [esp + 4], 2
mov dword [esp], 0x413090
call dword [0x413da4]
mov dword [esp + 4], 2
mov word [0x4130f0], ax
mov dword [esp], 0x413092
call dword [0x413da4]
mov dword [esp + 4], 4
mov word [0x4130f2], ax
mov dword [esp], 0x413094
call dword [0x413da4]
mov dword [esp + 4], 4
mov dword [0x4130e8], eax
mov dword [esp], 0x413098
call dword [0x413da4]
mov dword [esp + 4], 4
mov dword [0x4130d0], eax
mov dword [0x4130d4], edx
mov dword [esp], 0x41309c
call dword [0x413da4]
mov dword [esp + 4], 4
mov dword [0x4130d8], eax
mov dword [0x4130dc], edx
mov dword [esp], 0x4130a0
call dword [0x413da4]
mov dword [esp + 4], 4
mov dword [0x4130e0], eax
mov dword [0x4130e4], edx
mov dword [esp], 0x4130a4
call dword [0x413da4]
mov dword [esp + 4], 2
mov dword [0x4130ec], eax
mov dword [esp], 0x4130a8
call dword [0x413da4]
mov dword [esp + 4], 2
mov dword [0x4130f4], eax
mov dword [esp], 0x4130aa
call dword [0x413da4]
mov dword [esp + 4], 2
mov dword [0x4130f8], eax
mov dword [esp], 0x4130ac
call dword [0x413da4]
mov dword [esp + 4], 2
mov dword [0x4130fc], eax
mov dword [esp], 0x4130ae
call dword [0x413da4]
mov dword [esp + 4], 2
mov dword [0x413100], eax
mov dword [esp], 0x4130b0
call dword [0x413da4]
mov dword [esp + 4], 2
mov dword [0x413104], eax
mov dword [esp], 0x4130b2
call dword [0x413da4]
mov dword [0x413108], eax
mov eax, dword [0x4130c0]
mov dword [0x413080], eax
mov eax, dword [0x4130c4]
mov dword [0x413084], eax
mov eax, dword [0x4130c8]
mov dword [0x413088], eax
mov eax, dword [0x4130cc]
mov dword [0x41308c], eax
jmp 0x401ad7
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 1
mov dword [esp + 4], 0x30
mov dword [esp], 0x413050
call sub.msvcrt.dll_fread
cmp eax, 1
jne 0x4016da
mov dword [esp + 4], 2
mov dword [esp], 0x413050
call dword [0x413da4]
mov dword [esp + 4], 2
mov word [0x4130f0], ax
mov dword [esp], 0x413052
call dword [0x413da4]
mov dword [esp + 4], 4
mov word [0x4130f2], ax
mov dword [esp], 0x413054
call dword [0x413da4]
mov dword [esp + 4], 8
mov dword [0x4130e8], eax
mov dword [esp], 0x413058
call dword [0x413da4]
mov dword [esp + 4], 8
mov dword [0x4130d0], eax
mov dword [0x4130d4], edx
mov dword [esp], 0x413060
call dword [0x413da4]
mov dword [esp + 4], 8
mov dword [0x4130d8], eax
mov dword [0x4130dc], edx
mov dword [esp], 0x413068
call dword [0x413da4]
mov dword [esp + 4], 4
mov dword [0x4130e0], eax
mov dword [0x4130e4], edx
mov dword [esp], 0x413070
call dword [0x413da4]
mov dword [esp + 4], 2
mov dword [0x4130ec], eax
mov dword [esp], 0x413074
call dword [0x413da4]
mov dword [esp + 4], 2
mov dword [0x4130f4], eax
mov dword [esp], 0x413076
call dword [0x413da4]
mov dword [esp + 4], 2
mov dword [0x4130f8], eax
mov dword [esp], 0x413078
call dword [0x413da4]
mov dword [esp + 4], 2
mov dword [0x4130fc], eax
mov dword [esp], 0x41307a
call dword [0x413da4]
mov dword [esp + 4], 2
mov dword [0x413100], eax
mov dword [esp], 0x41307c
call dword [0x413da4]
mov dword [esp + 4], 2
mov dword [0x413104], eax
mov dword [esp], 0x41307e
call dword [0x413da4]
mov dword [0x413108], eax
mov eax, dword [0x4130c0]
mov dword [0x413040], eax
mov eax, dword [0x4130c4]
mov dword [0x413044], eax
mov eax, dword [0x4130c8]
mov dword [0x413048], eax
mov eax, dword [0x4130cc]
mov dword [0x41304c], eax
mov dword [esp + 8], 0
mov dword [esp + 4], edi
mov dword [esp], ebx
call fcn.00405b60
test eax, eax
je 0x401aff
mov dword [esp + 4], esi
mov dword [esp], str._s:_Failed_to_seek_to_ELF_header_n
call fcn.004022f0
cmp dword [0x4130c0], 0x464c457f
jne 0x401ba0
movzx eax, byte [0x4130c6]
cmp al, 1
jne 0x401bb2
movzx ecx, word [0x4130f2]
mov ebp, dword [0x40d0a8]
cmp ecx, ebp
mov edx, ecx
je 0x401c40
movzx edi, byte [0x4130c4]
mov eax, edi
mov byte [esp + 0x1f], al
mov eax, dword [0x40d094]
cmp eax, 0xffffffff
je 0x401c70
cmp edi, eax
setne byte [esp + 0x1e]
cmp eax, 3
setne dl
and dl, byte [esp + 0x1e]
test dl, dl
jne 0x401c50
mov eax, dword [0x40d090]
cmp edi, eax
je 0x401bd0
cmp eax, 3
je 0x401bd0
mov dword [esp + 0xc], eax
mov dword [esp + 8], edi
mov dword [esp + 4], esi
mov dword [esp], str._s:_Unmatched_output_EI_CLASS:__d_is_not__d_n
call fcn.004022f0
nop
add esp, 0x2c
mov eax, 1
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 4], esi
mov dword [esp], str._s:_Not_an_ELF_file___wrong_magic_bytes_at_the_start_n
call fcn.004022f0
jmp 0x401b90
mov dword [esp + 0xc], 1
mov dword [esp + 8], eax
mov dword [esp + 4], esi
mov dword [esp], str._s:_Unsupported_EI_VERSION:__d_is_not__d_n
call fcn.004022f0
jmp 0x401b90
mov eax, dword [0x40d0ac]
cmp ecx, eax
je 0x401c00
cmp eax, 0xffffffff
je 0x401c00
mov dword [esp + 0xc], eax
mov dword [esp + 8], ecx
mov dword [esp + 4], esi
mov dword [esp], str._s:_Unmatched_e_machine:__d_is_not__d_n
call fcn.004022f0
jmp 0x401b90
movzx edx, word [0x4130f0]
mov eax, dword [0x40d0a4]
cmp edx, eax
je 0x401ca0
cmp eax, 0xffffffff
je 0x401ca0
mov dword [esp + 0xc], eax
mov dword [esp + 8], edx
mov dword [esp + 4], esi
mov dword [esp], str._s:_Unmatched_e_type:__d_is_not__d_n
call fcn.004022f0
jmp 0x401b90
xor eax, eax
jmp 0x4016ef
mov dword [esp + 0xc], eax
mov dword [esp + 8], edi
mov dword [esp + 4], esi
mov dword [esp], str._s:_Unmatched_input_EI_CLASS:__d_is_not__d_n
call fcn.004022f0
jmp 0x401b90
cmp cx, 6
je 0x401d06
jbe 0x401d00
sub dx, 0xb4
cmp dx, 1
ja 0x401cf0
cmp edi, 2
mov eax, 2
setne dl
mov dword [0x40d094], eax
jmp 0x401b61
movzx edx, byte [0x4130c7]
mov eax, dword [0x40d09c]
cmp edx, eax
je 0x401cd2
cmp eax, 0xffffffff
je 0x401cd2
mov dword [esp + 0xc], eax
mov dword [esp + 8], edx
mov dword [esp + 4], esi
mov dword [esp], str._s:_Unmatched_EI_OSABI:__d_is_not__d_n
call fcn.004022f0
jmp 0x401b90
movzx eax, byte [esp + 0x1f]
cmp al, 1
je 0x401de0
cmp al, 2
je 0x401d20
call sub.msvcrt.dll_abort
nop
lea esi, [esi]
xor edx, edx
mov eax, 3
jmp 0x401c96
cmp cx, 3
jne 0x401cf0
cmp edi, 1
mov eax, 1
setne dl
jmp 0x401c96
cmp ebp, 0xffffffff
je 0x401d45
mov dword [esp + 4], ebp
sar ebp, 0x1f
mov dword [esp + 0xc], 2
mov dword [esp + 8], ebp
mov dword [esp], 0x413052
call dword [0x413da8]
mov eax, dword [0x40d0a0]
cmp eax, 0xffffffff
je 0x401d6f
mov dword [esp + 4], eax
sar eax, 0x1f
mov dword [esp + 0xc], 2
mov dword [esp + 8], eax
mov dword [esp], 0x413050
call dword [0x413da8]
mov eax, dword [0x40d098]
cmp eax, 0xffffffff
je 0x401d7e
mov byte [0x413047], al
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 1
mov dword [esp + 4], 0x40
mov dword [esp], 0x413040
call fcn.00405b80
cmp eax, 1
sete al
movzx eax, al
cmp eax, 1
je 0x401c40
call sub.msvcrt.dll__errno
mov eax, dword [eax]
mov dword [esp], eax
call sub.msvcrt.dll_strerror
mov dword [esp + 4], esi
mov dword [esp + 8], eax
mov dword [esp], str._s:_Failed_to_update_ELF_header:__s_n
call fcn.004022f0
jmp 0x401b90
cmp ebp, 0xffffffff
je 0x401e05
mov dword [esp + 4], ebp
sar ebp, 0x1f
mov dword [esp + 0xc], 2
mov dword [esp + 8], ebp
mov dword [esp], 0x413092
call dword [0x413da8]
mov eax, dword [0x40d0a0]
cmp eax, 0xffffffff
je 0x401e2f
mov dword [esp + 4], eax
sar eax, 0x1f
mov dword [esp + 0xc], 2
mov dword [esp + 8], eax
mov dword [esp], 0x413090
call dword [0x413da8]
mov eax, dword [0x40d098]
cmp eax, 0xffffffff
je 0x401e3e
mov byte [0x413087], al
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 1
mov dword [esp + 4], 0x34
mov dword [esp], 0x413080
call fcn.00405b80
cmp eax, 1
sete al
movzx eax, al
jmp 0x401da7