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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x41f850
mov eax, dword fs:[0]
push eax
sub esp, 0x40
push ebx
push esi
push edi
mov eax, dword [0x42bba8]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
mov dword [ebp - 0x18], esi
lea ecx, [ebp - 0x4c]
call fcn.00405ad0
mov edx, dword [esi]
mov dword [ebp - 4], 0
test edx, edx
je 0x406d38
mov eax, edx
lea edi, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x406d17
sub eax, edi
sar eax, 1
push eax
push edx
lea ecx, [ebp - 0x48]
call fcn.00403600
lea ecx, [ebp - 0x4c]
call fcn.004064a0
mov eax, dword [esi + 4]
push 0
push 0
push 0
push 0
push eax
mov byte [ebp - 4], 1
call dword [sym.imp.WINHTTP.dll_WinHttpOpen]
mov esi, eax
mov dword [ebp - 0x20], esi
test esi, esi
jne 0x406d64
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
jmp 0x407091
lea eax, [ebp - 0x14]
push eax
lea ecx, [ebp - 0x4c]
mov dword [ebp - 0x30], esi
call fcn.00405c00
lea ecx, [ebp - 0x1c]
push ecx
lea ecx, [ebp - 0x4c]
mov byte [ebp - 4], 2
call fcn.00405c60
mov edi, eax
lea edx, [ebp - 0x24]
push edx
lea ecx, [ebp - 0x4c]
mov byte [ebp - 4], 3
call fcn.00405c30
push edi
push eax
lea eax, [ebp - 0x10]
push eax
mov byte [ebp - 4], 4
call fcn.00406040
add esp, 0xc
mov eax, dword [ebp - 0x24]
add eax, 0xfffffff0
mov byte [ebp - 4], 6
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x406dca
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x1c]
add eax, 0xfffffff0
mov byte [ebp - 4], 7
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x406ded
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov edi, dword [ebp - 0x34]
mov edx, dword [ebp - 0x14]
mov ecx, edi
neg ecx
push 0
sbb ecx, ecx
and ecx, 0x1bb
push ecx
push edx
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpConnect]
mov ebx, eax
mov dword [ebp - 0x24], ebx
test ebx, ebx
jne 0x406e8d
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
mov eax, dword [ebp - 0x10]
add eax, 0xfffffff0
mov byte [ebp - 4], 2
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x406e3e
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x14]
add eax, 0xfffffff0
mov byte [ebp - 4], 1
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x406e61
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
lea ecx, [ebp - 0x4c]
mov dword [ebp - 4], 0xffffffff
call fcn.00405b50
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov dword [ebp - 0x2c], ebx
mov ecx, dword [ebp - 0x18]
cmp dword [ecx + 0xc], 0
mov esi, dword [sym.imp.WINHTTP.dll_WinHttpSetOption]
je 0x406eb7
mov eax, dword [ebp - 0x20]
push 4
mov edx, ecx
add edx, 8
push edx
push 3
push eax
call esi
test eax, eax
je 0x407034
mov ecx, dword [ebp - 0x10]
neg edi
sbb edi, edi
and edi, 0x800000
add edi, 0x100
push edi
push 0
push 0
push 0
push ecx
push 0
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov ebx, eax
test ebx, ebx
jne 0x406f0e
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [ebp - 0x24]
mov edi, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
push edx
mov esi, eax
call edi
lea ecx, [ebp - 0x10]
call fcn.004034a0
lea ecx, [ebp - 0x14]
call fcn.004034a0
mov eax, dword [ebp - 0x20]
push eax
jmp 0x40708f
mov dword [ebp - 0x28], ebx
mov edi, dword [ebp - 0x18]
cmp dword [edi + 0xc], 0
mov byte [ebp - 4], 9
je 0x406f31
push 4
add edi, 8
push edi
push 5
push ebx
call esi
push 4
push edi
push 6
push ebx
call esi
push 0
push 0
push 0
push 0
push 0
push 0
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpSendRequest]
test eax, eax
jne 0x406f7d
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [ebp - 0x28]
mov esi, eax
call fcn.004058e0
lea ecx, [ebp - 0x2c]
call fcn.004058e0
lea ecx, [ebp - 0x10]
call fcn.004034a0
lea ecx, [ebp - 0x14]
call fcn.004034a0
lea ecx, [ebp - 0x30]
call fcn.004058e0
jmp 0x407091
xor esi, esi
push esi
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
cmp eax, esi
je 0x407026
mov eax, dword [ebp + 0xc]
push esi
lea ecx, [ebp + 0xc]
push ecx
push eax
push esi
push 0x20000013
push ebx
mov dword [eax], esi
mov dword [ebp + 0xc], 4
call dword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
mov dword [ebp - 0x1c], esi
mov dword [ebp + 0xc], esi
lea edx, [ebp + 0xc]
push edx
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpQueryDataAvailable]
test eax, eax
je 0x407020
mov eax, dword [ebp + 0xc]
push eax
call fcn.0040fa90
mov ecx, dword [ebp + 0xc]
push ecx
mov edi, eax
push 0
push edi
call fcn.0040fbc0
mov eax, dword [ebp + 0xc]
add esp, 0x10
lea edx, [ebp - 0x1c]
push edx
push eax
push edi
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpReadData]
test eax, eax
je 0x407013
mov eax, dword [ebp - 0x1c]
test eax, eax
je 0x407013
xor esi, esi
test eax, eax
je 0x407013
mov edi, edi
movzx ecx, byte [esi + edi]
push ecx
mov ecx, dword [ebp + 8]
call fcn.00405900
inc esi
cmp esi, dword [ebp - 0x1c]
jb 0x407000
test edi, edi
je 0x407020
push edi
call fcn.00410e5c
add esp, 4
cmp dword [ebp + 0xc], 0
ja 0x406fb4
mov edi, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
push ebx
call edi
mov ebx, dword [ebp - 0x24]
jmp 0x40703a
mov edi, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
push ebx
call edi
mov eax, dword [ebp - 0x10]
add eax, 0xfffffff0
mov byte [ebp - 4], 2
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x407060
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x14]
add eax, 0xfffffff0
mov byte [ebp - 4], 1
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x407083
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp - 0x20]
mov esi, eax
push ecx
call edi
lea ecx, [ebp - 0x4c]
mov dword [ebp - 4], 0xffffffff
call fcn.00405b50
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8