Function at 0x40b3c0
Capabilities:
Get local ipv4 addresses
Get socket information
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, 0x12d8
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
mov ebx, dword [sym.imp.kernel32.dll_CreateEventA]
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 ebx
sub esp, 0x10
mov dword [ebp - 0x126c], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], 0
call ebx
mov dword [ebp - 0x1258], eax
sub esp, 0x10
lea eax, [ebp - 0x1294]
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], 0x1ce
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
call fcn.00401af0
mov eax, dword [ebp - 0x1294]
call fcn.00401d20
mov edi, dword [sym.imp.httpapi.dll_HttpReceiveHttpRequest]
mov dword [esp + 0x18], 0
mov ebx, eax
lea eax, [ebp - 0x127c]
mov dword [esp + 0x14], 0x800
mov dword [esp + 0x1c], eax
lea eax, [ebp - 0x1010]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0
mov dword [esp + 4], 0
mov dword [esp + 8], 0
mov eax, dword [ebp - 0x1294]
mov dword [esp], eax
mov dword [ebp - 0x12b0], edi
call edi
sub esp, 0x20
mov esi, eax
call fcn.0040ded0
mov dword [eax], 0x412056
mov dword [eax + 4], 0x1d2
xor eax, eax
cmp esi, 0x3e5
sete al
mov dword [esp + 8], esi
mov dword [esp], eax
mov dword [esp + 4], str.Got_error__u._n
call fcn.00401af0
lea eax, [ebp - 0x1268]
mov dword [esp + 0x18], 0
mov dword [esp + 0x1c], eax
lea eax, [ebp - 0x810]
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 - 0x1294]
mov dword [esp], eax
call edi
sub esp, 0x20
mov esi, eax
mov eax, 0x1d4
call fcn.00401190
xor eax, eax
cmp esi, 0x3e5
mov dword [esp + 8], esi
sete al
mov dword [esp + 4], str.Got_error__u._n
mov dword [esp], eax
mov esi, dword fs:[0x18]
call fcn.00401af0
lea eax, [ebp - 0x1298]
mov dword [esi + 0x34], 0xdeadbeef
mov dword [esp + 8], eax
lea eax, [ebp - 0x127c]
mov dword [esp + 0xc], 0
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x1294]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GetOverlappedResult]
sub esp, 0x10
mov edi, eax
mov eax, 0x1d8
call fcn.00401190
xor eax, eax
test edi, edi
mov dword [esp + 4], str.Expected_failure._n
sete al
mov dword [esp], eax
call fcn.00401af0
mov eax, 0x1d9
call fcn.00401190
mov eax, dword [esi + 0x34]
mov dword [esp + 4], str.Got_error__lu._n
mov dword [esp + 8], eax
xor eax, eax
cmp dword [esi + 0x34], 0x3e4
movzx esi, bx
sete al
lea ebx, [ebp - 0x11f0]
mov dword [esp], eax
call fcn.00401af0
mov eax, esi
call fcn.00401b10
mov dword [ebp - 0x12a8], esi
mov dword [esp + 8], esi
mov edi, eax
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], ebx
call fcn.00401040
mov esi, dword [sym.imp.msvcrt.dll_strlen]
mov dword [esp], ebx
call esi
mov ecx, dword [sym.imp.ws2_32.dll_send]
mov dword [esp + 0xc], 0
mov dword [esp + 8], eax
mov dword [esp + 4], ebx
mov dword [ebp - 0x129c], edi
mov dword [esp], edi
mov dword [ebp - 0x12a4], ecx
call ecx
sub esp, 0x10
mov edi, eax
call fcn.0040ded0
mov dword [eax], 0x412056
mov dword [eax + 4], 0x1de
mov dword [esp], ebx
call esi
mov dword [esp + 8], edi
cmp edi, eax
mov dword [esp + 4], str.send___returned__d._n
sete al
movzx eax, al
mov dword [esp], eax
call fcn.00401af0
mov ecx, dword [sym.imp.kernel32.dll_WaitForSingleObject]
mov dword [esp + 4], 0x64
mov eax, dword [ebp - 0x126c]
mov dword [esp], eax
mov dword [ebp - 0x12a0], ecx
call ecx
sub esp, 8
mov edi, eax
call fcn.0040ded0
mov dword [eax], 0x412056
mov dword [eax + 4], 0x1e1
xor eax, eax
test edi, edi
sete al
mov dword [esp + 8], edi
mov dword [esp], eax
mov dword [esp + 4], str.Got__u._n
call fcn.00401af0
mov dword [esp + 4], 0x64
mov eax, dword [ebp - 0x1258]
mov dword [esp], eax
mov ecx, dword [ebp - 0x12a0]
call ecx
sub esp, 8
mov edi, eax
mov eax, 0x1e3
call fcn.00401190
xor eax, eax
cmp edi, 0x102
mov dword [esp + 8], edi
sete al
mov dword [esp + 4], str.Got__u._n
mov dword [esp], eax
call fcn.00401af0
mov eax, dword [ebp - 0x12a8]
call fcn.00401b10
mov dword [esp], ebx
mov edi, eax
call esi
mov dword [esp + 0xc], 0
mov dword [esp + 8], eax
mov dword [esp + 4], ebx
mov dword [ebp - 0x12ac], edi
mov dword [esp], edi
mov edx, dword [ebp - 0x12a4]
call edx
sub esp, 0x10
mov edi, eax
call fcn.0040ded0
mov dword [eax], 0x412056
mov dword [eax + 4], 0x1e7
mov dword [esp], ebx
call esi
mov dword [esp + 8], edi
cmp edi, eax
mov dword [esp + 4], str.send___returned__d._n
sete al
movzx eax, al
mov dword [esp], eax
call fcn.00401af0
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x126c]
mov dword [esp], eax
mov ecx, dword [ebp - 0x12a0]
call ecx
sub esp, 8
mov edi, eax
mov eax, 0x1ea
call fcn.00401190
xor eax, eax
test edi, edi
mov dword [esp + 8], edi
sete al
mov dword [esp + 4], str.Got__u._n
mov dword [esp], eax
call fcn.00401af0
mov dword [esp + 4], 0x64
mov eax, dword [ebp - 0x1258]
mov dword [esp], eax
mov ecx, dword [ebp - 0x12a0]
call ecx
sub esp, 8
mov edi, eax
mov eax, 0x1ec
call fcn.00401190
xor eax, eax
test edi, edi
mov dword [esp + 8], edi
sete al
mov dword [esp + 4], str.Got__u._n
lea edi, [ebp - 0x128c]
mov dword [esp], eax
call fcn.00401af0
lea ecx, [ebp - 0x1290]
mov edx, dword [sym.imp.ws2_32.dll_getsockname]
mov dword [ebp - 0x1290], 0x10
mov dword [esp + 8], ecx
mov dword [esp + 4], edi
mov eax, dword [ebp - 0x129c]
mov dword [esp], eax
mov dword [ebp - 0x12b4], edx
call edx
sub esp, 0xc
call fcn.0040ded0
mov dword [eax], 0x412056
mov dword [eax + 4], 0x1f0
mov eax, dword [ebp - 0x1290]
mov dword [esp + 4], edi
mov dword [esp + 8], eax
mov eax, dword [ebp - 0xfc4]
mov dword [esp], eax
call sub.msvcrt.dll_memcmp
mov dword [esp + 4], str.Client_addresses_didnt_match._n
test eax, eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.00401af0
lea ecx, [ebp - 0x1290]
mov dword [ebp - 0x1290], 0x10
mov dword [esp + 8], ecx
mov dword [esp + 4], edi
mov eax, dword [ebp - 0x12ac]
mov dword [esp], eax
mov edx, dword [ebp - 0x12b4]
call edx
sub esp, 0xc
call fcn.0040ded0
mov dword [eax], 0x412056
mov dword [eax + 4], 0x1f3
mov eax, dword [ebp - 0x1290]
mov dword [esp + 4], edi
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x7c4]
mov dword [esp], eax
call sub.msvcrt.dll_memcmp
mov dword [esp + 4], str.Client_addresses_didnt_match._n
test eax, eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.00401af0
call fcn.0040ded0
mov dword [eax], 0x412056
mov dword [eax + 4], 0x1f4
mov eax, dword [ebp - 0x1004]
mov edx, dword [ebp - 0x1008]
test eax, eax
je 0x40c058
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov dword [esp], str._lx_08lx
call fcn.00401000
mov dword [esp + 8], eax
mov dword [esp + 4], str.Expected_different_connection_IDs__but_got__s._n
mov eax, dword [ebp - 0x1008]
mov edx, dword [ebp - 0x1004]
xor eax, dword [ebp - 0x808]
xor edx, dword [ebp - 0x804]
or eax, edx
setne al
movzx eax, al
mov dword [esp], eax
call fcn.00401af0
call fcn.0040ded0
mov dword [eax], 0x412056
mov dword [eax + 4], 0x1f6
mov eax, dword [ebp - 0xffc]
mov edx, dword [ebp - 0x1000]
test eax, eax
je 0x40c088
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov dword [esp], str._lx_08lx
call fcn.00401000
mov dword [esp + 8], eax
mov dword [esp + 4], str.Expected_different_request_IDs__but_got__s._n
mov eax, dword [ebp - 0x1000]
mov edx, dword [ebp - 0xffc]
xor eax, dword [ebp - 0x800]
xor edx, dword [ebp - 0x7fc]
or eax, edx
setne al
movzx eax, al
mov dword [esp], eax
call fcn.00401af0
lea eax, [ebp - 0x127c]
mov dword [ebp - 0x111c], str.Im_a_teapot
mov edi, dword [sym.imp.httpapi.dll_HttpSendHttpResponse]
mov dword [ebp - 0x1120], 0xc01a2
mov dword [esp + 0x24], eax
lea eax, [ebp - 0x1128]
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 - 0x1294]
mov dword [esp], eax
call edi
sub esp, 0x2c
mov dword [ebp - 0x12b4], eax
call fcn.0040ded0
mov edx, dword [ebp - 0x12b4]
mov dword [eax], 0x412056
mov dword [eax + 4], 0x1fd
xor eax, eax
test edx, edx
sete al
mov dword [esp + 8], edx
mov dword [esp], eax
mov dword [esp + 4], str.Got_error__u._n
call fcn.00401af0
lea eax, [ebp - 0x1268]
mov dword [esp + 0x28], 0
mov dword [esp + 0x24], eax
lea eax, [ebp - 0x1128]
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 - 0x7fc]
mov eax, dword [ebp - 0x800]
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x1294]
mov dword [esp], eax
call edi
sub esp, 0x2c
mov dword [ebp - 0x12b4], eax
call fcn.0040ded0
mov edx, dword [ebp - 0x12b4]
mov dword [eax], 0x412056
mov dword [eax + 4], 0x1ff
xor eax, eax
test edx, edx
sete al
mov dword [esp + 8], edx
mov dword [esp], eax
mov dword [esp + 4], str.Got_error__u._n
call fcn.00401af0
lea eax, [ebp - 0x127c]
mov dword [esp + 0x18], 0
mov dword [esp + 0x1c], eax
lea eax, [ebp - 0x1010]
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 - 0x1294]
mov dword [esp], eax
mov eax, dword [ebp - 0x12b0]
call eax
sub esp, 0x20
mov dword [ebp - 0x12b4], eax
mov eax, 0x204
call fcn.00401190
mov edx, dword [ebp - 0x12b4]
xor eax, eax
mov dword [esp + 4], str.Got_error__u._n
cmp edx, 0x3e5
mov dword [esp + 8], edx
sete al
mov dword [esp], eax
call fcn.00401af0
lea ecx, [ebp - 0x1268]
mov dword [esp + 0x18], 0
mov dword [esp + 0x1c], ecx
lea ecx, [ebp - 0x810]
mov dword [esp + 0x10], ecx
mov dword [esp + 0x14], 0x800
mov dword [esp + 0xc], 0
mov dword [esp + 4], 0
mov dword [esp + 8], 0
mov eax, dword [ebp - 0x1294]
mov dword [esp], eax
mov eax, dword [ebp - 0x12b0]
call eax
sub esp, 0x20
mov dword [ebp - 0x12b0], eax
call fcn.0040ded0
mov edx, dword [ebp - 0x12b0]
mov dword [eax], 0x412056
mov dword [eax + 4], 0x206
xor eax, eax
cmp edx, 0x3e5
sete al
mov dword [esp + 8], edx
mov dword [esp], eax
mov dword [esp + 4], str.Got_error__u._n
call fcn.00401af0
mov dword [esp], ebx
call esi
mov dword [esp + 4], ebx
mov dword [esp + 0xc], 0
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x129c]
mov dword [esp], eax
mov ecx, dword [ebp - 0x12a4]
call ecx
sub esp, 0x10
mov dword [ebp - 0x12b0], eax
call fcn.0040ded0
mov dword [eax], 0x412056
mov dword [eax + 4], 0x209
mov dword [esp], ebx
call esi
mov edx, dword [ebp - 0x12b0]
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 [esp], ebx
call esi
mov dword [esp + 4], ebx
mov dword [esp + 0xc], 0
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x129c]
mov dword [esp], eax
mov ecx, dword [ebp - 0x12a4]
call ecx
sub esp, 0x10
mov dword [ebp - 0x12a4], eax
call fcn.0040ded0
mov dword [eax], 0x412056
mov dword [eax + 4], 0x20b
mov dword [esp], ebx
call esi
mov edx, dword [ebp - 0x12a4]
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 [esp + 4], 0x64
mov eax, dword [ebp - 0x126c]
mov dword [esp], eax
mov esi, dword [ebp - 0x12a0]
call esi
sub esp, 8
mov ebx, eax
call fcn.0040ded0
mov dword [eax], 0x412056
mov dword [eax + 4], 0x20e
xor eax, eax
test ebx, ebx
sete al
mov dword [esp + 8], ebx
mov dword [esp], eax
mov dword [esp + 4], str.Got__u._n
call fcn.00401af0
mov dword [esp + 4], 0x64
mov eax, dword [ebp - 0x1258]
mov dword [esp], eax
call esi
sub esp, 8
mov ebx, eax
call fcn.0040ded0
mov dword [eax], 0x412056
mov dword [eax + 4], 0x210
xor eax, eax
cmp ebx, 0x102
sete al
mov dword [esp + 8], ebx
mov dword [esp], eax
mov dword [esp + 4], str.Got__u._n
call fcn.00401af0
lea eax, [ebp - 0x127c]
mov dword [esp + 0x28], 0
mov dword [esp + 0x24], eax
lea eax, [ebp - 0x1128]
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 - 0x1294]
mov dword [esp], eax
call edi
sub esp, 0x2c
mov ebx, eax
call fcn.0040ded0
mov dword [eax], 0x412056
mov dword [eax + 4], 0x213
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
call fcn.00401af0
mov dword [esp + 4], 0x64
mov eax, dword [ebp - 0x1258]
mov dword [esp], eax
call esi
sub esp, 8
mov ebx, eax
call fcn.0040ded0
mov dword [eax], 0x412056
mov dword [eax + 4], 0x216
xor eax, eax
test ebx, ebx
sete al
mov dword [esp + 8], ebx
mov dword [esp], eax
mov dword [esp + 4], str.Got__u._n
call fcn.00401af0
call fcn.0040ded0
mov dword [eax], 0x412056
mov dword [eax + 4], 0x217
mov dword [esp + 4], str.Expected_same_connection_IDs._n
mov eax, dword [ebp - 0x1008]
mov edx, dword [ebp - 0x1004]
xor eax, dword [ebp - 0x808]
xor edx, dword [ebp - 0x804]
or eax, edx
sete al
movzx eax, al
mov dword [esp], eax
call fcn.00401af0
mov eax, 0x218
call fcn.00401190
mov eax, dword [ebp - 0xffc]
mov edx, dword [ebp - 0x1000]
test eax, eax
je 0x40c070
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov dword [esp], str._lx_08lx
call fcn.00401000
mov dword [esp + 8], eax
lea ebx, [ebp - 0x1254]
mov dword [esp + 4], str.Expected_different_request_IDs__but_got__s._n
mov eax, dword [ebp - 0x1000]
mov edx, dword [ebp - 0xffc]
xor eax, dword [ebp - 0x800]
xor edx, dword [ebp - 0x7fc]
or eax, edx
setne al
movzx eax, al
mov dword [esp], eax
call fcn.00401af0
mov eax, dword [ebp - 0x12a8]
mov esi, dword [ebp - 0x1294]
mov dword [esp], ebx
mov dword [esp + 8], 0x4121d4
mov dword [esp + 0xc], eax
mov dword [esp + 4], 0x32
call fcn.00401400
mov dword [esp + 4], ebx
mov dword [esp], esi
call dword [sym.imp.httpapi.dll_HttpRemoveUrl]
sub esp, 8
mov ebx, eax
call fcn.0040ded0
mov dword [eax], 0x412056
mov dword [eax + 4], 0x21c
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
call fcn.00401af0
mov eax, dword [ebp - 0x129c]
mov ebx, dword [sym.imp.ws2_32.dll_closesocket]
mov dword [esp], eax
call ebx
mov eax, dword [ebp - 0x12ac]
sub esp, 4
mov dword [esp], eax
call ebx
mov eax, dword [ebp - 0x126c]
mov ebx, dword [sym.imp.kernel32.dll_CloseHandle]
sub esp, 4
mov dword [esp], eax
call ebx
mov eax, dword [ebp - 0x1258]
sub esp, 4
mov dword [esp], eax
call ebx
mov eax, dword [ebp - 0x1294]
sub esp, 4
mov dword [esp], eax
call ebx
sub esp, 4
mov ebx, eax
mov eax, 0x222
call fcn.00401190
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
mov dword [esp], ebx
mov dword [esp + 4], str.Failed_to_close_queue_handle__error__lu._n
mov dword [esp + 8], eax
call fcn.00401af0
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
lea esp, [edi - 8]
pop edi
ret
mov dword [esp + 4], edx
mov dword [esp], 0x41248e
call fcn.00401000
jmp 0x40b96f
mov dword [esp + 4], edx
mov dword [esp], 0x41248e
call fcn.00401000
jmp 0x40bf2d
mov dword [esp + 4], edx
mov dword [esp], 0x41248e
call fcn.00401000
jmp 0x40b9dd