Function at 0x40b280
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 0x587f79
mov eax, dword fs:[0]
push eax
sub esp, 0x50c
mov eax, dword [0x5ef60c]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x464], eax
xor esi, esi
mov dword [ebp - 4], esi
push 0x5b95a8
lea ecx, [ebp - 0x444]
mov dword [ebp - 0x454], esi
xor ebx, ebx
mov dword [ebp - 0x450], esi
mov dword [ebp - 0x430], esi
mov dword [ebp - 0x448], esi
call fcn.00401a30
push 0x5b95a8
lea ecx, [ebp - 0x46c]
mov byte [ebp - 4], 1
call fcn.00401a30
push 0x5b95a8
lea ecx, [ebp - 0x440]
mov byte [ebp - 4], 2
call fcn.00401a30
push 0x208
lea ecx, [ebp - 0x428]
push esi
mov byte [ebp - 4], 3
push ecx
mov dword [ebp - 0x458], esi
call fcn.0055b030
mov edx, dword [ebp + 8]
add esp, 0xc
cmp dword [edx - 0xc], esi
je 0x40bc80
push 0x208
lea eax, [ebp - 0x220]
push esi
push eax
mov dword [ebp - 0x42c], esi
mov dword [ebp - 0x438], esi
call fcn.0055b030
lea ecx, [ebp - 0x42c]
push ecx
lea edi, [ebp - 0x434]
lea ecx, [ebp - 0x438]
mov dword [ebp - 0x434], esi
call fcn.0040bd70
add esp, 0x10
cmp eax, esi
je 0x40b950
mov eax, dword [ebp - 0x434]
cmp eax, 1
jne 0x40b526
mov edx, dword [ebp - 0x42c]
push edx
lea ecx, [ebp - 0x440]
call fcn.004019e0
mov ecx, SysReAllocString
mov eax, str.http:__
mov edi, edi
cmp word [eax], si
je 0x40b46c
add eax, 2
sub ecx, 1
jne 0x40b3b0
xor eax, eax
mov edx, dword [ebp - 0x42c]
lea esi, [eax + eax]
mov eax, esi
mov ecx, str.http:__
mov edi, edx
cmp eax, 4
jb 0x40b3f4
lea ebx, [ebx]
mov ebx, dword [edi]
cmp ebx, dword [ecx]
jne 0x40b45e
sub eax, 4
add ecx, 4
add edi, 4
cmp eax, 4
jae 0x40b3e0
test eax, eax
je 0x40b418
mov bl, byte [ecx]
cmp bl, byte [edi]
jne 0x40b45e
cmp eax, 1
jbe 0x40b418
mov bl, byte [ecx + 1]
cmp bl, byte [edi + 1]
jne 0x40b45e
cmp eax, 2
jbe 0x40b418
mov al, byte [ecx + 2]
cmp al, byte [edi + 2]
jne 0x40b45e
mov eax, esi
mov ecx, str.HTTP:__
mov edi, edx
cmp eax, 4
jb 0x40b43a
mov edx, dword [edi]
cmp edx, dword [ecx]
jne 0x40b45e
sub eax, 4
add ecx, 4
add edi, 4
cmp eax, 4
jae 0x40b426
test eax, eax
je 0x40b480
mov dl, byte [ecx]
cmp dl, byte [edi]
jne 0x40b45e
cmp eax, 1
jbe 0x40b480
mov dl, byte [ecx + 1]
cmp dl, byte [edi + 1]
jne 0x40b45e
cmp eax, 2
jbe 0x40b480
mov al, byte [ecx + 2]
cmp al, byte [edi + 2]
je 0x40b480
mov ecx, dword [ebp - 0x42c]
push ecx
push str.http:___s
jmp 0x40b48c
cmp ecx, esi
je 0x40b3c1
mov eax, SysReAllocString
sub eax, ecx
jmp 0x40b3c3
mov edx, dword [ebp - 0x42c]
push edx
push 0x5b941c
mov ecx, 0x104
lea ebx, [ebp - 0x220]
call fcn.004035c0
add esp, 8
push 0x3c
lea eax, [ebp - 0x4dc]
push 0
push eax
call fcn.0055b030
add esp, 0xc
or eax, 0xffffffff
mov dword [ebp - 0x4d4], eax
mov dword [ebp - 0x4c8], eax
mov dword [ebp - 0x4ac], eax
mov dword [ebp - 0x4dc], 0x3c
mov ecx, 0x104
mov eax, ebx
cmp word [eax], 0
je 0x40b519
add eax, 2
sub ecx, 1
jne 0x40b4d8
xor eax, eax
lea ecx, [ebp - 0x4dc]
push ecx
push 0
push eax
lea edx, [ebp - 0x220]
push edx
call dword [sym.imp.WINHTTP.dll_WinHttpCrackUrl]
test eax, eax
je 0x40bc80
mov ebx, dword [ebp - 0x4cc]
mov edi, 3
xor esi, esi
jmp 0x40b954
test ecx, ecx
je 0x40b4e6
mov eax, 0x104
sub eax, ecx
jmp 0x40b4e8
cmp eax, 2
jne 0x40b950
mov eax, dword [ebp - 0x438]
push eax
lea ecx, [ebp - 0x440]
call fcn.004019e0
xor edi, edi
push 0x208
mov dword [ebp - 0x43c], edi
mov dword [ebp - 0x42c], esi
mov byte [ebp - 4], 4
call fcn.0045de9b
add esp, 4
mov dword [ebp - 0x434], eax
mov dword [ebp - 4], 3
cmp eax, esi
je 0x40b92d
push 0x208
mov esi, eax
push edi
push esi
mov byte [ebp - 4], 6
call fcn.0055b030
mov edx, dword [ebp + 8]
add esp, 0xc
mov eax, esi
mov ebx, SysReAllocString
mov edi, 0x104
xor esi, esi
jmp 0x40b5a0
test edi, edi
je 0x40b5be
test ebx, ebx
je 0x40b5c1
movzx ecx, word [edx]
test cx, cx
je 0x40b5c1
mov word [eax], cx
add eax, 2
add edx, 2
dec edi
dec ebx
inc esi
jmp 0x40b5a0
sub eax, 2
mov edx, dword [ebp - 0x42c]
xor ecx, ecx
mov word [eax], cx
xor esi, esi
push esi
xor eax, eax
push eax
mov eax, dword [ebp - 0x43c]
push edx
push eax
push str.PCAgent_Downloader
call dword [sym.imp.WINHTTP.dll_WinHttpOpen]
mov edi, eax
cmp edi, esi
jne 0x40b602
push 0x5de3a0
lea ecx, [ebp - 0x478]
push ecx
mov dword [ebp - 0x478], esi
call fcn.0055ad30
push 0x1d4c0
push 0x1d4c0
push 0x1d4c0
push 0x1d4c0
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpSetTimeouts]
cmp eax, esi
jne 0x40b638
push 0x5de3a0
lea edx, [ebp - 0x460]
push edx
mov dword [ebp - 0x460], esi
call fcn.0055ad30
push 0x3c
lea eax, [ebp - 0x518]
push esi
push eax
call fcn.0055b030
mov ebx, dword [ebp - 0x434]
or eax, 0xffffffff
add esp, 0xc
mov dword [ebp - 0x518], 0x3c
mov dword [ebp - 0x510], eax
mov dword [ebp - 0x504], eax
mov dword [ebp - 0x4e8], eax
cmp ebx, esi
je 0x40b69d
mov eax, 0x104
mov ecx, ebx
xor esi, esi
mov edx, eax
mov edi, edi
test eax, eax
je 0x40b690
cmp word [ecx], 0
je 0x40b6a1
add ecx, 2
dec eax
jmp 0x40b680
mov esi, 0x80070057
xor eax, eax
test esi, esi
jge 0x40b6ab
xor esi, esi
xor eax, eax
jmp 0x40b6ad
test esi, esi
jl 0x40b695
sub edx, eax
mov eax, edx
jmp 0x40b697
xor esi, esi
lea ecx, [ebp - 0x518]
push ecx
push esi
lea edx, [eax + eax]
push edx
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpCrackUrl]
cmp eax, esi
jne 0x40b6db
push 0x5de3a0
lea eax, [ebp - 0x47c]
push eax
mov dword [ebp - 0x47c], esi
call fcn.0055ad30
mov ecx, dword [ebp - 0x438]
xor eax, eax
mov dword [ebp - 0x4a0], eax
mov dword [ebp - 0x498], eax
mov dword [ebp - 0x48c], eax
lea edx, [ebp - 0x488]
push edx
mov dword [ebp - 0x49c], eax
mov dword [ebp - 0x494], eax
mov dword [ebp - 0x490], eax
mov dword [ebp - 0x488], eax
mov dword [ebp - 0x484], eax
mov dword [ebp - 0x480], eax
lea eax, [ebp - 0x4a0]
mov dword [ebp - 0x498], ecx
mov ecx, dword [ebp - 0x514]
push eax
push ecx
push edi
mov dword [ebp - 0x4a0], 2
mov dword [ebp - 0x48c], 1
call dword [sym.imp.WINHTTP.dll_WinHttpGetProxyForUrl]
cmp eax, esi
jne 0x40b76a
push 0x5de3a0
lea edx, [ebp - 0x468]
push edx
mov dword [ebp - 0x468], esi
call fcn.0055ad30
mov eax, SysReAllocString
mov ecx, str.http:__
xor edi, edi
mov edx, eax
cmp eax, esi
je 0x40b787
cmp word [ecx], si
je 0x40b7c6
add ecx, 2
dec eax
jmp 0x40b778
mov edi, 0x80070057
xor esi, esi
test edi, edi
jge 0x40b794
xor esi, esi
mov edx, dword [ebp - 0x484]
test edx, edx
je 0x40b921
lea eax, [esi + esi]
mov ecx, str.http:__
mov edi, edx
lea esp, [esp]
cmp eax, 4
jb 0x40b7d0
mov ebx, dword [edi]
cmp ebx, dword [ecx]
jne 0x40b83a
sub eax, 4
add ecx, 4
add edi, 4
jmp 0x40b7b0
cmp edi, esi
jl 0x40b78c
sub edx, eax
mov esi, edx
jmp 0x40b78e
test eax, eax
je 0x40b7f4
mov bl, byte [ecx]
cmp bl, byte [edi]
jne 0x40b83a
cmp eax, 1
jbe 0x40b7f4
mov bl, byte [ecx + 1]
cmp bl, byte [edi + 1]
jne 0x40b83a
cmp eax, 2
jbe 0x40b7f4
mov al, byte [ecx + 2]
cmp al, byte [edi + 2]
jne 0x40b83a
lea eax, [esi + esi]
mov ecx, str.HTTP:__
mov edi, edx
mov edi, edi
cmp eax, 4
jb 0x40b816
mov esi, dword [edi]
cmp esi, dword [ecx]
jne 0x40b83a
sub eax, 4
add ecx, 4
add edi, 4
jmp 0x40b800
test eax, eax
je 0x40b842
mov bl, byte [ecx]
cmp bl, byte [edi]
jne 0x40b83a
cmp eax, 1
jbe 0x40b842
mov bl, byte [ecx + 1]
cmp bl, byte [edi + 1]
jne 0x40b83a
cmp eax, 2
jbe 0x40b842
mov cl, byte [ecx + 2]
cmp cl, byte [edi + 2]
je 0x40b842
push edx
push str.http:___s
jmp 0x40b848
push edx
push 0x5b941c
mov ecx, 0x104
lea ebx, [ebp - 0x220]
call fcn.004035c0
add esp, 8
push 0x3c
lea edx, [ebp - 0x518]
push 0
push edx
call fcn.0055b030
or eax, 0xffffffff
mov dword [ebp - 0x510], eax
mov dword [ebp - 0x504], eax
mov dword [ebp - 0x4e8], eax
mov eax, 0x104
add esp, 0xc
mov dword [ebp - 0x518], 0x3c
mov ecx, ebx
xor edi, edi
mov edx, eax
test eax, eax
je 0x40b8a8
cmp word [ecx], 0
je 0x40b8e7
add ecx, 2
dec eax
jmp 0x40b898
mov edi, 0x80070057
xor eax, eax
test edi, edi
jge 0x40b8b5
xor eax, eax
lea ecx, [ebp - 0x518]
push ecx
push 0
push eax
lea edx, [ebp - 0x220]
push edx
call dword [sym.imp.WINHTTP.dll_WinHttpCrackUrl]
test eax, eax
jne 0x40b909
mov dword [ebp - 0x474], eax
push 0x5de3a0
lea eax, [ebp - 0x474]
push eax
call fcn.0055ad30
test edi, edi
jl 0x40b8ad
sub edx, eax
mov eax, edx
jmp 0x40b8af
mov ebx, dword [ebp - 0x508]
mov dword [ebp - 0x43c], 3
mov edi, dword [ebp - 0x43c]
jmp 0x40b925
xor ebx, ebx
mov edi, ebx
mov eax, dword [ebp - 0x434]
xor esi, esi
mov dword [ebp - 4], 3
cmp eax, esi
je 0x40b954
push eax
call fcn.0045dea6
add esp, 4
jmp 0x40b954
xor edi, edi
xor ebx, ebx
cmp dword [ebp - 0x42c], esi
mov esi, dword [sym.imp.KERNEL32.dll_GlobalHandle]
je 0x40b982
mov ecx, dword [ebp - 0x42c]
push ecx
call esi
push eax
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov edx, dword [ebp - 0x42c]
push edx
call esi
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
cmp dword [ebp - 0x438], 0
je 0x40b9ab
mov eax, dword [ebp - 0x438]
push eax
call esi
push eax
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov ecx, dword [ebp - 0x438]
push ecx
call esi
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
push 0
push 0
push ebx
push edi
push str.PCAgent_Downloader
call dword [sym.imp.WINHTTP.dll_WinHttpOpen]
mov edi, eax
test edi, edi
je 0x40bc4c
push 0x1d4c0
push 0x1d4c0
push 0x1d4c0
push 0x1d4c0
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpSetTimeouts]
test eax, eax
je 0x40bc4c
push 0x3c
lea edx, [ebp - 0x4dc]
push 0
push edx
call fcn.0055b030
or eax, 0xffffffff
add esp, 0xc
mov dword [ebp - 0x4d4], eax
mov dword [ebp - 0x4c8], eax
mov dword [ebp - 0x4ac], eax
mov eax, dword [ebp + 8]
lea edx, [ebp - 0x4dc]
push edx
mov dword [ebp - 0x4dc], 0x3c
mov ecx, dword [eax - 0xc]
push 0
push ecx
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpCrackUrl]
test eax, eax
je 0x40bc4c
mov edx, dword [ebp - 0x4cc]
test edx, edx
jne 0x40ba48
xor eax, eax
jmp 0x40ba5f
mov eax, edx
lea esi, [eax + 2]
lea ecx, [ecx]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40ba50
sub eax, esi
sar eax, 1
push eax
push edx
lea ecx, [ebp - 0x444]
call fcn.00401e90
mov eax, dword [ebp - 0x4c8]
push eax
lea ecx, [ebp - 0x450]
push ecx
lea ecx, [ebp - 0x444]
call fcn.0040bfe0
mov edx, dword [ebp - 0x4c4]
mov eax, dword [eax]
push 0
push edx
push eax
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpConnect]
mov esi, eax
mov eax, dword [ebp - 0x450]
add eax, 0xfffffff0
mov dword [ebp - 0x448], esi
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40bac2
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
test esi, esi
je 0x40bc4c
mov ecx, dword [ebp - 0x4b0]
mov edx, dword [ebp - 0x448]
xor eax, eax
cmp dword [ebp - 0x4d0], 2
setne al
dec eax
and eax, 0x800000
push eax
push 0
push 0
push str.HTTP_1.1
push ecx
push 0x5ba514
push edx
call dword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov dword [ebp - 0x430], eax
test eax, eax
je 0x40bc66
push 0
push 0xffffffffffffffff
push str.Content_Type:_application_x_www_unknown_r_n
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpAddRequestHeaders]
test eax, eax
je 0x40bc4c
mov ecx, dword [ebp - 0x430]
mov esi, dword [sym.imp.WINHTTP.dll_WinHttpSetOption]
push 4
lea eax, [ebp - 0x458]
push eax
push 0x58
push ecx
mov dword [ebp - 0x458], 0
call esi
test eax, eax
je 0x40bc4c
mov eax, dword [ebp - 0x430]
push 4
lea edx, [ebp - 0x470]
push edx
push 0x1f
push eax
mov dword [ebp - 0x470], 0x1100
call esi
test eax, eax
je 0x40bc4c
mov ecx, dword [ebp - 0x430]
push 0
push 0
push 0
push 0
push 0
push 0
push ecx
call dword [sym.imp.WINHTTP.dll_WinHttpSendRequest]
test eax, eax
je 0x40bc4c
mov edx, dword [ebp - 0x430]
push 0
push edx
call dword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
test eax, eax
je 0x40bc4c
push 0x208
lea eax, [ebp - 0x428]
push 0
push eax
mov dword [ebp - 0x45c], 0
call fcn.0055b030
mov eax, dword [ebp - 0x430]
mov esi, dword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
add esp, 0xc
push 0
lea ecx, [ebp - 0x44c]
push ecx
lea edx, [ebp - 0x45c]
push edx
push 0
push 0x20000013
push eax
mov dword [ebp - 0x44c], 4
call esi
test eax, eax
je 0x40bc4c
mov eax, dword [ebp - 0x45c]
cmp eax, 0x12d
je 0x40bc17
cmp eax, 0x12e
jne 0x40bc4c
mov eax, dword [ebp - 0x430]
push 0
lea ecx, [ebp - 0x44c]
push ecx
lea edx, [ebp - 0x428]
push edx
push 0
push 0x21
push eax
mov dword [ebp - 0x44c], 0x104
call esi
test eax, eax
je 0x40bc4c
mov dword [ebp - 0x454], 1
cmp dword [ebp - 0x430], 0
je 0x40bc66
mov ecx, dword [ebp - 0x430]
mov esi, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
push ecx
call esi
jmp 0x40bc6c
mov esi, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov eax, dword [ebp - 0x448]
test eax, eax
je 0x40bc79
push eax
call esi
test edi, edi
je 0x40bc80
push edi
call esi
lea eax, [ebp - 0x428]
lea edx, [eax + 2]
lea esp, [esp]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40bc90
mov ecx, dword [ebp - 0x464]
sub eax, edx
sar eax, 1
push eax
lea edx, [ebp - 0x428]
push edx
call fcn.00401e90
mov byte [ebp - 4], 2
mov eax, dword [ebp - 0x440]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40bcd8
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [ebp - 4], 1
mov eax, dword [ebp - 0x46c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40bcfe
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [ebp - 4], 0
mov eax, dword [ebp - 0x444]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40bd24
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp + 8]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40bd4a
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x454]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.0055799e
mov esp, ebp
pop ebp
ret