Function at 0x403198
Capabilities:
Initialize winhttp library
Prepare http request
Read http header
Receive http response
Reference http user-agent string

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffff6c
push ebx
push esi
push edi
mov edi, dword [ebp + 0x14]
mov esi, dword [ebp + 8]
mov eax, 0x47996c
call fcn.0046aaa8
test esi, esi
je 0x4031c8
push esi
call sub.KERNEL32.DLL_lstrlenW
test eax, eax
je 0x4031c8
cmp dword [ebp + 0xc], 0
jne 0x4031d9
xor eax, eax
mov edx, dword [ebp - 0x74]
mov dword fs:[0], edx
jmp 0x4034c6
xor ecx, ecx
xor ebx, ebx
mov dword [ebp - 0x7c], ecx
xor eax, eax
mov byte [ebp - 0x7d], 0
mov dword [ebp - 0x8c], 4
mov dword [ebp - 0x94], eax
lea edx, [ebp - 0x28]
mov word [ebp - 0x64], 0xc
push edx
call fcn.004034d0
pop ecx
inc dword [ebp - 0x58]
mov word [ebp - 0x64], 0x18
mov word [ebp - 0x64], 0x24
lea ecx, [ebp - 0x50]
push ecx
call fcn.004034d0
pop ecx
lea eax, [ebp - 0x50]
inc dword [ebp - 0x58]
lea edx, [ebp - 0x28]
mov word [ebp - 0x64], 0x18
push eax
push edx
push esi
call fcn.004030b8
add esp, 0xc
lea ecx, [ebp - 0x28]
push ecx
call fcn.00403544
pop ecx
test eax, eax
je 0x403255
lea eax, [ebp - 0x50]
push eax
call fcn.00403544
pop ecx
test eax, eax
jne 0x40328a
xor eax, eax
lea edx, [ebp - 0x50]
push eax
dec dword [ebp - 0x58]
push 2
push edx
call fcn.0040351c
add esp, 8
dec dword [ebp - 0x58]
push 2
lea ecx, [ebp - 0x28]
push ecx
call fcn.0040351c
add esp, 8
pop eax
mov edx, dword [ebp - 0x74]
mov dword fs:[0], edx
jmp 0x4034c6
push 0
push 0
push 0
push 0
push 0x47985a
call sub.WINHTTP.DLL_WinHttpOpen
mov dword [ebp - 0x78], eax
cmp dword [ebp - 0x78], 0
je 0x40346d
cmp byte [edi], 0
jne 0x40346d
push 0
push 0
lea ecx, [ebp - 0x28]
push ecx
call fcn.00403550
pop ecx
push eax
mov eax, dword [ebp - 0x78]
push eax
call sub.WINHTTP.DLL_WinHttpConnect
mov dword [ebp - 0x7c], eax
cmp dword [ebp - 0x7c], 0
je 0x40346d
cmp byte [edi], 0
jne 0x40346d
push 0x100
push 0
push 0
push 0
lea edx, [ebp - 0x50]
push edx
call fcn.00403550
pop ecx
push eax
push 0x479928
mov ecx, dword [ebp - 0x7c]
push ecx
call sub.WINHTTP.DLL_WinHttpOpenRequest
mov ebx, eax
test ebx, ebx
je 0x40346d
cmp byte [edi], 0
jne 0x40346d
push 0
push 0
push 0
push 0
push 0
push 0
push ebx
call sub.WINHTTP.DLL_WinHttpSendRequest
push 0
push ebx
call sub.WINHTTP.DLL_WinHttpReceiveResponse
mov esi, eax
test esi, esi
je 0x40346d
cmp byte [edi], 0
jne 0x40346d
push 0
lea eax, [ebp - 0x8c]
push eax
lea edx, [ebp - 0x88]
push edx
push 0
push 0x20000005
push ebx
call sub.WINHTTP.DLL_WinHttpQueryHeaders
mov esi, eax
test esi, esi
je 0x40346d
cmp byte [edi], 0
jne 0x40346d
mov eax, dword [ebp + 0x10]
push eax
mov edx, dword [ebp - 0x88]
push edx
push 0
push 1
call dword [ebp + 0xc]
add esp, 0x10
xor ecx, ecx
lea eax, [ebp - 0x84]
mov dword [ebp - 0x84], ecx
push eax
push ebx
call sub.WINHTTP.DLL_WinHttpQueryDataAvailable
mov esi, eax
test eax, eax
je 0x40341e
push 0x47cb50
mov edx, dword [ebp - 0x84]
push edx
call fcn.00466380
add esp, 8
test eax, eax
setne dl
and edx, 1
mov dword [0x479854], eax
mov esi, edx
test esi, esi
je 0x40341e
lea eax, [ebp - 0x90]
mov ecx, dword [0x479854]
push eax
mov edx, dword [ebp - 0x84]
push edx
push ecx
push ebx
call sub.WINHTTP.DLL_WinHttpReadData
mov esi, eax
test eax, eax
je 0x403411
mov edx, dword [ebp + 0x10]
push edx
mov ecx, dword [ebp - 0x90]
push ecx
mov eax, dword [0x479854]
push eax
push 2
call dword [ebp + 0xc]
add esp, 0x10
mov edx, dword [ebp - 0x90]
add dword [ebp - 0x94], edx
mov ecx, dword [0x479854]
push ecx
call fcn.0045f510
pop ecx
cmp dword [ebp - 0x84], 0
je 0x403434
test esi, esi
je 0x403434
cmp byte [edi], 0
je 0x403389
test esi, esi
je 0x40344b
mov eax, dword [ebp - 0x94]
cmp eax, dword [ebp - 0x88]
jne 0x40344b
cmp byte [edi], 0
je 0x40344f
xor edx, edx
jmp 0x403454
mov edx, 1
mov byte [ebp - 0x7d], dl
cmp byte [ebp - 0x7d], 0
je 0x40346d
mov ecx, dword [ebp + 0x10]
push ecx
push 0
push 0
push 3
call dword [ebp + 0xc]
add esp, 0x10
test ebx, ebx
je 0x403477
push ebx
call sub.WINHTTP.DLL_WinHttpCloseHandle
cmp dword [ebp - 0x7c], 0
je 0x403486
mov eax, dword [ebp - 0x7c]
push eax
call sub.WINHTTP.DLL_WinHttpCloseHandle
cmp dword [ebp - 0x78], 0
je 0x403495
mov edx, dword [ebp - 0x78]
push edx
call sub.WINHTTP.DLL_WinHttpCloseHandle
mov al, byte [ebp - 0x7d]
lea edx, [ebp - 0x50]
push eax
dec dword [ebp - 0x58]
push 2
push edx
call fcn.0040351c
add esp, 8
dec dword [ebp - 0x58]
push 2
lea ecx, [ebp - 0x28]
push ecx
call fcn.0040351c
add esp, 8
pop eax
mov edx, dword [ebp - 0x74]
mov dword fs:[0], edx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret