Function at 0x405bec
Capabilities:
Initialize winhttp library
Prepare http request
Receive http response

Disassembly:
push ebp
mov ebp, esp
push edi
push ebx
sub esp, 0x1c0
mov dword [ebp - 0x19c], ecx
mov dword [ebp - 0xc], 0
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x14], 2
mov dword [ebp - 0x38], 0x100
mov byte [ebp - 0x15], 0
mov byte [ebp - 0x16], 1
mov byte [ebp - 0x15], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], str.Mazinger_Agent_1.1
mov eax, dword [sym.imp.WINHTTP.dll_WinHttpOpen]
call eax
sub esp, 0x14
mov dword [ebp - 0x3c], eax
cmp dword [ebp - 0x3c], 0
jne 0x405c70
mov eax, 1
jmp 0x406578
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x10000
mov dword [esp + 4], 0x405b26
mov eax, dword [ebp - 0x3c]
mov dword [esp], eax
mov eax, dword [sym.imp.WINHTTP.dll_WinHttpSetStatusCallback]
call eax
sub esp, 0x10
mov dword [esp + 0x10], 0x1d4c0
mov dword [esp + 0xc], 0xea60
mov dword [esp + 8], 0x3a98
mov dword [esp + 4], 0x1388
mov eax, dword [ebp - 0x3c]
mov dword [esp], eax
mov eax, dword [sym.imp.WINHTTP.dll_WinHttpSetTimeouts]
call eax
sub esp, 0x14
lea eax, [ebp - 0x60]
mov edx, dword [ebp + 8]
mov dword [esp + 4], edx
mov dword [esp], eax
call fcn.00403c42
mov eax, dword [ebp + 0xc]
movzx ebx, ax
lea eax, [ebp - 0x60]
mov ecx, eax
call fcn.00429ee0
mov dword [esp + 0xc], 0
mov dword [esp + 8], ebx
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x3c]
mov dword [esp], eax
mov eax, dword [sym.imp.WINHTTP.dll_WinHttpConnect]
call eax
sub esp, 0x10
mov dword [ebp - 0x34], eax
cmp dword [ebp - 0x34], 0
je 0x405db5
mov eax, dword [ebp - 0x19c]
mov eax, dword [eax + 4]
mov dword [esp + 0x18], 0x800000
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], eax
mov dword [esp + 4], 0x43b7a2
mov eax, dword [ebp - 0x34]
mov dword [esp], eax
mov eax, dword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
call eax
sub esp, 0x1c
mov dword [ebp - 0x10], eax
mov dword [ebp - 0x64], 0x1d4c0
mov dword [esp + 0xc], 4
lea eax, [ebp - 0x64]
mov dword [esp + 8], eax
mov dword [esp + 4], 6
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
mov eax, dword [sym.imp.WINHTTP.dll_WinHttpSetOption]
call eax
sub esp, 0x10
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0x2f
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
mov eax, dword [sym.imp.WINHTTP.dll_WinHttpSetOption]
call eax
sub esp, 0x10
cmp dword [ebp - 0x10], 0
je 0x406065
mov eax, dword [0x455474]
test eax, eax
jle 0x405df6
mov dword [ebp - 0x68], 0x100
mov dword [esp + 0xc], 4
lea eax, [ebp - 0x68]
mov dword [esp + 8], eax
mov dword [esp + 4], 0x1f
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
mov eax, dword [sym.imp.WINHTTP.dll_WinHttpSetOption]
call eax
sub esp, 0x10
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
mov eax, dword [sym.imp.WINHTTP.dll_WinHttpSendRequest]
call eax
sub esp, 0x1c
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
je 0x406065
mov eax, dword [0x455474]
test eax, eax
jle 0x406065
mov dword [ebp - 0x70], 4
lea eax, [ebp - 0x70]
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x6c]
mov dword [esp + 8], eax
mov dword [esp + 4], 0x4e
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
mov eax, dword [sym.imp.WINHTTP.dll_WinHttpQueryOption]
call eax
sub esp, 0x10
mov dword [ebp - 0x40], eax
cmp dword [ebp - 0x40], 0
je 0x405e8d
mov eax, dword [ebp - 0x6c]
test eax, eax
jne 0x405ea5
mov dword [esp], str.No_cert_loaded
call fcn.004051d6
mov dword [ebp - 0xc], 0
jmp 0x406065
mov edx, dword [ebp - 0x6c]
mov eax, dword [ebp - 0x6c]
mov eax, dword [eax + 0x10]
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], 0xc0000
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], eax
call sub.CRYPT32.dll_CertFindCertificateInStore
sub esp, 0x18
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0
jne 0x405eec
mov eax, dword [ebp - 0x6c]
mov dword [ebp - 0x1c], eax
mov byte [ebp - 0x1d], 0
mov dword [ebp - 0x24], 0
cmp byte [ebp - 0x1d], 0
jne 0x405f64
mov eax, dword [0x455474]
cmp dword [ebp - 0x24], eax
jge 0x405f64
mov edx, dword [0x455488]
mov eax, dword [ebp - 0x24]
shl eax, 2
add eax, edx
mov eax, dword [eax]
test eax, eax
je 0x405f5e
mov edx, dword [0x455488]
mov eax, dword [ebp - 0x24]
shl eax, 2
add eax, edx
mov eax, dword [eax]
mov eax, dword [eax + 0xc]
lea edx, [eax + 0x38]
mov eax, dword [ebp - 0x1c]
mov eax, dword [eax + 0xc]
add eax, 0x38
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov dword [esp], 0x10001
call sub.CRYPT32.dll_CertComparePublicKeyInfo
sub esp, 0xc
test eax, eax
setne al
test al, al
je 0x405f5e
mov byte [ebp - 0x1d], 1
add dword [ebp - 0x24], 1
jmp 0x405ef7
movzx eax, byte [ebp - 0x1d]
xor eax, 1
test al, al
je 0x406065
lea eax, [ebp - 0x88]
mov ecx, eax
call fcn.00432ae0
lea eax, [ebp - 0x88]
mov dword [esp + 4], eax
mov dword [esp], str.ignoreCert
call fcn.004047a0
mov dword [esp + 4], 0x43b7c4
lea eax, [ebp - 0x88]
mov dword [esp], eax
call fcn.004373c4
test al, al
je 0x406058
mov dword [esp], str.Received_certificate_not_allowed_n
call fcn.00404e56
mov dword [ebp - 0x18c], 0x6b6e753c
mov dword [ebp - 0x188], 0x6e776f6e
mov dword [ebp - 0x184], 0x3e
lea edx, [ebp - 0x180]
mov eax, 0
mov ecx, 0x3d
mov edi, edx
rep stosd dword es:[edi], eax
mov dword [esp + 0x14], pe_nt_image_headers32
lea eax, [ebp - 0x18c]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 4
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sub.CRYPT32.dll_CertGetNameStringA
sub esp, 0x18
lea eax, [ebp - 0x18c]
mov dword [esp + 4], eax
mov dword [esp], str.ERROR:_Invalid_CA__s._n
call fcn.00405008
mov dword [ebp - 0xc], 0
mov dword [esp], 0x2f8f
mov eax, dword [sym.imp.KERNEL32.dll_SetLastError]
call eax
sub esp, 4
lea eax, [ebp - 0x88]
mov ecx, eax
call fcn.00433270
cmp dword [ebp - 0xc], 0
je 0x406086
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
mov eax, dword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
call eax
sub esp, 8
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
je 0x40619a
mov dword [ebp - 0x44], 0x1000
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x30], 0
mov eax, dword [ebp - 0x28]
add eax, 0x1001
cmp dword [ebp - 0x2c], eax
jae 0x4060d5
add dword [ebp - 0x2c], 0x1001
mov eax, dword [ebp - 0x2c]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
call sub.msvcrt.dll_realloc
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x8c], 0
mov edx, dword [ebp - 0x30]
mov eax, dword [ebp - 0x28]
add edx, eax
lea eax, [ebp - 0x8c]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x1000
mov dword [esp + 4], edx
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
mov eax, dword [sym.imp.WINHTTP.dll_WinHttpReadData]
call eax
sub esp, 0x10
test eax, eax
sete al
test al, al
je 0x406122
mov dword [ebp - 0x8c], 0xffffffff
jmp 0x40612b
mov eax, dword [ebp - 0x8c]
add dword [ebp - 0x28], eax
mov eax, dword [ebp - 0x8c]
test eax, eax
je 0x40613a
jmp 0x4060ac
cmp dword [ebp - 0x28], 0
je 0x40619a
mov edx, dword [ebp - 0x30]
mov eax, dword [ebp - 0x28]
add eax, edx
mov byte [eax], 0
mov dword [esp], 8
call fcn.00437b80
mov ebx, eax
mov eax, dword [ebp - 0x28]
add eax, 1
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
mov ecx, ebx
call fcn.004071a2
sub esp, 8
mov eax, dword [ebp - 0x19c]
mov dword [eax + 8], ebx
mov eax, dword [ebp - 0x30]
test eax, eax
je 0x406193
mov dword [esp + 4], 1
mov dword [esp], eax
call fcn.00437b70
mov dword [ebp - 0x14], 0
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
mov dword [ebp - 0x48], eax
cmp dword [ebp - 0xc], 0
jne 0x4064e5
cmp dword [ebp - 0x48], 0x2efd
jne 0x4061d6
mov eax, dword [ebp + 0xc]
mov dword [esp + 8], eax
mov eax, dword [ebp + 8]
mov dword [esp + 4], eax
mov dword [esp], str.Error:_Cannot_connect_to__s:_d_n
call fcn.00405008
jmp 0x4064e5
cmp dword [ebp - 0x48], 0x2f0c
jne 0x4061fe
mov eax, dword [ebp + 0xc]
mov dword [esp + 8], eax
mov eax, dword [ebp + 8]
mov dword [esp + 4], eax
mov dword [esp], str.Error:_Client_CERT_required_connecting_to__s:_d_n
call fcn.00405008
jmp 0x4064e5
cmp dword [ebp - 0x48], 0x2efe
jne 0x406226
mov eax, dword [ebp + 0xc]
mov dword [esp + 8], eax
mov eax, dword [ebp + 8]
mov dword [esp + 4], eax
mov dword [esp], str.Error:_Connection_error_connecting_to__s:_d_n
call fcn.00405008
jmp 0x4064e5
cmp dword [ebp - 0x48], 0x2ef3
jne 0x40624e
mov eax, dword [ebp + 0xc]
mov dword [esp + 8], eax
mov eax, dword [ebp + 8]
mov dword [esp + 4], eax
mov dword [esp], str.Error:_ERROR_WINHTTP_INCORRECT_HANDLE_STATE_connecting_to__s:_d_n
call fcn.00405008
jmp 0x4064e5
cmp dword [ebp - 0x48], 0x2ef2
jne 0x406276
mov eax, dword [ebp + 0xc]
mov dword [esp + 8], eax
mov eax, dword [ebp + 8]
mov dword [esp + 4], eax
mov dword [esp], str.Error:_ERROR_WINHTTP_INCORRECT_HANDLE_TYPE_connecting_to__s:_d_n
call fcn.00405008
jmp 0x4064e5
cmp dword [ebp - 0x48], 0x2ee4
jne 0x40629e
mov eax, dword [ebp + 0xc]
mov dword [esp + 8], eax
mov eax, dword [ebp + 8]
mov dword [esp + 4], eax
mov dword [esp], str.Error:_ERRR_WINHTTP_INTERNAL_ERROR_connecting_to__s:_d_n
call fcn.00405008
jmp 0x4064e5
cmp dword [ebp - 0x48], 0x2ee5
jne 0x4062c6
mov eax, dword [ebp + 0xc]
mov dword [esp + 8], eax
mov eax, dword [ebp + 8]
mov dword [esp + 4], eax
mov dword [esp], str.Error:_ERROR_WINHTTP_INVALID_URL_connecting_to__s:_d_n
call fcn.00405008
jmp 0x4064e5
cmp dword [ebp - 0x48], 0x2eef
jne 0x4062ee
mov eax, dword [ebp + 0xc]
mov dword [esp + 8], eax
mov eax, dword [ebp + 8]
mov dword [esp + 4], eax
mov dword [esp], str.Error:_ERROR_WINHTTP_LOGIN_FAILURE_connecting_to__s:_d_n
call fcn.00405008
jmp 0x4064e5
cmp dword [ebp - 0x48], 0x2ee7
jne 0x406316
mov eax, dword [ebp + 0xc]
mov dword [esp + 8], eax
mov eax, dword [ebp + 8]
mov dword [esp + 4], eax
mov dword [esp], str.Error:_ERROR_WINHTTP_NAME_NOT_RESOLVED_connecting_to__s:_d_n
call fcn.00405008
jmp 0x4064e5
cmp dword [ebp - 0x48], 0x2ef1
jne 0x40633e
mov eax, dword [ebp + 0xc]
mov dword [esp + 8], eax
mov eax, dword [ebp + 8]
mov dword [esp + 4], eax
mov dword [esp], str.Error:_ERROR_WINHTTP_OPERATION_CANCELLED_connecting_to__s:_d_n
call fcn.00405008
jmp 0x4064e5
cmp dword [ebp - 0x48], 0x2f98
jne 0x406366
mov eax, dword [ebp + 0xc]
mov dword [esp + 8], eax
mov eax, dword [ebp + 8]
mov dword [esp + 4], eax
mov dword [esp], str.Error:_ERROR_WINHTTP_RESPONSE_DRAIN_OVERFLOW_connecting_to__s:_d_n
call fcn.00405008
jmp 0x4064e5
cmp dword [ebp - 0x48], 0x2f8f
jne 0x40638e
mov eax, dword [ebp + 0xc]
mov dword [esp + 8], eax
mov eax, dword [ebp + 8]
mov dword [esp + 4], eax
mov dword [esp], str.Error:_ERROR_WINHTTP_SECURE_FAILURE_connecting_to__s:_d_n
call fcn.00405008
jmp 0x4064e5
cmp dword [ebp - 0x48], 0x2eec
jne 0x4063b6
mov eax, dword [ebp + 0xc]
mov dword [esp + 8], eax
mov eax, dword [ebp + 8]
mov dword [esp + 4], eax
mov dword [esp], str.Error:_ERROR_WINHTTP_SHUTDOWN_connecting_to__s:_d_n
call fcn.00405008
jmp 0x4064e5
cmp dword [ebp - 0x48], 0x2ee2
jne 0x4063de
mov eax, dword [ebp + 0xc]
mov dword [esp + 8], eax
mov eax, dword [ebp + 8]
mov dword [esp + 4], eax
mov dword [esp], str.Error:_ERROR_WINHTTP_TIMEOUT_connecting_to__s:_d_n
call fcn.00405008
jmp 0x4064e5
cmp dword [ebp - 0x48], 0x2ee6
jne 0x406406
mov eax, dword [ebp + 0xc]
mov dword [esp + 8], eax
mov eax, dword [ebp + 8]
mov dword [esp + 4], eax
mov dword [esp], str.Error:_ERROR_WINHTTP_UNRECOGNIZED_SCHEME_connecting_to__s:_d_n
call fcn.00405008
jmp 0x4064e5
cmp dword [ebp - 0x48], 8
jne 0x40642b
mov eax, dword [ebp + 0xc]
mov dword [esp + 8], eax
mov eax, dword [ebp + 8]
mov dword [esp + 4], eax
mov dword [esp], str.Error:_ERROR_NOT_ENOUGH_MEMORY_connecting_to__s:_d_n
call fcn.00405008
jmp 0x4064e5
cmp dword [ebp - 0x48], 0x57
jne 0x406450
mov eax, dword [ebp + 0xc]
mov dword [esp + 8], eax
mov eax, dword [ebp + 8]
mov dword [esp + 4], eax
mov dword [esp], str.Error:_ERROR_INVALID_PARAMETER_connecting_to__s:_d_n
call fcn.00405008
jmp 0x4064e5
cmp dword [ebp - 0x48], 0x2f00
jne 0x406475
mov eax, dword [ebp + 0xc]
mov dword [esp + 8], eax
mov eax, dword [ebp + 8]
mov dword [esp + 4], eax
mov dword [esp], str.Error:__ERROR_WINHTTP_RESEND_REQUEST_connecting_to__s:_d_n
call fcn.00405008
jmp 0x4064e5
cmp dword [ebp - 0x48], 0x2f78
jne 0x4064c4
cmp byte [ebp - 0x16], 0
je 0x4064a8
mov byte [ebp - 0x16], 0
mov byte [ebp - 0x15], 1
mov eax, dword [ebp + 0xc]
mov dword [esp + 8], eax
mov eax, dword [ebp + 8]
mov dword [esp + 4], eax
mov dword [esp], str.Error:__ERROR_WINHTTP_INVALID_SERVER_RESPONSE_connecting_to__s:_d._Retrying..._n
call fcn.00405008
jmp 0x4064e5
mov eax, dword [ebp + 0xc]
mov dword [esp + 8], eax
mov eax, dword [ebp + 8]
mov dword [esp + 4], eax
mov dword [esp], str.Error:__ERROR_WINHTTP_INVALID_SERVER_RESPONSE__connecting_to__s:_d_n
call fcn.00405008
jmp 0x4064e5
mov eax, dword [ebp - 0x48]
mov edx, dword [ebp + 0xc]
mov dword [esp + 0xc], edx
mov edx, dword [ebp + 8]
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov dword [esp], str.Error:___d__connecting_to__s:_d_n
call fcn.00405008
cmp dword [ebp - 0x10], 0
je 0x4064fb
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
mov eax, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
call eax
sub esp, 4
cmp dword [ebp - 0x34], 0
je 0x406511
mov eax, dword [ebp - 0x34]
mov dword [esp], eax
mov eax, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
call eax
sub esp, 4
cmp dword [ebp - 0x3c], 0
je 0x406527
mov eax, dword [ebp - 0x3c]
mov dword [esp], eax
mov eax, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
call eax
sub esp, 4
mov eax, dword [ebp - 0x48]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_SetLastError]
call eax
sub esp, 4
lea eax, [ebp - 0x60]
mov ecx, eax
call fcn.004365e0
cmp byte [ebp - 0x15], 0
je 0x40654c
jmp 0x405c28
mov eax, dword [ebp - 0x14]
jmp 0x406578
lea esp, [ebp - 8]
pop ebx
pop edi
pop ebp
ret 8