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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
mov eax, dword [ebp + 8]
push ebx
add eax, 0xfffffffd
mov dword [ebp - 0x1c], 1
mov dword [ebp - 0xc], 0
push esi
push edi
cmp eax, 2
ja 0x4015ac
mov edi, dword [ebp + 0xc]
push 0x4033b4
push dword [edi + 4]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fopen]
mov ebx, eax
add esp, 8
mov dword [ebp - 0x18], ebx
test ebx, ebx
jne 0x4011c4
push dword [edi + 4]
push str.Couldnt_open_file__s._n
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.00401010
add esp, 0xc
jmp 0x401597
mov esi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fseek]
push 2
push 0
push ebx
call esi
push ebx
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_ftell]
push 0
push 0
push ebx
mov dword [ebp - 8], eax
call esi
mov esi, dword [ebp + 8]
xor edx, edx
add esp, 0x1c
mov dword [ebp - 4], edx
add edi, 0xc
cmp esi, 4
jl 0x40121b
mov ecx, dword [edi]
lea edx, [ebp - 4]
call fcn.00401070
test eax, eax
jne 0x401218
mov eax, edi
cmp esi, 5
jl 0x401218
mov ecx, dword [ebp + 0xc]
lea edx, [ebp - 4]
mov ecx, dword [ecx + 0x10]
call fcn.00401070
mov edx, dword [ebp - 4]
mov edi, dword [edi]
mov eax, edi
mov cl, byte [edi]
test cl, cl
je 0x401235
cmp cl, 0x2d
jne 0x40122d
mov byte [eax], 0x5f
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x401225
mov ecx, edi
lea esi, [ecx + 1]
nop word [eax + eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x401240
sub ecx, esi
lea eax, [ecx + edx]
mov ecx, edi
mov dword [ebp - 0x10], eax
lea esi, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x401254
sub ecx, esi
lea eax, [ecx + 5]
mov ecx, dword [ebp - 8]
add eax, edx
add ecx, 0x68
cmp dword [ebp - 0x10], 8
mov dword [ebp - 0x14], eax
mov dword [ebp + 8], ecx
jbe 0x401298
mov ecx, edi
lea esi, [ecx + 1]
nop dword [eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x401280
sub ecx, esi
lea eax, [ecx + edx]
mov ecx, dword [ebp + 8]
inc ecx
add ecx, eax
mov eax, dword [ebp - 0x14]
mov dword [ebp + 8], ecx
cmp eax, 8
jbe 0x4012b9
mov ecx, edi
lea esi, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4012a2
sub ecx, esi
lea eax, [ecx + edx]
mov ecx, dword [ebp + 8]
add ecx, 6
add ecx, eax
mov dword [ebp + 8], ecx
push 1
push ecx
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_calloc]
mov ecx, eax
add esp, 8
mov dword [ebp - 0xc], ecx
test ecx, ecx
jne 0x4012e9
push str.Couldnt_allocate_buffer._n
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.00401010
jmp 0x40158a
mov edx, dword [ebp - 8]
lea esi, [ecx + 0x14]
mov eax, 0x8664
mov dword [ebp - 0x20], 0x14c
push 8
push 0x4033f0
lea ebx, [edx + 0x40]
mov dword [ecx + 0xc], 2
add ebx, ecx
cmp dword [ebp - 4], 0
push esi
cmovne eax, dword [ebp - 0x20]
mov word [ecx], ax
mov eax, 1
mov word [ecx + 2], ax
lea eax, [edx + 0x40]
mov dword [ecx + 8], eax
mov eax, 4
mov word [ecx + 0x12], ax
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_strncpy]
mov ecx, dword [ebp - 8]
mov dword [esi + 0x14], 0x3c
mov dword [esi + 0x24], 0xc0500040
lea eax, [ecx + 4]
mov dword [esi + 0x10], eax
mov esi, dword [ebp - 0x18]
mov eax, dword [ebp - 0xc]
push esi
push ecx
add eax, 0x3c
push 1
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
add esp, 0x1c
cmp eax, dword [ebp - 8]
je 0x401391
mov eax, dword [ebp + 0xc]
push dword [eax + 4]
push str.Couldnt_read_file__s._n
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.00401010
add esp, 0xc
mov ebx, esi
jmp 0x40158d
push esi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
mov eax, dword [ebp - 0xc]
add esp, 4
mov ecx, dword [ebp - 8]
mov esi, dword [ebp - 4]
mov dword [ecx + eax + 0x3c], ecx
mov eax, dword [ebp - 0x10]
cmp eax, 8
ja 0x4013d2
mov edx, ebx
mov byte [ebx], 0x5f
sub edx, edi
mov ecx, edi
add edx, esi
nop dword [eax + eax]
mov al, byte [ecx]
lea ecx, [ecx + 1]
mov byte [edx + ecx - 1], al
test al, al
jne 0x4013c0
mov eax, dword [ebp - 0x10]
jmp 0x4013df
mov dword [ebx], 0
mov dword [ebx + 4], 4
cmp dword [ebp - 0x14], 8
mov dword [ebx + 0xc], 1
mov byte [ebx + 0x10], 2
mov dword [ebx + 8], 0
ja 0x401436
mov edx, ebx
mov byte [ebx + 0x13], 0x5f
sub edx, edi
mov ecx, edi
add edx, esi
mov al, byte [ecx]
lea ecx, [ecx + 1]
mov byte [edx + ecx + 0x11], al
test al, al
jne 0x401403
mov ecx, edi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x401415
mov eax, dword [str._size]
sub ecx, edx
add ecx, ebx
mov dword [ecx + esi + 0x12], eax
mov ax, word [0x403418]
mov word [ecx + esi + 0x16], ax
jmp 0x401461
mov dword [ebx + 0x12], 0
cmp eax, 8
ja 0x401449
mov eax, 4
jmp 0x40145e
mov ecx, edi
lea edx, [ecx + 1]
nop
mov al, byte [ecx]
inc ecx
test al, al
jne 0x401450
sub ecx, edx
lea eax, [ecx + 5]
add eax, esi
mov dword [ebx + 0x16], eax
mov edx, dword [ebp - 8]
mov eax, 4
mov dword [ebx + 0x1e], 1
mov byte [ebx + 0x22], 2
mov dword [ebx + 0x1a], edx
mov ebx, dword [ebp - 0xc]
add ebx, 0x64
add ebx, edx
cmp dword [ebp - 0x10], 8
mov dword [ebx], 4
jbe 0x4014c2
mov edx, ebx
mov byte [ebx + 4], 0x5f
sub edx, edi
mov ecx, edi
add edx, esi
mov al, byte [ecx]
lea ecx, [ecx + 1]
mov byte [edx + ecx + 3], al
test al, al
jne 0x401497
mov ecx, edi
lea edx, [ecx + 1]
nop dword [eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4014b0
sub ecx, edx
lea eax, [ecx + 1]
add eax, esi
add dword [ebx], eax
mov eax, dword [ebx]
cmp dword [ebp - 0x14], 8
jbe 0x40150b
mov byte [eax + ebx], 0x5f
mov edx, edi
mov ecx, dword [ebx]
add ecx, ebx
add ecx, esi
mov al, byte [edx]
lea edx, [edx + 1]
mov byte [ecx], al
lea ecx, [ecx + 1]
test al, al
jne 0x4014d4
lea ecx, [edi + 1]
mov al, byte [edi]
inc edi
test al, al
jne 0x4014e5
sub edi, ecx
lea eax, [edi + esi]
add dword [ebx], eax
mov ecx, dword [ebx]
mov eax, dword [str._size]
mov dword [ecx + ebx], eax
mov ax, word [0x403418]
mov word [ecx + ebx + 4], ax
add dword [ebx], 6
mov esi, dword [ebp + 0xc]
push 0x40341c
push dword [esi + 8]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fopen]
mov ebx, eax
add esp, 8
test ebx, ebx
jne 0x401543
push dword [esi + 8]
push str.Couldnt_create_file__s._n
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.00401010
add esp, 0xc
jmp 0x401597
mov edi, dword [ebp + 8]
push ebx
push edi
push 1
push dword [ebp - 0xc]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
mov ecx, dword [esi + 8]
add esp, 0x10
push ecx
cmp eax, edi
je 0x401579
push str.Couldnt_write_file__s._n
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.00401010
add esp, 0xc
jmp 0x40158d
push str.Successfully_created_COFF_object_file__s_n
call fcn.00401040
mov dword [ebp - 0x1c], 0
add esp, 8
push ebx
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
add esp, 4
push dword [ebp - 0xc]
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 4
push dword [ebp - 0x1c]
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_exit]
mov esi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
push str._nUsage:_bin2coff_bin_obj__label___64bitWin32x64__n_n
push 2
call esi
add esp, 4
push eax
call fcn.00401010
add esp, 8
push str.__bin__:_source_binary_data_n
push 2
call esi
add esp, 4
push eax
call fcn.00401010
add esp, 8
push str.__obj__:_target_object_file__in_MS_COFF_format._n
push 2
call esi
add esp, 4
push eax
call fcn.00401010
add esp, 8
push str.__label:_identifier_for_the_extern_data._If_not_provided__the_name_of_the_n
push 2
call esi
add esp, 4
push eax
call fcn.00401010
add esp, 8
push str._________binary_file_without_extension_is_used._n
push 2
call esi
add esp, 4
push eax
call fcn.00401010
add esp, 8
push str.__64bit:_n__Win32:_n__x64__:_produce_a_64_bit_compatible_object___symbols_are_generated_without_n
push 2
call esi
add esp, 4
push eax
call fcn.00401010
add esp, 8
push str._________leading_underscores_and_machine_type_is_set_to_x86_x64._n_n
push 2
call esi
add esp, 4
push eax
call fcn.00401010
add esp, 8
push str.With_your_linker_set_properly__typical_access_from_a_C_source_is:_n_n
push 2
call esi
add esp, 4
push eax
call fcn.00401010
add esp, 8
push str.____extern_uint8_t__label_________binary_data___________n
push 2
call esi
add esp, 4
push eax
call fcn.00401010
add esp, 8
push str.____extern_uint32_t_label_size____size_of_binary_data___n_n
push 2
call esi
add esp, 4
push eax
call fcn.00401010
add esp, 8
push 1
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_exit]
int3