Function at 0x40edc5
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x8078
call fcn.005965d8
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.0040870d
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.0041f07b
mov word [ebp - 0x26], ax
cmp word [ebp - 0x26], 0
jne 0x40f30d
mov eax, dword [ebp - 0x44]
cmp eax, 4
je 0x40ee99
mov word [ebp - 0x26], 0xfffd
jmp 0x40f31a
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.0041f07b
mov word [ebp - 0x26], ax
cmp word [ebp - 0x26], 0
jne 0x40f310
mov eax, dword [ebp - 0x44]
cmp eax, dword [ebp - 0x1c]
je 0x40eedb
mov word [ebp - 0x26], 0xfffd
jmp 0x40f31a
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 0x40ef35
call sub.msvcrt.dll__errno
mov eax, dword [eax]
cmp eax, 2
je 0x40ef26
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 0x40f16d
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.0040de38
mov dword [ebp - 0x30], eax
mov eax, dword [0x6d9080]
cmp eax, 1
jle 0x40ef75
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.0059fbf8
cmp dword [ebp - 0x2c], 0
jne 0x40ef92
mov dword [ebp - 0x10], 0
jmp 0x40f16d
mov dword [esp + 4], 0x65714b
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 0x40efe3
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 0x40f16d
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 0x40f00b
mov edx, dword [ebp - 0x2c]
mov eax, dword [ebp - 0x18]
mov ecx, edx
sub ecx, eax
mov eax, ecx
jmp 0x40f010
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.0041f07b
mov word [ebp - 0x26], ax
cmp word [ebp - 0x26], 0
jne 0x40f313
mov eax, dword [ebp - 0x44]
cmp eax, 5
jne 0x40f316
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 0x40f0e4
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 0x40f16d
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.0041f07b
mov word [ebp - 0x26], ax
cmp word [ebp - 0x26], 0
jne 0x40f319
mov eax, dword [ebp - 0x44]
cmp eax, dword [ebp - 0x38]
je 0x40f13d
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 0x40f31a
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 0x40efea
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
call fcn.0059fc68
mov dword [ebp - 0xc], 0
mov dword [ebp - 0x10], 0
cmp dword [ebp - 0x10], 0
jne 0x40f1e7
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.0041f07b
jmp 0x40f31a
mov eax, dword [ebp + 0x14]
mov eax, dword [eax]
test eax, eax
jne 0x40f1fa
call fcn.00421044
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.0040ed75
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.0040ecfa
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.0041f07b
mov word [ebp - 0x26], ax
cmp word [ebp - 0x26], 0
je 0x40f2e9
mov dword [esp], str.could_not_send_message
call sub.msvcrt.dll_puts
mov eax, dword [ebp - 0x44]
cmp eax, dword [ebp - 0x24]
je 0x40f31a
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 0x40f31a
nop
jmp 0x40f31a
nop
jmp 0x40f31a
nop
jmp 0x40f31a
nop
jmp 0x40f31a
nop
cmp dword [ebp - 0xc], 0
je 0x40f32b
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
call fcn.0059fc68
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
call fcn.0059fbf8
mov eax, dword [ebp - 0x14]
leave
ret