Function at 0x408130
Capabilities:
Receive data
Receive data on socket
Receive http request
Send data
Send data on socket
Send http request
Send http request with host header
Send http response

Disassembly:
push edi
mov eax, 0x12b0
lea edi, [esp + 8]
and esp, 0xfffffff8
push dword [edi - 4]
push ebp
mov ebp, esp
push edi
push esi
push ebx
call fcn.0040f5e0
mov ecx, 0x46
sub esp, eax
lea edi, [ebp - 0x1128]
xor eax, eax
rep stosd dword es:[edi], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], 0
call dword [sym.imp.kernel32.dll_CreateEventA]
mov dword [ebp - 0x1258], eax
sub esp, 0x10
lea eax, [ebp - 0x1274]
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.httpapi.dll_HttpCreateHttpHandle]
sub esp, 8
mov ebx, eax
call fcn.0040ded0
mov dword [eax], 0x412056
mov dword [eax + 4], 0x181
xor eax, eax
test ebx, ebx
sete al
mov dword [esp + 8], ebx
mov dword [esp], eax
mov dword [esp + 4], str.Got_error__u._n
mov ebx, dword fs:[0x18]
call fcn.00401af0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x7b
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x1274]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CreateIoCompletionPort]
sub esp, 0x10
mov esi, eax
call fcn.0040ded0
mov dword [eax], 0x412056
mov dword [eax + 4], 0x184
mov eax, dword [ebx + 0x34]
mov dword [esp + 4], str.Failed_to_create_completion_port__error__lu._n
mov dword [esp + 8], eax
xor eax, eax
test esi, esi
setne al
mov dword [esp], eax
call fcn.00401af0
lea eax, [ebp - 0x1278]
mov dword [esp], esi
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x126c]
mov dword [esp + 8], eax
lea eax, [ebp - 0x1270]
mov dword [esp + 4], eax
mov eax, dword [sym.imp.kernel32.dll_GetQueuedCompletionStatus]
mov dword [esp + 0x10], 0
mov dword [ebp - 0x127c], eax
call eax
sub esp, 0x14
mov edi, eax
call fcn.0040ded0
mov dword [eax], 0x412056
mov dword [eax + 4], 0x187
xor eax, eax
test edi, edi
sete al
mov dword [esp + 4], str.Expected_failure._n
mov dword [esp], eax
call fcn.00401af0
call fcn.0040ded0
mov dword [eax], 0x412056
mov dword [eax + 4], 0x188
mov eax, dword [ebx + 0x34]
mov dword [esp + 4], str.Got_error__lu._n
mov dword [esp + 8], eax
xor eax, eax
cmp dword [ebx + 0x34], 0x102
sete al
mov dword [esp], eax
call fcn.00401af0
lea edx, [ebp - 0x1268]
lea eax, [ebp - 0x1010]
mov dword [esp + 0x18], 0
mov dword [esp + 0x1c], edx
mov dword [esp + 0x14], 0x800
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0
mov dword [esp + 4], 0
mov dword [esp + 8], 0
mov eax, dword [ebp - 0x1274]
mov dword [esp], eax
call dword [sym.imp.httpapi.dll_HttpReceiveHttpRequest]
sub esp, 0x20
mov edi, eax
call fcn.0040ded0
mov dword [eax], 0x412056
mov dword [eax + 4], 0x18b
xor eax, eax
cmp edi, 0x3e5
sete al
mov dword [esp + 8], edi
lea edi, [ebp - 0x1278]
mov dword [esp], eax
mov dword [esp + 4], str.Got_error__u._n
call fcn.00401af0
mov eax, dword [ebp - 0x1274]
call fcn.00401d20
movzx edx, ax
mov eax, edx
mov dword [ebp - 0x1284], edx
call fcn.00401b10
mov dword [ebp - 0x1280], eax
mov dword [esp + 0xc], edi
lea edi, [ebp - 0x126c]
mov dword [esp + 8], edi
lea edi, [ebp - 0x1270]
mov dword [esp + 4], edi
mov dword [esp], esi
mov dword [esp + 0x10], 0
mov ecx, dword [ebp - 0x127c]
call ecx
sub esp, 0x14
mov edi, eax
call fcn.0040ded0
mov dword [eax], 0x412056
mov dword [eax + 4], 0x191
xor eax, eax
test edi, edi
lea edi, [ebp - 0x11f0]
sete al
mov dword [esp + 4], str.Expected_failure._n
mov dword [esp], eax
call fcn.00401af0
call fcn.0040ded0
mov dword [eax], 0x412056
mov dword [eax + 4], 0x192
mov eax, dword [ebx + 0x34]
mov dword [esp + 4], str.Got_error__lu._n
mov dword [esp + 8], eax
xor eax, eax
cmp dword [ebx + 0x34], 0x102
sete al
mov dword [esp], eax
call fcn.00401af0
mov edx, dword [ebp - 0x1284]
mov dword [esp], edi
mov dword [esp + 4], str.GET__foobar_HTTP_1.1_r_nHost:_localhost:_u_r_nConnection:_keep_alive_r_nUser_Agent:_WINE_r_n_r_n
mov dword [esp + 8], edx
call fcn.00401040
mov ecx, dword [sym.imp.msvcrt.dll_strlen]
mov dword [esp], edi
mov dword [ebp - 0x128c], ecx
call ecx
mov dword [esp + 4], edi
mov dword [esp + 0xc], 0
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x1280]
mov dword [esp], eax
call dword [sym.imp.ws2_32.dll_send]
sub esp, 0x10
mov dword [ebp - 0x1288], eax
call fcn.0040ded0
mov dword [eax], 0x412056
mov dword [eax + 4], 0x196
mov dword [esp], edi
mov ecx, dword [ebp - 0x128c]
lea edi, [ebp - 0x1278]
call ecx
mov edx, dword [ebp - 0x1288]
mov dword [esp + 4], str.send___returned__d._n
cmp edx, eax
mov dword [esp + 8], edx
sete al
movzx eax, al
mov dword [esp], eax
call fcn.00401af0
mov dword [ebp - 0x126c], 0xdeadbeef
mov dword [ebp - 0x1270], 0xdeadbeef
mov dword [esp + 0xc], edi
lea edi, [ebp - 0x126c]
mov dword [esp + 8], edi
lea edi, [ebp - 0x1270]
mov dword [esp + 4], edi
mov dword [esp], esi
mov dword [esp + 0x10], 0x3e8
mov ecx, dword [ebp - 0x127c]
call ecx
sub esp, 0x14
mov edi, eax
call fcn.0040ded0
mov dword [eax], 0x412056
mov dword [eax + 4], 0x19a
mov eax, dword [ebx + 0x34]
mov dword [esp], edi
lea edi, [ebp - 0x1268]
mov dword [esp + 8], eax
mov dword [esp + 4], str.Got_error__lu._n
call fcn.00401af0
call fcn.0040ded0
mov dword [eax], 0x412056
mov dword [eax + 4], 0x19b
xor eax, eax
mov dword [esp + 4], str.OVERLAPPED_pointers_didnt_match._n
cmp dword [ebp - 0x1278], edi
lea edi, [ebp - 0x1278]
sete al
mov dword [esp], eax
call fcn.00401af0
call fcn.0040ded0
mov dword [eax], 0x412056
mov dword [eax + 4], 0x19c
mov eax, dword [ebp - 0x126c]
mov dword [esp + 4], str.Got_unexpected_key__Iu._n
cmp eax, 0x7b
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.00401af0
call fcn.0040ded0
mov dword [eax], 0x412056
mov dword [eax + 4], 0x19d
mov eax, dword [ebp - 0x1270]
mov dword [esp + 4], str.Got_size__lu._n
cmp eax, 0x1d0
mov dword [esp + 8], eax
seta al
movzx eax, al
mov dword [esp], eax
call fcn.00401af0
mov dword [esp + 0xc], edi
lea edi, [ebp - 0x126c]
mov dword [esp + 8], edi
lea edi, [ebp - 0x1270]
mov dword [esp + 4], edi
mov dword [esp], esi
mov dword [esp + 0x10], 0
mov ecx, dword [ebp - 0x127c]
call ecx
sub esp, 0x14
mov edi, eax
call fcn.0040ded0
mov dword [eax], 0x412056
mov dword [eax + 4], 0x1a0
xor eax, eax
test edi, edi
lea edi, [ebp - 0x1268]
sete al
mov dword [esp + 4], str.Expected_failure._n
mov dword [esp], eax
call fcn.00401af0
call fcn.0040ded0
mov dword [eax], 0x412056
mov dword [eax + 4], 0x1a1
mov eax, dword [ebx + 0x34]
mov dword [esp + 4], str.Got_error__lu._n
mov dword [esp + 8], eax
xor eax, eax
cmp dword [ebx + 0x34], 0x102
sete al
mov dword [esp], eax
call fcn.00401af0
lea eax, [ebp - 0x1128]
mov dword [ebp - 0x111c], str.Im_a_teapot
mov dword [ebp - 0x1120], 0xc01a2
mov dword [esp + 0x24], edi
mov dword [esp + 0x28], 0
mov dword [esp + 0x20], 0
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0
mov edx, dword [ebp - 0xffc]
mov eax, dword [ebp - 0x1000]
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x1274]
mov dword [esp], eax
call dword [sym.imp.httpapi.dll_HttpSendHttpResponse]
sub esp, 0x2c
mov edi, eax
call fcn.0040ded0
mov dword [eax], 0x412056
mov dword [eax + 4], 0x1a7
xor eax, eax
test edi, edi
sete al
mov dword [esp + 8], edi
lea edi, [ebp - 0x1278]
mov dword [esp + 4], str.Got_error__u._n
mov dword [esp], eax
call fcn.00401af0
mov dword [ebp - 0x126c], 0xdeadbeef
mov dword [ebp - 0x1270], 0xdeadbeef
mov dword [esp + 0xc], edi
lea edi, [ebp - 0x126c]
mov dword [esp + 8], edi
lea edi, [ebp - 0x1270]
mov dword [esp + 4], edi
mov dword [esp], esi
mov dword [esp + 0x10], 0x3e8
mov ecx, dword [ebp - 0x127c]
call ecx
sub esp, 0x14
mov edi, eax
call fcn.0040ded0
mov dword [eax], 0x412056
mov dword [eax + 4], 0x1ab
mov eax, dword [ebx + 0x34]
mov dword [esp], edi
mov dword [esp + 8], eax
mov dword [esp + 4], str.Got_error__lu._n
call fcn.00401af0
call fcn.0040ded0
lea ecx, [ebp - 0x1268]
mov dword [eax], 0x412056
mov dword [eax + 4], 0x1ac
xor eax, eax
mov dword [esp + 4], str.OVERLAPPED_pointers_didnt_match._n
cmp dword [ebp - 0x1278], ecx
sete al
mov dword [esp], eax
call fcn.00401af0
call fcn.0040ded0
mov dword [eax], 0x412056
mov dword [eax + 4], 0x1ad
mov eax, dword [ebp - 0x126c]
mov dword [esp + 4], str.Got_unexpected_key__Iu._n
cmp eax, 0x7b
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.00401af0
lea eax, [ebp - 0x810]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x800
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x1280]
mov dword [esp], eax
call dword [sym.imp.ws2_32.dll_recv]
sub esp, 0x10
mov edi, eax
call fcn.0040ded0
mov dword [eax], 0x412056
mov dword [eax + 4], 0x1b0
mov eax, dword [ebp - 0x1270]
mov dword [esp + 0xc], edi
cmp eax, edi
mov dword [esp + 8], eax
sete al
mov dword [esp + 4], str.Expected_size__lu__got__u._n
movzx eax, al
mov dword [esp], eax
call fcn.00401af0
mov edx, dword [ebp - 0x1284]
mov edi, dword [ebp - 0x1274]
mov dword [esp + 8], 0x4121d4
mov dword [esp + 4], 0x32
mov dword [esp + 0xc], edx
lea edx, [ebp - 0x1254]
mov dword [esp], edx
call fcn.00401400
lea edx, [ebp - 0x1254]
mov dword [esp], edi
mov dword [esp + 4], edx
call dword [sym.imp.httpapi.dll_HttpRemoveUrl]
sub esp, 8
mov edi, eax
call fcn.0040ded0
mov dword [eax], 0x412056
mov dword [eax + 4], 0x1b3
xor eax, eax
test edi, edi
sete al
mov dword [esp + 8], edi
mov dword [esp], eax
mov dword [esp + 4], str.Got_error__u._n
call fcn.00401af0
mov eax, dword [ebp - 0x1280]
mov dword [esp], eax
call dword [sym.imp.ws2_32.dll_closesocket]
sub esp, 4
mov dword [esp], esi
mov esi, dword [sym.imp.kernel32.dll_CloseHandle]
call esi
mov eax, dword [ebp - 0x1258]
sub esp, 4
mov dword [esp], eax
call esi
mov eax, dword [ebp - 0x1274]
sub esp, 4
mov dword [esp], eax
call esi
sub esp, 4
mov esi, eax
call fcn.0040ded0
mov dword [eax], 0x412056
mov dword [eax + 4], 0x1b8
mov eax, dword [ebx + 0x34]
mov dword [esp], esi
mov dword [esp + 8], eax
mov dword [esp + 4], str.Failed_to_close_queue_handle__error__lu._n
call fcn.00401af0
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
lea esp, [edi - 8]
pop edi
ret