Function at 0x407240
Capabilities:
Connect socket
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2d8
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x24], eax
mov ecx, dword [ebp + 0x14]
mov dword [ebp - 0xc], ecx
mov edx, dword [ebp + 0x20]
push edx
mov eax, dword [ebp + 8]
push eax
call fcn.004068d0
add esp, 8
mov dword [ebp - 0x14], eax
mov ecx, dword [ebp - 0x14]
push ecx
call fcn.00407220
add esp, 4
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x18], 0
mov edx, dword [ebp + 8]
cmp dword [edx + 0x1c8], 0
jl 0x4072ff
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x1cc]
and ecx, 1
test ecx, ecx
je 0x4072ff
mov dword [ebp - 0x40], 0x80
lea edx, [ebp - 0x40]
push edx
lea eax, [ebp - 0xc0]
push eax
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x1c8]
push edx
call dword [sym.imp.WS2_32.dll_getpeername]
test eax, eax
jl 0x4072de
mov eax, dword [ebp - 0x14]
push eax
lea ecx, [ebp - 0xc0]
push ecx
call fcn.004071a0
add esp, 8
test eax, eax
jne 0x4072ff
mov edx, dword [ebp + 8]
push edx
call fcn.00406580
add esp, 4
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x1cc]
and ecx, 0xfffffffe
mov edx, dword [ebp + 8]
mov dword [edx + 0x1cc], ecx
mov eax, dword [ebp + 8]
cmp dword [eax + 0x1c8], 0
jl 0x40731f
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x1cc]
and edx, 1
test edx, edx
jne 0x4073ea
mov eax, dword [ebp + 8]
cmp dword [eax + 0x1c8], 0
jl 0x407337
mov ecx, dword [ebp + 8]
push ecx
call fcn.00406580
add esp, 4
push 0
push 1
mov edx, dword [ebp - 0x14]
xor eax, eax
mov ax, word [edx]
push eax
call dword [sym.imp.WS2_32.dll_socket]
mov ecx, dword [ebp + 8]
mov dword [ecx + 0x1c8], eax
mov edx, dword [ebp + 8]
cmp dword [edx + 0x1c8], 0xffffffff
jne 0x407375
mov eax, dword [ebp + 8]
push eax
call fcn.00406580
add esp, 4
mov dword [0x411d88], 0x2736
mov ecx, dword [ebp + 8]
cmp dword [ecx + 0x1c8], 0
jge 0x407393
mov edx, dword [ebp + 0x1c]
mov eax, dword [0x411d88]
mov dword [edx], eax
or eax, 0xffffffff
jmp 0x4076a1
mov dword [0x411d88], 0
mov ecx, dword [ebp - 0x1c]
push ecx
mov edx, dword [ebp - 0x14]
push edx
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x1c8]
push ecx
call dword [sym.imp.WS2_32.dll_connect]
test eax, eax
jge 0x4073d6
mov edx, dword [ebp + 0x1c]
mov eax, dword [0x411d88]
mov dword [edx], eax
mov ecx, dword [ebp + 8]
push ecx
call fcn.00406580
add esp, 4
xor eax, eax
jmp 0x4076a1
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x1cc]
or al, 1
mov ecx, dword [ebp + 8]
mov dword [ecx + 0x1cc], eax
lea edx, [ebp - 0x28]
push edx
mov ax, word [ebp + 0x10]
push eax
call fcn.00405f10
add esp, 8
push 2
lea ecx, [ebp - 0x28]
push ecx
call fcn.00406620
add esp, 8
mov dword [ebp - 0x2cc], eax
mov dword [ebp - 0x2c8], edx
mov edx, dword [ebp - 0x2cc]
mov dword [ebp - 0x38], edx
mov eax, dword [ebp - 0x2c8]
mov dword [ebp - 0x34], eax
mov ecx, dword [ebp + 0xc]
mov dword [ebp - 0xc4], ecx
mov edx, dword [ebp - 0xc4]
mov dword [ebp - 0x10], edx
xor eax, eax
test eax, eax
jne 0x407427
mov ecx, dword [ebp + 0x10]
push ecx
mov edx, dword [ebp - 0x10]
push edx
call fcn.00406620
add esp, 8
mov dword [ebp - 0x2d4], eax
mov dword [ebp - 0x2d0], edx
mov eax, dword [ebp - 0x2d4]
mov dword [ebp - 0x30], eax
mov ecx, dword [ebp - 0x2d0]
mov dword [ebp - 0x2c], ecx
push 2
lea edx, [ebp - 0x38]
push edx
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x1c8]
push ecx
call fcn.00408520
add esp, 0xc
mov edx, dword [ebp + 0x10]
add edx, 2
cmp eax, edx
je 0x4074ad
mov eax, dword [ebp + 0x1c]
mov ecx, dword [0x411d88]
mov dword [eax], ecx
mov edx, dword [ebp + 8]
push edx
call fcn.00406580
add esp, 4
xor eax, eax
jmp 0x4076a1
mov eax, dword [ebp + 0x14]
mov dword [ebp - 4], eax
mov dword [ebp - 0x28], 2
mov ecx, dword [ebp - 0x28]
push ecx
mov edx, dword [ebp - 4]
push edx
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x1c8]
push ecx
call sub.MSVCRT.dll__read
add esp, 0xc
mov dword [ebp - 0x3c], eax
cmp dword [ebp - 0x3c], 0
jle 0x4074f9
mov edx, dword [ebp - 4]
add edx, dword [ebp - 0x3c]
mov dword [ebp - 4], edx
mov eax, dword [ebp - 0x28]
sub eax, dword [ebp - 0x3c]
mov dword [ebp - 0x28], eax
cmp dword [ebp - 0x28], 0
jg 0x4074f7
jmp 0x4074f9
jmp 0x4074ba
cmp dword [ebp - 0x3c], 0
jg 0x407552
mov ecx, dword [ebp + 0x1c]
mov edx, dword [0x411d88]
mov dword [ecx], edx
mov eax, dword [ebp + 8]
push eax
call fcn.00406580
add esp, 4
mov ecx, dword [ebp + 0x1c]
cmp dword [ecx], 0x2746
jne 0x40753f
cmp dword [ebp - 0x20], 0
jne 0x40753f
mov dword [ebp - 0x20], 1
mov edx, dword [ebp + 8]
push edx
call fcn.00406580
add esp, 4
jmp 0x40727e
mov eax, dword [ebp + 8]
push eax
call fcn.00406580
add esp, 4
xor eax, eax
jmp 0x4076a1
mov ecx, dword [ebp + 0x14]
push ecx
call fcn.00407d60
add esp, 4
mov dword [ebp - 8], eax
mov edx, dword [ebp - 8]
cmp edx, dword [ebp + 0x18]
jle 0x407578
mov dword [ebp - 0x18], 1
mov eax, dword [ebp + 0x18]
mov dword [ebp - 0x28], eax
jmp 0x40757e
mov ecx, dword [ebp - 8]
mov dword [ebp - 0x28], ecx
cmp dword [ebp - 0x28], 0xc
jge 0x4075a0
mov edx, dword [ebp + 0x1c]
mov dword [edx], 0x2738
mov eax, dword [ebp + 8]
push eax
call fcn.00406580
add esp, 4
xor eax, eax
jmp 0x4076a1
mov ecx, dword [ebp + 0x14]
mov dword [ebp - 4], ecx
cmp dword [ebp - 0x28], 0
je 0x4075e3
mov edx, dword [ebp - 0x28]
push edx
mov eax, dword [ebp - 4]
push eax
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x1c8]
push edx
call sub.MSVCRT.dll__read
add esp, 0xc
mov dword [ebp - 0x3c], eax
cmp dword [ebp - 0x3c], 0
jle 0x4075e3
mov eax, dword [ebp - 4]
add eax, dword [ebp - 0x3c]
mov dword [ebp - 4], eax
mov ecx, dword [ebp - 0x28]
sub ecx, dword [ebp - 0x3c]
mov dword [ebp - 0x28], ecx
jmp 0x4075a6
cmp dword [ebp - 0x3c], 0
jg 0x407606
mov edx, dword [ebp + 0x1c]
mov eax, dword [0x411d88]
mov dword [edx], eax
mov ecx, dword [ebp + 8]
push ecx
call fcn.00406580
add esp, 4
xor eax, eax
jmp 0x4076a1
cmp dword [ebp - 0x18], 0
je 0x407680
mov edx, dword [ebp - 0xc]
mov eax, dword [edx]
or eax, 0x20000
mov ecx, dword [ebp - 0xc]
mov dword [ecx], eax
mov edx, dword [ebp - 8]
sub edx, dword [ebp + 0x18]
mov dword [ebp - 0x28], edx
cmp dword [ebp - 0x28], 0
je 0x407680
cmp dword [ebp - 0x28], 0x200
jbe 0x40763f
mov dword [ebp - 0x2d8], 0x200
jmp 0x407648
mov eax, dword [ebp - 0x28]
mov dword [ebp - 0x2d8], eax
mov ecx, dword [ebp - 0x2d8]
push ecx
lea edx, [ebp - 0x2c4]
push edx
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x1c8]
push ecx
call sub.MSVCRT.dll__read
add esp, 0xc
mov dword [ebp - 0x3c], eax
cmp dword [ebp - 0x3c], 0
jle 0x40767c
mov edx, dword [ebp - 0x28]
sub edx, dword [ebp - 0x3c]
mov dword [ebp - 0x28], edx
jmp 0x40767e
jmp 0x407680
jmp 0x407624
mov eax, dword [ebp - 0x24]
mov ecx, dword [eax]
and ecx, 0xffff
mov edx, dword [ebp - 0xc]
mov eax, dword [edx]
and eax, 0xffff
cmp ecx, eax
je 0x40769e
jmp 0x4074ad
mov eax, dword [ebp - 8]
mov esp, ebp
pop ebp
ret