Function at 0x404de9
Capabilities:
Initialize winhttp library
Prepare http request
Read http header
Receive http response
Set http header

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4a0e08
mov eax, dword fs:[0]
push eax
mov eax, 0x18d4
call fcn.004829e0
mov eax, dword [0x4d04c0]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, edx
xor ebx, ebx
mov edi, ecx
mov dword [ebp - 0x187c], edi
cmp esi, ebx
jne 0x404e3c
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push eax
push str._ERROR___d___init_host_url_is_empty.
jmp 0x4056a5
xor eax, eax
push 0x3fe
mov word [ebp - 0x1868], ax
lea eax, [ebp - 0x1866]
push ebx
push eax
call fcn.004805d0
add esp, 0xc
push 0x1400
lea eax, [ebp - 0x1468]
push ebx
push eax
call fcn.004805d0
add esp, 0xc
push 0x38
lea eax, [ebp - 0x18c8]
push ebx
push eax
call fcn.004805d0
lea eax, [ebp - 0x468]
mov dword [ebp - 0x1898], eax
lea eax, [ebp - 0x1468]
mov dword [ebp - 0x18bc], eax
lea eax, [ebp - 0xc68]
mov dword [ebp - 0x18a8], eax
lea eax, [ebp - 0x1868]
mov dword [ebp - 0x18c8], eax
lea eax, [ebp - 0x868]
mov dword [ebp - 0x18a0], eax
lea eax, [ebp - 0x1068]
mov dword [ebp - 0x18b0], eax
mov eax, 0x200
add esp, 0xc
mov dword [ebp - 0x18ac], eax
mov dword [ebp - 0x189c], eax
mov dword [ebp - 0x18c4], eax
mov dword [ebp - 0x18a4], eax
mov dword [ebp - 0x18b8], eax
mov dword [ebp - 0x1894], eax
lea eax, [ebp - 0x18cc]
push eax
push Ordinal_1
push ebx
push esi
mov dword [ebp - 0x18cc], 0x3c
call dword [sym.imp.WINHTTP.dll_WinHttpCrackUrl]
mov eax, dword [ebp - 0x18bc]
cmp eax, ebx
je 0x405699
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x404f21
sub eax, edx
sar eax, 1
je 0x405699
lea esi, [edi + 0x10]
push esi
mov dword [ebp - 0x1884], esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov dword [ebp - 4], ebx
push dword [ebp - 0x18bc]
lea ecx, [ebp - 0x2c]
call fcn.004029c1
lea eax, [ebp - 0x2c]
push eax
mov ecx, edi
mov byte [ebp - 4], 1
call fcn.00406eda
cmp dword [eax + 8], ebx
push ebx
push 1
lea ecx, [ebp - 0x2c]
setne byte [ebp - 0x1869]
mov byte [ebp - 4], bl
call fcn.00402a5a
cmp byte [ebp - 0x1869], bl
je 0x404f96
mov bl, 1
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov al, bl
jmp 0x4056b4
mov ecx, dword [ebp - 0x18bc]
push edi
call fcn.00404c65
test al, al
jne 0x404fc1
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov ecx, dword [0x4d4770]
push eax
push str._ERROR___d___query_host_failed_
call fcn.00414401
pop ecx
pop ecx
jmp 0x404f88
lea esi, [ebp - 0x18e0]
call fcn.004072cf
mov byte [ebp - 4], 2
push dword [ebp - 0x18bc]
lea ecx, [ebp - 0x2c]
call fcn.004029c1
lea eax, [ebp - 0x2c]
push eax
mov ecx, edi
mov byte [ebp - 4], 3
call fcn.00406eda
mov eax, dword [eax + 4]
mov esi, dword [eax]
push ebx
push 1
lea ecx, [ebp - 0x2c]
mov dword [ebp - 0x1874], esi
mov byte [ebp - 4], 2
call fcn.00402a5a
push dword [ebp - 0x18bc]
lea ecx, [ebp - 0x2c]
call fcn.004029c1
lea eax, [ebp - 0x2c]
push eax
mov ecx, edi
mov byte [ebp - 4], 4
call fcn.00406eda
cmp dword [eax + 4], esi
push ebx
push 1
lea ecx, [ebp - 0x2c]
setne byte [ebp - 0x1869]
mov byte [ebp - 4], 2
call fcn.00402a5a
mov edi, dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
jmp 0x4053af
add esi, 0xc
push dword [esi]
mov dword [ebp - 0x1890], esi
call dword [sym.imp.WS2_32.dll_inet_ntoa]
push eax
lea ecx, [ebp - 0x48]
mov dword [ebp - 0x34], 0xf
mov dword [ebp - 0x38], ebx
mov byte [ebp - 0x48], bl
call fcn.004016a4
mov byte [ebp - 4], 5
cmp dword [ebp - 0x34], 0x10
mov eax, dword [ebp - 0x48]
jae 0x40507f
lea eax, [ebp - 0x48]
push eax
call edi
mov ecx, dword [0x4d4770]
push eax
push str._INFO___d___host_ip__s_
call fcn.00414401
add esp, 0xc
push ebx
push ebx
push ebx
push 1
push ebx
mov dword [ebp - 0x1878], ebx
call dword [sym.imp.WINHTTP.dll_WinHttpOpen]
mov esi, eax
mov dword [ebp - 0x1888], esi
cmp esi, ebx
jne 0x4050d6
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call edi
mov ecx, dword [0x4d4770]
push eax
push str._ERROR___d___win_http_open_failed__err__d_.
call fcn.00414401
add esp, 0xc
jmp 0x405353
lea eax, [ebp - 0x2c]
push eax
lea ecx, [ebp - 0x48]
call fcn.00419770
pop ecx
push 0xa
push 6
push 6
mov byte [ebp - 4], 6
push 0xa
push esi
mov dword [ebp - 0x18d0], 4
mov dword [ebp - 0x1870], ebx
mov dword [ebp - 0x188c], ebx
call dword [sym.imp.WINHTTP.dll_WinHttpSetTimeouts]
cmp dword [ebp - 0x18], 8
mov eax, dword [ebp - 0x2c]
jae 0x405118
lea eax, [ebp - 0x2c]
push ebx
push dword [ebp - 0x18b4]
push eax
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpConnect]
mov dword [ebp - 0x1880], eax
cmp eax, ebx
jne 0x405160
cmp dword [ebp - 0x34], 0x10
mov esi, dword [ebp - 0x48]
jae 0x40513d
lea esi, [ebp - 0x48]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push esi
call edi
push eax
push str._ERROR___d___win_http_connect_failed__ip__s___err__d_.
mov ecx, dword [0x4d4770]
call fcn.00414401
add esp, 0x10
jmp 0x40531a
push 0x100
push ebx
push ebx
push str.HTTP_1.1
push dword [ebp - 0x18a0]
push str.HEAD
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov esi, eax
mov dword [ebp - 0x1878], esi
cmp esi, ebx
jne 0x4051a8
cmp dword [ebp - 0x34], 0x10
mov esi, dword [ebp - 0x48]
jae 0x405196
lea esi, [ebp - 0x48]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push esi
call edi
push eax
push str._ERROR___d___win_http_open_request_failed__ip__s___err__d_.
jmp 0x40514d
xor eax, eax
push str.Host:
lea ecx, [ebp - 0x64]
mov dword [ebp - 0x50], 7
mov dword [ebp - 0x54], ebx
mov word [ebp - 0x64], ax
call fcn.0040299a
mov byte [ebp - 4], 7
push dword [ebp - 0x18bc]
lea ecx, [ebp - 0x64]
call fcn.004041e9
push 0x4baea4
lea ecx, [ebp - 0x64]
call fcn.004041e9
cmp dword [ebp - 0x50], 8
mov eax, dword [ebp - 0x64]
jae 0x4051f0
lea eax, [ebp - 0x64]
push 0x20000000
push 0xffffffffffffffff
push eax
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpAddRequestHeaders]
test eax, eax
jne 0x405232
cmp dword [ebp - 0x34], 0x10
mov esi, dword [ebp - 0x48]
jae 0x40520f
lea esi, [ebp - 0x48]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push esi
call edi
push eax
push str._ERROR___d___win_http_add_request_headers_failed__ip__s___err__d_.
mov ecx, dword [0x4d4770]
call fcn.00414401
add esp, 0x10
jmp 0x40530f
push ebx
push ebx
push ebx
push ebx
push ebx
push ebx
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpSendRequest]
test eax, eax
jne 0x405261
cmp dword [ebp - 0x34], 0x10
mov esi, dword [ebp - 0x48]
jae 0x40524f
lea esi, [ebp - 0x48]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push esi
call edi
push eax
push str._ERROR___d___win_http_send_request_failed__ip__s___err__d_.
jmp 0x40521f
push ebx
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
test eax, eax
jne 0x40528b
cmp dword [ebp - 0x34], 0x10
mov esi, dword [ebp - 0x48]
jae 0x405279
lea esi, [ebp - 0x48]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push esi
call edi
push eax
push str._ERROR___d___win_http_receive_response_failed__ip__s___err__d_.
jmp 0x40521f
lea eax, [ebp - 0x188c]
push eax
lea eax, [ebp - 0x18d0]
push eax
lea eax, [ebp - 0x1870]
push eax
push ebx
push 0x20000005
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
test eax, eax
je 0x4052d9
cmp dword [ebp - 0x1870], ebx
jbe 0x4052d9
lea edx, [ebp - 0x1870]
lea ecx, [ebp - 0x18e0]
call fcn.004072fa
mov esi, eax
mov eax, dword [ebp - 0x1890]
call fcn.00428694
jmp 0x40530f
cmp dword [ebp - 0x34], 0x10
mov esi, dword [ebp - 0x48]
jae 0x4052e5
lea esi, [ebp - 0x48]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push dword [ebp - 0x188c]
push dword [ebp - 0x1870]
push esi
call edi
mov ecx, dword [0x4d4770]
push eax
push str._ERROR___d___win_http_query_headers_failed__ip__s___size__d___index__d___err__d_.
call fcn.00414401
add esp, 0x18
push ebx
push 1
lea ecx, [ebp - 0x64]
call fcn.00402a5a
push ebx
push 1
lea ecx, [ebp - 0x2c]
call fcn.00402a5a
push dword [ebp - 0x1888]
mov esi, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
call esi
cmp dword [ebp - 0x1880], ebx
je 0x405343
push dword [ebp - 0x1880]
call esi
cmp dword [ebp - 0x1878], ebx
je 0x405353
push dword [ebp - 0x1878]
call esi
push ebx
push 1
lea ecx, [ebp - 0x48]
mov byte [ebp - 4], 2
call fcn.00401587
lea eax, [ebp - 0x1874]
call fcn.0040dcd7
push dword [ebp - 0x18bc]
lea ecx, [ebp - 0x2c]
call fcn.004029c1
mov ecx, dword [ebp - 0x187c]
lea eax, [ebp - 0x2c]
push eax
mov byte [ebp - 4], 4
call fcn.00406eda
mov eax, dword [eax + 4]
mov esi, dword [ebp - 0x1874]
push ebx
cmp eax, esi
push 1
lea ecx, [ebp - 0x2c]
setne byte [ebp - 0x1869]
mov byte [ebp - 4], 2
call fcn.00402a5a
cmp byte [ebp - 0x1869], bl
jne 0x405048
mov ecx, dword [ebp - 0x18dc]
mov eax, dword [ecx]
xor esi, esi
mov dword [ebp - 0x1870], ebx
mov dword [ebp - 0x1874], eax
cmp ecx, eax
je 0x4055f7
cmp esi, ebx
je 0x4053ea
mov ecx, dword [eax + 0x14]
sub ecx, dword [eax + 0x10]
sar ecx, 2
cmp esi, ecx
jae 0x405414
mov esi, dword [eax + 0x14]
sub esi, dword [eax + 0x10]
mov eax, dword [eax + 0xc]
sar esi, 2
push esi
push eax
mov dword [ebp - 0x1870], eax
call edi
mov ecx, dword [0x4d4770]
push eax
push str._INFO___d___ulfs_max__ld___count__d_
call fcn.00414401
add esp, 0x10
lea eax, [ebp - 0x1874]
call fcn.004074aa
mov eax, dword [ebp - 0x1874]
cmp dword [ebp - 0x18dc], eax
jne 0x4053d9
cmp dword [ebp - 0x1870], ebx
jbe 0x4055f7
push dword [ebp - 0x18bc]
lea ecx, [ebp - 0x2c]
call fcn.004029c1
mov ecx, dword [ebp - 0x187c]
lea eax, [ebp - 0x2c]
push eax
mov byte [ebp - 4], 8
call fcn.00406eda
mov eax, dword [eax + 4]
mov esi, dword [eax]
push ebx
push 1
lea ecx, [ebp - 0x2c]
mov dword [ebp - 0x1878], esi
mov byte [ebp - 4], 2
call fcn.00402a5a
push dword [ebp - 0x18bc]
lea ecx, [ebp - 0x2c]
call fcn.004029c1
jmp 0x4055bf
lea edx, [ebp - 0x1870]
lea ecx, [ebp - 0x18e0]
call fcn.004072fa
mov eax, dword [eax + 4]
lea edx, [ebp - 0x1870]
lea ecx, [ebp - 0x18e0]
mov dword [ebp - 0x1874], eax
call fcn.004072fa
mov eax, dword [eax]
mov dword [ebp - 0x1880], eax
cmp eax, dword [ebp - 0x1874]
je 0x4054da
mov ecx, dword [esi + 0xc]
cmp dword [eax], ecx
je 0x4054da
add eax, 4
mov dword [ebp - 0x1880], eax
cmp eax, dword [ebp - 0x1874]
jne 0x4054c5
lea edx, [ebp - 0x1870]
lea ecx, [ebp - 0x18e0]
call fcn.004072fa
mov ecx, dword [ebp - 0x1880]
cmp ecx, dword [eax + 4]
jne 0x4055a0
push dword [ebp - 0x18bc]
lea ecx, [ebp - 0x64]
call fcn.004029c1
lea eax, [ebp - 0x1878]
mov byte [ebp - 4], 0xa
call fcn.0040dcd7
mov ecx, dword [ebp - 0x187c]
push esi
lea eax, [ebp - 0x1888]
push eax
lea eax, [ebp - 0x64]
push eax
call fcn.00406eda
push eax
call fcn.00407055
push ebx
push 1
lea ecx, [ebp - 0x64]
mov byte [ebp - 4], 2
call fcn.00402a5a
mov esi, dword [ebp - 0x1878]
push dword [esi + 0xc]
call dword [sym.imp.WS2_32.dll_inet_ntoa]
push eax
lea ecx, [ebp - 0x2c]
mov dword [ebp - 0x18], 0xf
mov dword [ebp - 0x1c], ebx
mov byte [ebp - 0x2c], bl
call fcn.004016a4
mov byte [ebp - 4], 0xb
cmp dword [ebp - 0x18], 0x10
mov eax, dword [ebp - 0x2c]
jae 0x405578
lea eax, [ebp - 0x2c]
push eax
call edi
mov ecx, dword [0x4d4770]
push eax
push str._WARN___d___remove_host_ip__s_
call fcn.00414401
add esp, 0xc
push ebx
push 1
lea ecx, [ebp - 0x2c]
mov byte [ebp - 4], 2
call fcn.00401587
jmp 0x4055b1
lea eax, [ebp - 0x1878]
call fcn.0040dcd7
mov esi, dword [ebp - 0x1878]
push dword [ebp - 0x18bc]
lea ecx, [ebp - 0x2c]
call fcn.004029c1
mov ecx, dword [ebp - 0x187c]
lea eax, [ebp - 0x2c]
push eax
mov byte [ebp - 4], 9
call fcn.00406eda
cmp dword [eax + 4], esi
push ebx
push 1
lea ecx, [ebp - 0x2c]
setne byte [ebp - 0x1869]
mov byte [ebp - 4], 2
call fcn.00402a5a
cmp byte [ebp - 0x1869], bl
jne 0x405487
push dword [ebp - 0x18bc]
lea ecx, [ebp - 0x2c]
call fcn.004029c1
mov ecx, dword [ebp - 0x187c]
lea eax, [ebp - 0x2c]
push eax
mov byte [ebp - 4], 0xc
call fcn.00406eda
push dword [eax + 8]
call edi
mov ecx, dword [0x4d4770]
push eax
push str._INFO___d___init_host__vaild_ip_count__d_
call fcn.00414401
add esp, 0xc
push ebx
push 1
lea ecx, [ebp - 0x2c]
mov byte [ebp - 4], 2
call fcn.00402a5a
push dword [ebp - 0x18bc]
lea ecx, [ebp - 0x2c]
call fcn.004029c1
mov ecx, dword [ebp - 0x187c]
lea eax, [ebp - 0x2c]
push eax
mov byte [ebp - 4], 0xd
call fcn.00406eda
cmp dword [eax + 8], ebx
push ebx
push 1
lea ecx, [ebp - 0x2c]
setne byte [ebp - 0x1869]
call fcn.00402a5a
lea eax, [ebp - 0x18e0]
push eax
mov byte [ebp - 4], bl
call fcn.0040738e
push dword [ebp - 0x1884]
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov al, byte [ebp - 0x1869]
jmp 0x4056b4
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push eax
push str._ERROR___d___init_host_name_is_empty.
mov ecx, dword [0x4d4770]
call fcn.00414401
pop ecx
xor al, al
pop ecx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0047a0fb
leave
ret