Function at 0x40f13d
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x8078
call fcn.00597828
sub esp, eax
mov dword [ebp - 0x40], 0
mov eax, dword [ebp + 0x10]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x44], 0
mov dword [esp + 8], 0
mov eax, dword [ebp + 0x10]
mov dword [esp + 4], eax
mov eax, dword [ebp + 0xc]
mov dword [esp], eax
call fcn.004086a1
mov dword [ebp - 0x20], eax
mov dword [ebp - 0xc], 0
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x10], 0xffffffff
mov dword [ebp - 0x14], 0xffffffff
mov eax, dword [ebp - 0x1c]
mov edx, eax
shr edx, 0x18
mov eax, dword [ebp - 0x1c]
and eax, 0xff0000
shr eax, 8
or edx, eax
mov eax, dword [ebp - 0x1c]
and eax, 0xff00
shl eax, 8
or edx, eax
mov eax, dword [ebp - 0x1c]
shl eax, 0x18
or eax, edx
mov dword [ebp - 0x40], eax
lea eax, [ebp - 0x44]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 4
lea eax, [ebp - 0x40]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.004202db
mov word [ebp - 0x26], ax
cmp word [ebp - 0x26], 0
jne 0x40f685
mov eax, dword [ebp - 0x44]
cmp eax, 4
je 0x40f211
mov word [ebp - 0x26], 0xfffd
jmp 0x40f692
lea eax, [ebp - 0x44]
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x1c]
mov dword [esp + 8], eax
mov eax, dword [ebp + 0x10]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.004202db
mov word [ebp - 0x26], ax
cmp word [ebp - 0x26], 0
jne 0x40f688
mov eax, dword [ebp - 0x44]
cmp eax, dword [ebp - 0x1c]
je 0x40f253
mov word [ebp - 0x26], 0xfffd
jmp 0x40f692
lea eax, [ebp - 0x8068]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
call sub.msvcrt.dll__stat
test eax, eax
jns 0x40f2ad
call sub.msvcrt.dll__errno
mov eax, dword [eax]
cmp eax, 2
je 0x40f29e
call sub.msvcrt.dll__errno
mov eax, dword [eax]
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x20]
mov dword [esp + 8], eax
mov dword [esp + 4], str.mb2_handle_send_file
mov dword [esp], str._s:_stat_failed_on__s:__d_n
call sub.msvcrt.dll_printf
call sub.msvcrt.dll__errno
mov eax, dword [eax]
mov dword [ebp - 0x10], eax
jmp 0x40f4e5
mov eax, dword [ebp - 0x8054]
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x2c]
cdq
mov dword [esp], eax
mov dword [esp + 4], edx
call fcn.0040e1b0
mov dword [ebp - 0x30], eax
mov eax, dword [0x6f6080]
cmp eax, 1
jle 0x40f2ed
mov eax, dword [ebp - 0x30]
mov dword [esp + 8], eax
mov eax, dword [ebp + 0x10]
mov dword [esp + 4], eax
mov dword [esp], str.Sending__s___s__n
call sub.msvcrt.dll_printf
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
call fcn.005a0e48
cmp dword [ebp - 0x2c], 0
jne 0x40f30a
mov dword [ebp - 0x10], 0
jmp 0x40f4e5
mov dword [esp + 4], 0x673a6b
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
call sub.msvcrt.dll_fopen
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
jne 0x40f35b
call sub.msvcrt.dll__errno
mov eax, dword [eax]
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x20]
mov dword [esp + 8], eax
mov dword [esp + 4], str.mb2_handle_send_file
mov dword [esp], str._s:_Error_opening_local_file__s:__d_n
call sub.msvcrt.dll_printf
call sub.msvcrt.dll__errno
mov eax, dword [eax]
mov dword [ebp - 0x10], eax
jmp 0x40f4e5
mov dword [ebp - 0x18], 0
mov eax, dword [ebp - 0x18]
mov edx, dword [ebp - 0x2c]
mov ecx, edx
sub ecx, eax
mov eax, ecx
cmp eax, 0x7fff
jg 0x40f383
mov edx, dword [ebp - 0x2c]
mov eax, dword [ebp - 0x18]
mov ecx, edx
sub ecx, eax
mov eax, ecx
jmp 0x40f388
mov eax, 0x8000
mov dword [ebp - 0x34], eax
mov eax, dword [ebp - 0x34]
inc eax
mov edx, eax
shr edx, 0x18
mov eax, dword [ebp - 0x34]
inc eax
and eax, 0xff0000
shr eax, 8
or edx, eax
mov eax, dword [ebp - 0x34]
inc eax
and eax, 0xff00
shl eax, 8
or edx, eax
mov eax, dword [ebp - 0x34]
inc eax
shl eax, 0x18
or eax, edx
mov dword [ebp - 0x40], eax
mov eax, dword [ebp - 0x40]
mov dword [ebp - 0x8044], eax
mov byte [ebp - 0x8040], 0xc
lea eax, [ebp - 0x44]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 5
lea eax, [ebp - 0x8044]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.004202db
mov word [ebp - 0x26], ax
cmp word [ebp - 0x26], 0
jne 0x40f68b
mov eax, dword [ebp - 0x44]
cmp eax, 5
jne 0x40f68e
mov eax, dword [ebp - 0xc]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x8000
mov dword [esp + 4], 1
lea eax, [ebp - 0x8044]
mov dword [esp], eax
call sub.msvcrt.dll_fread
mov dword [ebp - 0x38], eax
cmp dword [ebp - 0x38], 0
jne 0x40f45c
mov dword [esp + 4], str.mb2_handle_send_file
mov dword [esp], str._s:_read_error_n
call sub.msvcrt.dll_printf
call sub.msvcrt.dll__errno
mov eax, dword [eax]
mov dword [ebp - 0x10], eax
jmp 0x40f4e5
lea eax, [ebp - 0x44]
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x38]
mov dword [esp + 8], eax
lea eax, [ebp - 0x8044]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.004202db
mov word [ebp - 0x26], ax
cmp word [ebp - 0x26], 0
jne 0x40f691
mov eax, dword [ebp - 0x44]
cmp eax, dword [ebp - 0x38]
je 0x40f4b5
mov edx, dword [ebp - 0x38]
mov eax, dword [ebp - 0x44]
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov dword [esp], str.Error:_sent_only__d_of__d_bytes_n
call sub.msvcrt.dll_printf
jmp 0x40f692
mov edx, dword [ebp - 0x18]
mov eax, dword [ebp - 0x38]
add eax, edx
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x18]
cmp eax, dword [ebp - 0x2c]
jl 0x40f362
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
call fcn.005a0ec8
mov dword [ebp - 0xc], 0
mov dword [ebp - 0x10], 0
cmp dword [ebp - 0x10], 0
jne 0x40f55f
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x40], 1
mov eax, dword [ebp - 0x40]
mov edx, eax
shr edx, 0x18
mov eax, dword [ebp - 0x40]
and eax, 0xff0000
shr eax, 8
or edx, eax
mov eax, dword [ebp - 0x40]
and eax, 0xff00
shl eax, 8
or edx, eax
mov eax, dword [ebp - 0x40]
shl eax, 0x18
or eax, edx
mov dword [ebp - 0x40], eax
mov eax, dword [ebp - 0x40]
mov dword [ebp - 0x8044], eax
mov byte [ebp - 0x8040], 0
lea eax, [ebp - 0x44]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 5
lea eax, [ebp - 0x8044]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.004202db
jmp 0x40f692
mov eax, dword [ebp + 0x14]
mov eax, dword [eax]
test eax, eax
jne 0x40f572
call fcn.004222a4
mov edx, dword [ebp + 0x14]
mov dword [edx], eax
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call sub.msvcrt.dll_strerror
mov dword [ebp - 0x3c], eax
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call fcn.0040f0ed
mov edx, dword [ebp + 0x14]
mov edx, dword [edx]
mov ecx, dword [ebp - 0x3c]
mov dword [esp + 0xc], ecx
mov dword [esp + 8], eax
mov eax, dword [ebp + 0x10]
mov dword [esp + 4], eax
mov dword [esp], edx
call fcn.0040f072
mov eax, dword [ebp - 0x3c]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
mov dword [ebp - 0x34], eax
mov eax, dword [ebp - 0x34]
inc eax
mov edx, eax
shr edx, 0x18
mov eax, dword [ebp - 0x34]
inc eax
and eax, 0xff0000
shr eax, 8
or edx, eax
mov eax, dword [ebp - 0x34]
inc eax
and eax, 0xff00
shl eax, 8
or edx, eax
mov eax, dword [ebp - 0x34]
inc eax
shl eax, 0x18
or eax, edx
mov dword [ebp - 0x40], eax
mov eax, dword [ebp - 0x40]
mov dword [ebp - 0x8044], eax
mov byte [ebp - 0x8040], 6
mov dword [ebp - 0x24], 5
lea edx, [ebp - 0x8044]
mov eax, dword [ebp - 0x24]
add edx, eax
mov eax, dword [ebp - 0x34]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x3c]
mov dword [esp + 4], eax
mov dword [esp], edx
call sub.msvcrt.dll_memcpy
mov eax, dword [ebp - 0x34]
add dword [ebp - 0x24], eax
lea eax, [ebp - 0x44]
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x24]
mov dword [esp + 8], eax
lea eax, [ebp - 0x8044]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.004202db
mov word [ebp - 0x26], ax
cmp word [ebp - 0x26], 0
je 0x40f661
mov dword [esp], str.could_not_send_message
call sub.msvcrt.dll_puts
mov eax, dword [ebp - 0x44]
cmp eax, dword [ebp - 0x24]
je 0x40f692
mov eax, dword [ebp - 0x44]
mov edx, dword [ebp - 0x24]
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov dword [esp], str.could_only_send__d_from__d_n
call sub.msvcrt.dll_printf
jmp 0x40f692
nop
jmp 0x40f692
nop
jmp 0x40f692
nop
jmp 0x40f692
nop
jmp 0x40f692
nop
cmp dword [ebp - 0xc], 0
je 0x40f6a3
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
call fcn.005a0ec8
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
call fcn.005a0e48
mov eax, dword [ebp - 0x14]
leave
ret