Function at 0x403440
Capabilities:
Download and write a file
Receive and write data from server to client
Receive data
Receive data on socket
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x406887
mov eax, dword fs:[0]
push eax
sub esp, 0x42c
mov eax, dword [0x40a018]
xor eax, esp
mov dword [esp + 0x428], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x40a018]
xor eax, esp
push eax
lea eax, [esp + 0x440]
mov dword fs:[0], eax
mov esi, dword [esp + 0x450]
push 1
push 3
lea ecx, [esp + 0x84]
mov dword [esp + 0x1c], esi
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_stringstream_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_int_]
lea eax, [esp + 0x84]
mov dword [esp + 0x448], 0
mov edi, dword [sym.imp.MSVCP90.dll_class_std::basic_ostream_char__struct_std::char_traits_char______cdecl_std::operator___char__struct_std::char_traits_char___class_std::allocator_char___class_std::basic_ostream_char__struct_std::char_traits_char_____class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char___const__]
push 0x40a49c
push eax
call edi
add esp, 8
lea ecx, [esp + 0x28]
push ecx
lea ecx, [esp + 0x80]
call dword [sym.imp.MSVCP90.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char_____thiscall_std::basic_stringstream_char__struct_std::char_traits_char___class_std::allocator_char__::str_void_]
add esi, 0x20
mov ebx, 0x10
mov byte [esp + 0x448], 1
cmp dword [esi + 0x18], ebx
jb 0x4034e6
mov ecx, dword [esi + 4]
jmp 0x4034e9
lea ecx, [esi + 4]
cmp dword [eax + 0x18], ebx
jb 0x4034f3
mov eax, dword [eax + 4]
jmp 0x4034f6
add eax, 4
push ecx
mov ecx, eax
call fcn.00405600
add esp, 4
lea ecx, [esp + 0x28]
mov byte [esp + 0x448], 0
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
push str..aut
lea edx, [esp + 0x88]
push esi
push edx
call edi
add esp, 8
push eax
call fcn.004030a0
add esp, 8
cmp byte [esp + 0x454], 0
mov esi, 0x4074c8
jne 0x403543
mov esi, 0x4074cc
lea eax, [esp + 0x44]
push eax
lea ecx, [esp + 0x80]
call dword [sym.imp.MSVCP90.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char_____thiscall_std::basic_stringstream_char__struct_std::char_traits_char___class_std::allocator_char__::str_void_]
cmp dword [eax + 0x18], ebx
jb 0x40355f
mov eax, dword [eax + 4]
jmp 0x403562
add eax, 4
push esi
push eax
call dword [sym.imp.MSVCR90.dll_fopen]
add esp, 8
lea ecx, [esp + 0x44]
mov esi, eax
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
test esi, esi
jne 0x4035db
lea ecx, [esp + 0x44]
push ecx
lea ecx, [esp + 0x80]
call dword [sym.imp.MSVCP90.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char_____thiscall_std::basic_stringstream_char__struct_std::char_traits_char___class_std::allocator_char__::str_void_]
cmp dword [eax + 0x18], ebx
jb 0x403599
mov eax, dword [eax + 4]
jmp 0x40359c
add eax, 4
push eax
push str.cannt_open_file__s_for_write_n
call dword [sym.imp.MSVCR90.dll___iob_func]
add eax, 0x40
push eax
call dword [sym.imp.MSVCR90.dll_fprintf]
add esp, 0xc
lea ecx, [esp + 0x44]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
lea ecx, [esp + 0x7c]
mov dword [esp + 0x448], 0xffffffff
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_stringstream_char__struct_std::char_traits_char___class_std::allocator_char__::vbase_dtor_void_]
xor al, al
jmp 0x403980
mov edi, dword [sym.imp.MSVCR90.dll_ftell]
push esi
call edi
mov ebp, dword [sym.imp.MSVCR90.dll_fseek]
add esp, 4
push 0
push 0
push esi
mov ebx, eax
call ebp
add esp, 0xc
push esi
call edi
add esp, 4
push 2
push 0
push esi
mov dword [esp + 0x24], eax
call ebp
add esp, 0xc
push esi
call edi
add esp, 4
push 0
push ebx
push esi
mov edi, eax
call ebp
sub edi, dword [esp + 0x24]
add esp, 0xc
mov ebp, edi
mov dword [esp + 0x18], ebp
mov dword [esp + 0x234], 0xffffffff
mov dword [esp + method.KClientSocket.virtual_0], vtable.KClientSocket.0
xor eax, eax
mov byte [esp + 0x448], 2
lea ecx, [esp + 0x190]
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], eax
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], eax
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_void_]
push 1
push 3
lea ecx, [esp + 0x10c]
mov byte [esp + 0x450], 3
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_stringstream_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_int_]
mov edi, dword [esp + 0x14]
add edi, 0x3c
lea edx, [esp + 0x10c]
push edi
push edx
mov byte [esp + 0x450], 4
call dword [sym.imp.MSVCP90.dll_class_std::basic_ostream_char__struct_std::char_traits_char______cdecl_std::operator___char__struct_std::char_traits_char___class_std::allocator_char___class_std::basic_ostream_char__struct_std::char_traits_char_____class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char___const__]
mov ebx, 0x10
add esp, 8
cmp dword [edi + 0x18], ebx
jb 0x4036be
mov edi, dword [edi + 4]
jmp 0x4036c1
add edi, 4
push 0x3f
push edi
call dword [sym.imp.MSVCR90.dll_strchr]
add esp, 8
test eax, eax
je 0x4036e0
push 0x4074f0
lea eax, [esp + 0x110]
push eax
jmp 0x4036ed
push 0x4074f4
lea ecx, [esp + 0x110]
push ecx
call fcn.004030a0
mov edx, dword [0x40a48c]
add esp, 8
push edx
lea ecx, [esp + 0x110]
call dword [sym.imp.MSVCP90.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___int_]
lea eax, [esp + 0x60]
push eax
lea ecx, [esp + 0x108]
call dword [sym.imp.MSVCP90.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char_____thiscall_std::basic_stringstream_char__struct_std::char_traits_char___class_std::allocator_char__::str_void_]
cmp dword [eax + 0x18], ebx
jb 0x403725
mov eax, dword [eax + 4]
jmp 0x403728
add eax, 4
lea ecx, [esp + 0x28]
push ecx
push eax
call fcn.00403ce0
add esp, 8
test eax, eax
lea ecx, [esp + 0x60]
setne bl
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
test bl, bl
jne 0x40390d
mov ecx, dword [esp + 0x2c]
test ecx, ecx
je 0x40390d
movzx eax, word [esp + 0x30]
lea edi, [esp + 0x1ac]
call fcn.00404ca0
test al, al
je 0x40390d
mov eax, ebp
cdq
mov ebp, edx
lea edx, [esp + 0x1c]
push edx
mov edi, eax
push ebp
lea eax, [esp + 0x30]
push edi
push eax
lea ecx, [esp + 0x1a0]
lea edx, [esp + 0x1bc]
call fcn.00404280
add esp, 0x10
cmp eax, 2
jne 0x40390d
mov ecx, dword [esp + 0x14]
mov eax, dword [ecx + 0x1c]
mov ecx, dword [esp + 0x20]
xor ebx, ebx
cmp ecx, ebx
jg 0x40390d
mov edx, dword [esp + 0x1c]
jl 0x4037c7
cmp edx, eax
ja 0x40390d
test ecx, ecx
jl 0x403820
jg 0x4037d1
test edx, edx
jbe 0x403820
add edi, edx
adc ebp, ecx
cmp edi, eax
jne 0x4037dd
cmp ebp, ebx
je 0x403820
cmp dword [esp + 0x18], 0
jle 0x40390d
cmp byte [esp + 0x454], 0
jne 0x40390d
push esi
call dword [sym.imp.MSVCR90.dll_fclose]
add esp, 4
lea esi, [esp + 0x1b4]
call fcn.00401110
mov edx, dword [esp + 0x14]
push 1
push edx
call fcn.00403440
add esp, 8
jmp 0x403917
mov ecx, dword [esp + 0x234]
mov ebp, dword [sym.imp.WS2_32.dll_recv]
push 0
push 0x200
lea eax, [esp + 0x244]
push eax
push ecx
call ebp
mov edi, eax
test edi, edi
jle 0x403888
mov ebx, dword [sym.imp.MSVCR90.dll_fwrite]
jmp 0x403850
push esi
push edi
lea edx, [esp + 0x244]
push 1
push edx
call ebx
add esp, 0x10
cmp eax, edi
jne 0x40390d
mov ecx, dword [esp + 0x234]
push 0
push 0x200
lea eax, [esp + 0x244]
push eax
push ecx
call ebp
mov edi, eax
test edi, edi
jg 0x403850
push esi
call dword [sym.imp.MSVCR90.dll_fclose]
add esp, 4
lea edx, [esp + 0x60]
push edx
lea ecx, [esp + 0x80]
call dword [sym.imp.MSVCP90.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char_____thiscall_std::basic_stringstream_char__struct_std::char_traits_char___class_std::allocator_char__::str_void_]
mov byte [esp + 0x448], 5
cmp dword [eax + 0x18], 0x10
jb 0x4038b7
mov eax, dword [eax + 4]
jmp 0x4038ba
add eax, 4
mov ecx, dword [esp + 0x14]
push ecx
push eax
call fcn.00401500
add esp, 8
lea ecx, [esp + 0x60]
mov bl, al
mov byte [esp + 0x448], 4
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
test bl, bl
jne 0x403917
cmp dword [esp + 0x18], 0
jle 0x403917
cmp byte [esp + 0x454], bl
jne 0x403917
lea esi, [esp + 0x1b4]
call fcn.00401110
mov edx, dword [esp + 0x14]
push 1
push edx
call fcn.00403440
add esp, 8
jmp 0x403917
push esi
call dword [sym.imp.MSVCR90.dll_fclose]
add esp, 4
lea esi, [esp + 0x28]
call fcn.00404190
lea ecx, [esp + 0x104]
mov byte [esp + 0x448], 3
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_stringstream_char__struct_std::char_traits_char___class_std::allocator_char__::vbase_dtor_void_]
lea ecx, [esp + 0x190]
mov byte [esp + 0x448], 2
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
mov eax, dword [esp + 0x234]
push eax
mov dword [esp + method.KClientSocket.virtual_0], vtable.KClientSocket.0
call dword [sym.imp.WS2_32.dll_closesocket]
or eax, 0xffffffff
lea ecx, [esp + 0x7c]
mov dword [esp + 0x234], eax
mov dword [esp + 0x448], eax
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_stringstream_char__struct_std::char_traits_char___class_std::allocator_char__::vbase_dtor_void_]
mov al, 1
mov ecx, dword [esp + 0x440]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x428]
xor ecx, esp
call fcn.00405b7b
add esp, 0x438
ret