Function at 0x412500
Capabilities:
Initialize winsock library
Receive data
Receive data on socket
Send data
Send data on socket
Send http request
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0x23d4
call fcn.00417e90
mov eax, dword [0x42613c]
xor eax, esp
mov dword [esp + 0x23d0], eax
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 0xc]
mov edx, dword [ebp + 0x10]
push ebx
push esi
push edi
mov dword [esp + 0x30], eax
mov eax, dword [ebp + 0x18]
mov ebx, dword [eax]
xor edi, edi
cmp byte [ebp + 0x1c], 0
mov dword [esp + 0x40], ecx
mov dword [esp + 0x18], edx
mov dword [esp + 0x34], eax
mov dword [esp + 0xc], edi
mov dword [esp + 0x10], str.HEAD__s_HTTP_1.1_r_nContent_Type:_text_html_charsetGB2312_r_nAccept_Language:_zh_cn_r_nUser_Agent:_IMW_NO_WinHTTP_AS_r_ndcmd:_true_r_nContent_Length:__d_r_n_r_n
jne 0x41255b
mov dword [esp + 0x10], str.HEAD__s_HTTP_1.1_r_nContent_Type:_text_html_charsetGB2312_r_nAccept_Language:_zh_cn_r_nUser_Agent:_IMW_NO_WinHTTP_AS_r_nContent_Length:__d_r_n_r_n
lea eax, [esp + 0x48]
push eax
push 2
mov dword [esp + 0x2c], edi
mov dword [esp + 0x40], edi
mov dword [esp + 0x30], edi
mov dword [esp + 0x1c], edi
mov dword [esp + 0x34], edi
call dword [sym.imp.WS2_32.dll_WSAStartup]
test eax, eax
je 0x412592
push str.Cant_initialize_TCP_sockets_n
call fcn.004128a0
add esp, 4
jmp 0x41283d
push edi
push 1
push 2
mov dword [esp + 0x48], 1
call dword [sym.imp.WS2_32.dll_socket]
mov dword [esp + 0xc], eax
cmp eax, 0xffffffff
je 0x4125cd
push 4
lea ecx, [esp + 0x40]
push ecx
push 4
push 0xffff
push eax
call dword [sym.imp.WS2_32.dll_setsockopt]
cmp eax, 0xffffffff
setne al
test al, al
jne 0x4125df
push str.Cant_create_a_socket_n
call fcn.004128a0
add esp, 4
jmp 0x41283d
mov edx, dword [esp + 0x30]
push edx
call dword [sym.imp.WS2_32.dll_inet_addr]
mov ecx, dword [ebp + 0x14]
lea edx, [esp + 0x30]
lea esi, [esp + 0xc]
mov dword [esp + 0x30], eax
call fcn.00412200
test al, al
jne 0x412614
push str.SocketConnect___error_n
call fcn.004128a0
add esp, 4
jmp 0x41283b
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x10]
push ebx
push eax
push ecx
lea edx, [esp + 0x1e4]
push edx
call dword [sym.imp.MSVCR100.dll_sprintf]
mov ecx, dword [esp + 0x1c]
mov esi, dword [sym.imp.WS2_32.dll_send]
add esp, 0x10
push 0
push eax
lea eax, [esp + 0x1e0]
push eax
push ecx
call esi
cmp eax, 0xffffffff
je 0x41283b
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0xc]
push 0
push ebx
push edx
push eax
call esi
cmp eax, 0xffffffff
je 0x41283b
push 0x2000
lea ecx, [esp + 0x3dc]
push 0
push ecx
call sub.MSVCR100.dll_memset
add esp, 0xc
push 0
call dword [sym.imp.MSVCR100.dll__time64]
add esp, 4
mov esi, eax
mov ebx, edx
push 0
mov dword [esp + 0x1c], esi
mov dword [esp + 0x20], ebx
call dword [sym.imp.MSVCR100.dll__time64]
add esp, 4
sub eax, esi
sbb edx, ebx
test edx, edx
jg 0x41283b
jl 0x4126c0
cmp eax, 0xf
jae 0x41283b
lea esp, [esp]
lea esi, [esp + 0xc]
call fcn.00412330
cmp eax, 0xffffffff
je 0x412834
test eax, eax
je 0x41280c
mov esi, dword [esp + 0xc]
lea edx, [esp + 0x10]
push edx
push 0x4004667f
push esi
call dword [sym.imp.WS2_32.dll_ioctlsocket]
test eax, eax
je 0x4126fb
xor eax, eax
mov dword [esp + 0x10], eax
jmp 0x4126ff
mov eax, dword [esp + 0x10]
cmp dword [esp + 0x2c], 0x4e20
jg 0x412834
test eax, eax
jne 0x412722
inc dword [esp + 0x2c]
push 5
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x41280c
mov ecx, dword [esp + 0x24]
test ecx, ecx
jne 0x4127c9
mov ebx, dword [esp + 0x38]
mov ecx, 0x2000
sub ecx, ebx
cmp ecx, eax
jae 0x41273f
mov eax, ecx
push 0
push eax
lea eax, [esp + ebx + 0x3e0]
push eax
push esi
call dword [sym.imp.WS2_32.dll_recv]
mov esi, eax
test esi, esi
je 0x41280c
push 0
call dword [sym.imp.MSVCR100.dll__time64]
add ebx, esi
mov dword [esp + 0x20], edx
add esp, 4
mov ecx, ebx
lea edx, [esp + 0x3d8]
mov dword [esp + 0x18], eax
mov dword [esp + 0x38], ebx
call fcn.00412430
mov esi, eax
test esi, esi
jle 0x41280c
mov ecx, edx
mov dword [esp + 0x24], esi
call fcn.00412460
mov dword [esp + 0x14], eax
test eax, eax
jle 0x4127ff
add eax, 2
push eax
call dword [sym.imp.mfc100.dll_Ordinal_265]
mov edi, ebx
add esp, 4
sub edi, esi
dec edi
push edi
lea ecx, [esp + esi + 0x3dd]
push ecx
push eax
mov dword [esp + 0x34], eax
call sub.MSVCR100.dll_memcpy
add esp, 0xc
jmp 0x4127ff
jle 0x41280c
cmp dword [esp + 0x14], 0
jle 0x4127ff
mov edx, dword [esp + 0x28]
push 0
push eax
lea eax, [edi + edx]
push eax
push esi
call dword [sym.imp.WS2_32.dll_recv]
mov esi, eax
test esi, esi
je 0x4127ff
push 0
call dword [sym.imp.MSVCR100.dll__time64]
add esp, 4
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], edx
add edi, esi
cmp dword [esp + 0x24], 0
jle 0x41280c
cmp dword [esp + 0x14], edi
je 0x412834
push 0
call dword [sym.imp.MSVCR100.dll__time64]
add esp, 4
sub eax, dword [esp + 0x18]
sbb edx, dword [esp + 0x1c]
mov dword [esp + 0x44], edx
js 0x4126c0
jg 0x412834
cmp eax, 0xf
jb 0x4126c0
cmp dword [esp + 0x14], 0
jne 0x41286b
xor edi, edi
mov eax, dword [esp + 0xc]
mov ecx, dword [esp + 0x34]
mov dword [ecx], edi
cmp eax, edi
je 0x412852
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x23d0]
xor ecx, esp
call fcn.00414976
mov esp, ebp
pop ebp
ret 0x18
mov eax, dword [esp + 0xc]
mov edx, dword [esp + 0x34]
push eax
mov dword [edx], edi
call dword [sym.imp.WS2_32.dll_closesocket]
mov ecx, dword [esp + 0x23dc]
mov eax, dword [esp + 0x28]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00414976
mov esp, ebp
pop ebp
ret 0x18