Function at 0x40b02c
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 0x40b0b0
mov eax, 1
jmp 0x40b9b8
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x10000
mov dword [esp + 4], 0x40af66
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.00407aa2
mov eax, dword [ebp + 0xc]
movzx ebx, ax
lea eax, [ebp - 0x60]
mov ecx, eax
call fcn.004c0930
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 0x40b1f5
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], 0x574c26
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 0x40b4a5
mov eax, dword [0x871234]
test eax, eax
jle 0x40b236
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 0x40b4a5
mov eax, dword [0x871234]
test eax, eax
jle 0x40b4a5
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 0x40b2cd
mov eax, dword [ebp - 0x6c]
test eax, eax
jne 0x40b2e5
mov dword [esp], str.No_cert_loaded
call fcn.0040a616
mov dword [ebp - 0xc], 0
jmp 0x40b4a5
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 0x40b32c
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 0x40b3a4
mov eax, dword [0x871234]
cmp dword [ebp - 0x24], eax
jge 0x40b3a4
mov edx, dword [0x871248]
mov eax, dword [ebp - 0x24]
shl eax, 2
add eax, edx
mov eax, dword [eax]
test eax, eax
je 0x40b39e
mov edx, dword [0x871248]
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 0x40b39e
mov byte [ebp - 0x1d], 1
add dword [ebp - 0x24], 1
jmp 0x40b337
movzx eax, byte [ebp - 0x1d]
xor eax, 1
test al, al
je 0x40b4a5
lea eax, [ebp - 0x88]
mov ecx, eax
call fcn.005393a0
lea eax, [ebp - 0x88]
mov dword [esp + 4], eax
mov dword [esp], str.ignoreCert
call fcn.00409be0
mov dword [esp + 4], 0x574c48
lea eax, [ebp - 0x88]
mov dword [esp], eax
call fcn.00559368
test al, al
je 0x40b498
mov dword [esp], str.Received_certificate_not_allowed_n
call fcn.0040a296
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.0040a448
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.00539b30
cmp dword [ebp - 0xc], 0
je 0x40b4c6
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 0x40b5da
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 0x40b515
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 0x40b562
mov dword [ebp - 0x8c], 0xffffffff
jmp 0x40b56b
mov eax, dword [ebp - 0x8c]
add dword [ebp - 0x28], eax
mov eax, dword [ebp - 0x8c]
test eax, eax
je 0x40b57a
jmp 0x40b4ec
cmp dword [ebp - 0x28], 0
je 0x40b5da
mov edx, dword [ebp - 0x30]
mov eax, dword [ebp - 0x28]
add eax, edx
mov byte [eax], 0
mov dword [esp], 8
call fcn.0055be70
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.0040c5e2
sub esp, 8
mov eax, dword [ebp - 0x19c]
mov dword [eax + 8], ebx
mov eax, dword [ebp - 0x30]
test eax, eax
je 0x40b5d3
mov dword [esp + 4], 1
mov dword [esp], eax
call fcn.0055be30
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 0x40b925
cmp dword [ebp - 0x48], 0x2efd
jne 0x40b616
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.0040a448
jmp 0x40b925
cmp dword [ebp - 0x48], 0x2f0c
jne 0x40b63e
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.0040a448
jmp 0x40b925
cmp dword [ebp - 0x48], 0x2efe
jne 0x40b666
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.0040a448
jmp 0x40b925
cmp dword [ebp - 0x48], 0x2ef3
jne 0x40b68e
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.0040a448
jmp 0x40b925
cmp dword [ebp - 0x48], 0x2ef2
jne 0x40b6b6
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.0040a448
jmp 0x40b925
cmp dword [ebp - 0x48], 0x2ee4
jne 0x40b6de
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.0040a448
jmp 0x40b925
cmp dword [ebp - 0x48], 0x2ee5
jne 0x40b706
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.0040a448
jmp 0x40b925
cmp dword [ebp - 0x48], 0x2eef
jne 0x40b72e
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.0040a448
jmp 0x40b925
cmp dword [ebp - 0x48], 0x2ee7
jne 0x40b756
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.0040a448
jmp 0x40b925
cmp dword [ebp - 0x48], 0x2ef1
jne 0x40b77e
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.0040a448
jmp 0x40b925
cmp dword [ebp - 0x48], 0x2f98
jne 0x40b7a6
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.0040a448
jmp 0x40b925
cmp dword [ebp - 0x48], 0x2f8f
jne 0x40b7ce
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.0040a448
jmp 0x40b925
cmp dword [ebp - 0x48], 0x2eec
jne 0x40b7f6
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.0040a448
jmp 0x40b925
cmp dword [ebp - 0x48], 0x2ee2
jne 0x40b81e
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.0040a448
jmp 0x40b925
cmp dword [ebp - 0x48], 0x2ee6
jne 0x40b846
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.0040a448
jmp 0x40b925
cmp dword [ebp - 0x48], 8
jne 0x40b86b
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.0040a448
jmp 0x40b925
cmp dword [ebp - 0x48], 0x57
jne 0x40b890
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.0040a448
jmp 0x40b925
cmp dword [ebp - 0x48], 0x2f00
jne 0x40b8b5
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.0040a448
jmp 0x40b925
cmp dword [ebp - 0x48], 0x2f78
jne 0x40b904
cmp byte [ebp - 0x16], 0
je 0x40b8e8
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.0040a448
jmp 0x40b925
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.0040a448
jmp 0x40b925
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.0040a448
cmp dword [ebp - 0x10], 0
je 0x40b93b
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 0x40b951
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 0x40b967
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.0053d570
cmp byte [ebp - 0x15], 0
je 0x40b98c
jmp 0x40b068
mov eax, dword [ebp - 0x14]
jmp 0x40b9b8
lea esp, [ebp - 8]
pop ebx
pop edi
pop ebp
ret 8