Function at 0x401640
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x28
mov ebx, edx
mov esi, eax
push edx
call sub.msvcrt.dll_ftell
push ebx
mov edi, eax
push 1
push 0x10
push 0x40d028
call sub.msvcrt.dll_fread
add esp, 0x20
dec eax
je 0x401687
push edx
push edx
push esi
push str._s:_Failed_to_read_ELF_header_n
call fcn.004025d0
mov eax, 1
add esp, 0x10
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
cmp byte [0x40d02d], 2
je 0x4016d0
mov al, byte [0x40d02c]
mov dword [0x40dd30], 0x403510
mov dword [0x40dd40], 0x4038f0
cmp al, 1
je 0x4016ed
cmp al, 2
je 0x401850
and eax, 0xff
push edx
push edx
push eax
push str.Unsupported_EI_CLASS:__d_n
call fcn.004025d0
add esp, 0x10
jmp 0x40166a
mov al, byte [0x40d02c]
mov dword [0x40dd30], 0x402860
mov dword [0x40dd40], 0x403860
cmp al, 1
jne 0x4016ad
push ebx
push 1
push 0x24
push 0x40d088
call sub.msvcrt.dll_fread
add esp, 0x10
dec eax
jne 0x40166a
push eax
push eax
push 2
push 0x40d088
call dword [0x40dd30]
pop ecx
mov word [0x40d058], ax
pop eax
push 2
push 0x40d08a
call dword [0x40dd30]
mov word [0x40d05a], ax
pop eax
pop edx
push 4
push 0x40d08c
call dword [0x40dd30]
pop ecx
mov dword [0x40d050], eax
pop eax
push 4
push 0x40d090
call dword [0x40dd30]
mov dword [0x40d038], eax
mov dword [0x40d03c], edx
pop eax
pop edx
push 4
push 0x40d094
call dword [0x40dd30]
pop ecx
mov dword [0x40d040], eax
mov dword [0x40d044], edx
pop eax
push 4
push 0x40d098
call dword [0x40dd30]
mov dword [0x40d048], eax
mov dword [0x40d04c], edx
pop eax
pop edx
push 4
push 0x40d09c
call dword [0x40dd30]
pop ecx
mov dword [0x40d054], eax
pop eax
push 2
push 0x40d0a0
call dword [0x40dd30]
mov dword [0x40d05c], eax
pop eax
pop edx
push 2
push 0x40d0a2
call dword [0x40dd30]
pop ecx
mov dword [0x40d060], eax
pop eax
push 2
push 0x40d0a4
call dword [0x40dd30]
mov dword [0x40d064], eax
pop eax
pop edx
push 2
push 0x40d0a6
call dword [0x40dd30]
pop ecx
mov dword [0x40d068], eax
pop eax
push 2
push 0x40d0a8
call dword [0x40dd30]
mov dword [0x40d06c], eax
pop eax
pop edx
push 2
push 0x40d0aa
call dword [0x40dd30]
add esp, 0x10
mov dword [0x40d070], eax
mov eax, dword [0x40d028]
mov dword [0x40d078], eax
mov eax, dword [0x40d02c]
mov dword [0x40d07c], eax
mov eax, dword [0x40d030]
mov dword [0x40d080], eax
mov eax, dword [0x40d034]
mov dword [0x40d084], eax
jmp 0x4019ac
push ebx
push 1
push 0x30
push 0x40d0c8
call sub.msvcrt.dll_fread
add esp, 0x10
dec eax
jne 0x40166a
push ecx
push ecx
push 2
push 0x40d0c8
call dword [0x40dd30]
mov word [0x40d058], ax
pop eax
pop edx
push 2
push 0x40d0ca
call dword [0x40dd30]
pop ecx
mov word [0x40d05a], ax
pop eax
push 4
push 0x40d0cc
call dword [0x40dd30]
mov dword [0x40d050], eax
pop eax
pop edx
push 8
push 0x40d0d0
call dword [0x40dd30]
pop ecx
mov dword [0x40d038], eax
mov dword [0x40d03c], edx
pop eax
push 8
push 0x40d0d8
call dword [0x40dd30]
mov dword [0x40d040], eax
mov dword [0x40d044], edx
pop eax
pop edx
push 8
push 0x40d0e0
call dword [0x40dd30]
pop ecx
mov dword [0x40d048], eax
mov dword [0x40d04c], edx
pop eax
push 4
push 0x40d0e8
call dword [0x40dd30]
mov dword [0x40d054], eax
pop eax
pop edx
push 2
push 0x40d0ec
call dword [0x40dd30]
pop ecx
mov dword [0x40d05c], eax
pop eax
push 2
push 0x40d0ee
call dword [0x40dd30]
mov dword [0x40d060], eax
pop eax
pop edx
push 2
push 0x40d0f0
call dword [0x40dd30]
pop ecx
mov dword [0x40d064], eax
pop eax
push 2
push 0x40d0f2
call dword [0x40dd30]
mov dword [0x40d068], eax
pop eax
pop edx
push 2
push 0x40d0f4
call dword [0x40dd30]
pop ecx
mov dword [0x40d06c], eax
pop eax
push 2
push 0x40d0f6
call dword [0x40dd30]
add esp, 0x10
mov dword [0x40d070], eax
mov eax, dword [0x40d028]
mov dword [0x40d0b8], eax
mov eax, dword [0x40d02c]
mov dword [0x40d0bc], eax
mov eax, dword [0x40d030]
mov dword [0x40d0c0], eax
mov eax, dword [0x40d034]
mov dword [0x40d0c4], eax
push eax
push 0
push edi
push ebx
call fcn.00405360
add esp, 0x10
test eax, eax
jne 0x401a0c
cmp dword [0x40d028], 0x464c457f
je 0x4019e3
push eax
push eax
push esi
push str._s:_Not_an_ELF_file___wrong_magic_bytes_at_the_start_n
call fcn.004025d0
mov eax, 1
add esp, 0x10
jmp 0x40167f
mov al, byte [0x40d02e]
cmp al, 1
je 0x401a1e
and eax, 0xff
push 1
push eax
push esi
push str._s:_Unsupported_EI_VERSION:__d_is_not__d_n
call fcn.004025d0
mov eax, 1
add esp, 0x10
jmp 0x40167f
push eax
push eax
push esi
push str._s:_Failed_to_seek_to_ELF_header_n
call fcn.004025d0
add esp, 0x10
jmp 0x4019bd
mov ax, word [0x40d05a]
and eax, 0xffff
mov dword [ebp - 0x14], eax
mov eax, dword [0x40a02c]
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x14], eax
je 0x401b0c
mov dl, byte [0x40d02c]
mov al, dl
mov byte [ebp - 0x19], dl
and eax, 0xff
mov edi, eax
cmp dword [0x40a028], 0xffffffff
je 0x401b47
mov eax, dword [0x40a028]
cmp eax, 3
je 0x401a84
cmp edi, eax
je 0x401a84
push eax
push edi
push esi
push str._s:_Unmatched_input_EI_CLASS:__d_is_not__d_n
call fcn.004025d0
mov eax, 1
add esp, 0x10
jmp 0x40167f
mov eax, dword [0x40a030]
cmp eax, 3
je 0x401aac
cmp edi, eax
je 0x401aac
push eax
push edi
push esi
push str._s:_Unmatched_output_EI_CLASS:__d_is_not__d_n
call fcn.004025d0
mov eax, 1
add esp, 0x10
jmp 0x40167f
mov eax, dword [0x40a024]
cmp eax, 0xffffffff
je 0x401ad8
cmp dword [ebp - 0x14], eax
je 0x401ad8
push eax
mov eax, dword [ebp - 0x14]
push eax
push esi
push str._s:_Unmatched_e_machine:__d_is_not__d_n
call fcn.004025d0
mov eax, 1
add esp, 0x10
jmp 0x40167f
mov eax, dword [0x40a034]
mov edx, dword [0x40d058]
cmp eax, 0xffffffff
je 0x401b13
and edx, 0xffff
cmp edx, eax
je 0x401b13
push eax
push edx
push esi
push str._s:_Unmatched_e_type:__d_is_not__d_n
call fcn.004025d0
mov eax, 1
add esp, 0x10
jmp 0x40167f
xor eax, eax
jmp 0x40167f
mov eax, dword [0x40a03c]
mov dl, byte [0x40d02f]
cmp eax, 0xffffffff
je 0x401b59
and edx, 0xff
cmp edx, eax
je 0x401b59
push eax
push edx
push esi
push str._s:_Unmatched_EI_OSABI:__d_is_not__d_n
call fcn.004025d0
mov eax, 1
add esp, 0x10
jmp 0x40167f
mov eax, dword [ebp - 0x14]
call fcn.004013a0
mov dword [0x40a028], eax
jmp 0x401a5c
cmp byte [ebp - 0x19], 1
je 0x401b6e
cmp byte [ebp - 0x19], 2
je 0x401c12
call sub.msvcrt.dll_abort
cmp dword [ebp - 0x18], 0xffffffff
je 0x401b8e
mov eax, dword [ebp - 0x18]
push 2
mov edx, eax
sar edx, 0x1f
push edx
push eax
push 0x40d08a
call dword [0x40dd40]
add esp, 0x10
mov eax, dword [0x40a038]
cmp eax, 0xffffffff
je 0x401baf
mov edx, eax
push 2
sar edx, 0x1f
push edx
push eax
push 0x40d088
call dword [0x40dd40]
add esp, 0x10
mov eax, dword [0x40a040]
cmp eax, 0xffffffff
je 0x401bbe
mov byte [0x40d07f], al
push ebx
push 1
push 0x34
push 0x40d078
call fcn.00405140
add esp, 0x10
dec eax
sete al
xor ebx, ebx
mov bl, al
cmp ebx, 1
je 0x401b0c
call sub.msvcrt.dll__errno
sub esp, 0xc
mov eax, dword [eax]
push eax
call sub.msvcrt.dll_strerror
add esp, 0xc
push eax
push esi
push str._s:_Failed_to_update_ELF_header:__s_n
call fcn.004025d0
add esp, 0x10
test ebx, ebx
sete al
and eax, 0xff
jmp 0x40167f
cmp dword [ebp - 0x18], 0xffffffff
je 0x401c32
mov eax, dword [ebp - 0x18]
push 2
mov edx, eax
sar edx, 0x1f
push edx
push eax
push 0x40d0ca
call dword [0x40dd40]
add esp, 0x10
mov eax, dword [0x40a038]
cmp eax, 0xffffffff
je 0x401c53
mov edx, eax
push 2
sar edx, 0x1f
push edx
push eax
push 0x40d0c8
call dword [0x40dd40]
add esp, 0x10
mov eax, dword [0x40a040]
cmp eax, 0xffffffff
je 0x401c62
mov byte [0x40d0bf], al
push ebx
push 1
push 0x40
push 0x40d0b8
jmp 0x401bc8