Function at 0x4024e0
Capabilities:
Read file on windows
Terminate process
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x8c
mov eax, dword [ebp + 8]
mov dword [ebp - 0x64], method.std::string.append_std::string_const_
mov dword [ebp - 0x60], method.std::string.append_std::string_const_
cmp eax, 2
jle 0x402b70
sub eax, 3
mov ebx, 2
and eax, 0xfffffffe
add eax, 4
mov dword [ebp - 0x6c], eax
jmp 0x402556
cmp byte [eax + 1], 0x69
jne 0x402564
cmp byte [eax + 2], 0
jne 0x402564
mov eax, dword [ebp + 0xc]
mov esi, dword [eax + ebx*4 + 4]
mov dword [esp], esi
call sub.cygwin1.dll_strlen
mov dword [esp + 4], esi
mov dword [esp + 8], eax
lea eax, [ebp - 0x64]
mov dword [esp], eax
call fcn.004011b0
add ebx, 2
cmp ebx, dword [ebp - 0x6c]
je 0x4025c3
mov eax, dword [ebp + 0xc]
mov eax, dword [eax + ebx*4]
movzx edx, byte [eax]
cmp edx, 0x2d
je 0x402520
mov ecx, 8
mov edi, str.__input
mov esi, eax
repe cmpsb byte [esi], byte es:[edi]
seta cl
sbb cl, 0
test cl, cl
je 0x40252c
cmp edx, 0x2d
jne 0x402660
cmp byte [eax + 1], 0x6f
jne 0x402660
cmp byte [eax + 2], 0
jne 0x402660
mov eax, dword [ebp + 0xc]
mov esi, dword [eax + ebx*4 + 4]
mov dword [esp], esi
call sub.cygwin1.dll_strlen
mov dword [esp + 4], esi
mov dword [esp + 8], eax
lea eax, [ebp - 0x60]
mov dword [esp], eax
call fcn.004011b0
add ebx, 2
cmp ebx, dword [ebp - 0x6c]
jne 0x402556
mov eax, dword [ebp - 0x64]
mov ecx, dword [eax - 0xc]
test ecx, ecx
je 0x402c36
mov edx, dword [ebp - 0x60]
mov edx, dword [edx - 0xc]
test edx, edx
je 0x402c47
mov dword [esp + 4], 0x40534d
mov dword [esp], eax
mov dword [ebp - 0x5c], method.std::string.append_std::string_const_
call sub.cygwin1.dll__fopen64
mov edi, eax
test eax, eax
je 0x402a20
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], edi
call sub.cygwin1.dll_fseek
lea eax, [ebp - 0x4c]
mov dword [esp + 0xc], edi
mov dword [esp + 8], 1
mov dword [esp + 4], 0x34
mov dword [esp], eax
call sub.cygwin1.dll_fread
mov eax, dword [ebp - 0x4c]
cmp dword [0x4055a8], eax
je 0x402680
mov dword [esp], str.ELF_magic_not_found....EXIT
call sub.cygwin1.dll_printf
mov dword [esp], 1
call sub.cygwin1.dll_exit
lea esi, [esi]
mov esi, eax
mov edi, str.__output
mov ecx, 9
repe cmpsb byte [esi], byte es:[edi]
seta al
sbb al, 0
test al, al
jne 0x40254e
jmp 0x402599
mov eax, dword [ebp - 0x48]
cmp dword [0x4055ac], eax
jne 0x402642
movzx eax, word [ebp - 0x20]
mov dword [esp], str.Found__i_parts_in_elf_image_n
mov dword [ebp - 0x70], 0
mov dword [esp + 4], eax
mov dword [ebp - 0x78], eax
call sub.cygwin1.dll_printf
mov edx, dword [ebp - 0x78]
mov eax, edx
shl eax, 5
call fcn.004011e8
xor ebx, ebx
sub esp, eax
lea eax, [esp + 0x10]
mov dword [ebp - 0x6c], eax
mov esi, eax
test edx, edx
je 0x402713
lea esi, [esi]
nop
mov eax, ebx
mov dword [esp + 8], 0
shl eax, 5
mov dword [esp], edi
add eax, 0x34
mov dword [esp + 4], eax
call sub.cygwin1.dll_fseek
mov dword [esp + 0xc], edi
mov dword [esp + 8], 1
mov dword [esp + 4], 0x20
mov dword [esp], esi
call sub.cygwin1.dll_fread
add ebx, 1
add esi, 0x20
cmp dword [ebp - 0x78], ebx
jne 0x4026d0
mov dword [esp], str.Writing_header....
call sub.cygwin1.dll_puts
mov dword [esp], 0x1000
call sub.cygwin1.dll_malloc
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov ebx, eax
mov dword [esp], edi
call sub.cygwin1.dll_fseek
mov dword [esp + 0xc], edi
mov dword [esp + 8], 1
mov dword [esp + 4], 0x1000
mov dword [esp], ebx
call sub.cygwin1.dll_fread
lea eax, [ebp - 0x60]
mov dword [esp + 4], eax
lea eax, [ebp - 0x50]
mov dword [esp], eax
call fcn.004011a0
lea eax, [ebp - 0x50]
mov dword [esp + 8], 7
mov dword [esp + 4], str._header
mov dword [esp], eax
call fcn.004011c0
lea eax, [ebp - 0x50]
mov dword [esp + 4], eax
lea eax, [ebp - 0x5c]
mov dword [esp], eax
call fcn.004011c8
mov eax, dword [ebp - 0x50]
lea edx, [eax - 0xc]
cmp eax, method.std::string.append_std::string_const_
jne 0x402c10
mov eax, dword [ebp - 0x5c]
mov dword [esp + 4], 0x4054ec
mov dword [esp], eax
call sub.cygwin1.dll__fopen64
mov dword [esp + 0xc], eax
mov esi, eax
mov dword [esp + 8], 1
mov dword [esp + 4], 0x1000
mov dword [esp], ebx
call sub.cygwin1.dll_fwrite
mov dword [esp], esi
call sub.cygwin1.dll_fclose
mov dword [esp], ebx
call sub.cygwin1.dll_free
mov dword [esp], str.Done...
call sub.cygwin1.dll_puts
mov eax, dword [ebp - 0x6c]
add eax, 4
mov dword [ebp - 0x7c], eax
mov eax, dword [ebp - 0x78]
test eax, eax
jne 0x40299c
jmp 0x402a90
cmp ebx, 0x1000000
jne 0x402843
lea eax, [ebp - 0x58]
mov dword [esp + 8], 3
mov dword [esp + 4], 0x4050c6
mov dword [esp], eax
call fcn.004011b0
lea eax, [ebp - 0x58]
mov dword [esp + 8], 7
mov dword [esp + 4], str.ramdisk
mov dword [esp], eax
call fcn.004011b0
lea eax, [ebp - 0x60]
mov dword [esp + 4], eax
lea eax, [ebp - 0x54]
mov dword [esp], eax
call fcn.004011a0
lea eax, [ebp - 0x54]
mov dword [esp + 8], 1
mov dword [esp + 4], 0x40551a
mov dword [esp], eax
call fcn.004011c0
lea eax, [ebp - 0x58]
mov dword [esp + 4], eax
lea eax, [ebp - 0x54]
mov dword [esp], eax
call fcn.004011b8
mov edx, dword [eax]
mov dword [ebp - 0x50], edx
mov dword [eax], method.std::string.append_std::string_const_
lea eax, [ebp - 0x50]
mov dword [esp + 4], eax
lea eax, [ebp - 0x5c]
mov dword [esp], eax
call fcn.004011c8
mov eax, dword [ebp - 0x50]
lea edx, [eax - 0xc]
cmp eax, method.std::string.append_std::string_const_
jne 0x402ad8
mov eax, dword [ebp - 0x54]
lea edx, [eax - 0xc]
cmp eax, method.std::string.append_std::string_const_
jne 0x402b10
mov eax, dword [ebp - 0x6c]
mov dword [esp + 0xc], esi
mov dword [esp], str._s_found_at_offset__i_with_size__i_n
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x58]
mov dword [esp + 4], eax
call sub.cygwin1.dll_printf
mov eax, dword [ebp - 0x5c]
mov dword [esp + 4], 0x4054ec
mov dword [esp], eax
call sub.cygwin1.dll__fopen64
mov dword [esp], esi
mov dword [ebp - 0x74], eax
call sub.cygwin1.dll_malloc
mov edx, dword [ebp - 0x6c]
mov dword [esp + 8], 0
mov dword [esp], edi
mov ebx, eax
mov dword [esp + 4], edx
call sub.cygwin1.dll_fseek
mov dword [esp + 0xc], edi
mov dword [esp + 8], 1
mov dword [esp + 4], esi
mov dword [esp], ebx
call sub.cygwin1.dll_fread
mov eax, dword [ebp - 0x74]
mov dword [esp + 8], 1
mov dword [esp + 4], esi
mov dword [esp + 0xc], eax
mov dword [esp], ebx
call sub.cygwin1.dll_fwrite
mov eax, dword [ebp - 0x74]
mov dword [esp], eax
call sub.cygwin1.dll_fclose
mov dword [esp], ebx
call sub.cygwin1.dll_free
mov eax, dword [ebp - 0x58]
lea edx, [eax - 0xc]
cmp eax, method.std::string.append_std::string_const_
jne 0x402b40
add dword [ebp - 0x70], 1
mov eax, dword [ebp - 0x70]
add dword [ebp - 0x7c], 0x20
cmp dword [ebp - 0x78], eax
je 0x402a90
mov eax, dword [ebp - 0x7c]
mov ebx, dword [eax + 0x14]
mov ecx, dword [eax]
mov esi, dword [eax + 0x10]
mov dword [esp], str.flag_:__u_n
mov dword [esp + 4], ebx
mov dword [ebp - 0x6c], ecx
call sub.cygwin1.dll_printf
mov ecx, dword [ebp - 0x6c]
mov dword [esp], str.offset_:__i_n
mov dword [esp + 4], ecx
call sub.cygwin1.dll_printf
mov dword [esp + 4], esi
mov dword [esp], str.size_:__i_n
call sub.cygwin1.dll_printf
mov dword [ebp - 0x58], method.std::string.append_std::string_const_
cmp ebx, 0x20000000
je 0x402a70
ja 0x402a40
test ebx, ebx
jne 0x402820
lea eax, [ebp - 0x58]
mov dword [esp + 8], 6
mov dword [esp + 4], str.kernel
mov dword [esp], eax
call fcn.004011b0
jmp 0x40285e
mov eax, dword [ebp - 0x64]
mov dword [esp], str.Cannot_read_input_boot_image__s....Exit
mov dword [esp + 4], eax
call sub.cygwin1.dll_printf
jmp 0x402600
cmp ebx, 0x40000000
jne 0x402843
lea eax, [ebp - 0x58]
mov dword [esp + 8], 3
mov dword [esp + 4], 0x4050a2
mov dword [esp], eax
call fcn.004011b0
jmp 0x40285e
lea eax, [ebp - 0x58]
mov dword [esp + 8], 7
mov dword [esp + 4], str.cmdline
mov dword [esp], eax
call fcn.004011b0
jmp 0x40285e
mov dword [esp], edi
call sub.cygwin1.dll_fclose
mov eax, dword [ebp - 0x5c]
lea edx, [eax - 0xc]
cmp eax, method.std::string.append_std::string_const_
jne 0x402be0
mov eax, dword [ebp - 0x60]
lea edx, [eax - 0xc]
cmp eax, method.std::string.append_std::string_const_
jne 0x402bb0
mov eax, dword [ebp - 0x64]
lea edx, [eax - 0xc]
cmp eax, method.std::string.append_std::string_const_
jne 0x402b80
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov ecx, 0xffffffff
lock xadd dword [eax - 4], ecx
test ecx, ecx
jg 0x4028cb
lea eax, [ebp - 0x65]
mov dword [esp], edx
mov dword [esp + 4], eax
call fcn.004011d0
mov eax, dword [ebp - 0x54]
lea edx, [eax - 0xc]
cmp eax, method.std::string.append_std::string_const_
je 0x4028dc
lea esi, [esi]
mov ecx, 0xffffffff
lock xadd dword [eax - 4], ecx
test ecx, ecx
jg 0x4028dc
lea eax, [ebp - 0x50]
mov dword [esp], edx
mov dword [esp + 4], eax
call fcn.004011d0
jmp 0x4028dc
mov ecx, 0xffffffff
lock xadd dword [eax - 4], ecx
test ecx, ecx
jg 0x402988
lea eax, [ebp - 0x50]
mov dword [esp], edx
mov dword [esp + 4], eax
call fcn.004011d0
jmp 0x402988
mov eax, method.std::string.append_std::string_const_
jmp 0x4025c6
mov ecx, 0xffffffff
lock xadd dword [eax - 4], ecx
test ecx, ecx
jg 0x402acb
lea eax, [ebp - 0x50]
mov dword [esp], edx
mov dword [esp + 4], eax
call fcn.004011d0
jmp 0x402acb
mov ecx, 0xffffffff
lock xadd dword [eax - 4], ecx
test ecx, ecx
jg 0x402aba
lea eax, [ebp - 0x50]
mov dword [esp], edx
mov dword [esp + 4], eax
call fcn.004011d0
jmp 0x402aba
mov ecx, 0xffffffff
lock xadd dword [eax - 4], ecx
test ecx, ecx
jg 0x402aa9
lea eax, [ebp - 0x50]
mov dword [esp], edx
mov dword [esp + 4], eax
call fcn.004011d0
jmp 0x402aa9
mov ecx, 0xffffffff
lock xadd dword [eax - 4], ecx
test ecx, ecx
jg 0x4027b1
lea eax, [ebp - 0x54]
mov dword [esp], edx
mov dword [esp + 4], eax
call fcn.004011d0
jmp 0x4027b1
mov dword [esp], str.Input_path_not_provided...Exit
call sub.cygwin1.dll_puts
call fcn.00402f70
mov dword [esp], str.Output_path_must_be_specified....Exit
call sub.cygwin1.dll_puts
call fcn.00402f70
mov ebx, eax
jmp 0x4031b3
mov eax, dword [ebp - 0x5c]
lea ecx, [eax - 0xc]
cmp eax, method.std::string.append_std::string_const_
je 0x4031ca
lea edx, [ebp - 0x54]
mov eax, ecx
call fcn.00403050
mov eax, dword [ebp - 0x60]
lea ecx, [eax - 0xc]
cmp eax, method.std::string.append_std::string_const_
je 0x4031e1
lea edx, [ebp - 0x54]
mov eax, ecx
call fcn.00403050
mov eax, dword [ebp - 0x64]
lea ecx, [eax - 0xc]
cmp eax, method.std::string.append_std::string_const_
je 0x4031f8
lea edx, [ebp - 0x54]
mov eax, ecx
call fcn.00403050
mov dword [esp], ebx
call sub.cyggcc_s_1.dll__Unwind_Resume
mov eax, dword [ebp - 0x54]
lea ecx, [eax - 0xc]
cmp eax, method.std::string.append_std::string_const_
je 0x403217
lea edx, [ebp - 0x50]
mov eax, ecx
call fcn.00403050
mov eax, dword [ebp - 0x58]
lea ecx, [eax - 0xc]
cmp eax, method.std::string.append_std::string_const_
je 0x4031b3
lea edx, [ebp - 0x50]
mov eax, ecx
call fcn.00403050
jmp 0x4031b3