Function at 0x1005508
Capabilities:
Check http status code
Initialize winhttp library
Prepare http request
Read http header
Receive http response
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x50
push ebx
push esi
push edi
xor edi, edi
mov esi, eax
push dword [esi + 0xc]
lea ecx, [ebp - 0x40]
mov dword [ebp - 4], edi
mov dword [ebp - 0x14], edi
mov dword [ebp - 0x10], edi
mov dword [esi + 0x360], edi
mov dword [ebp - 0x2c], edi
mov dword [ebp - 0x18], edi
mov dword [ebp - 0x1c], edi
call fcn.0100474e
lea ecx, [ebp - 0x1c]
push ecx
lea ecx, [ebp - 0x18]
push ecx
lea ecx, [ebp - 0x2c]
push ecx
push dword [eax + 8]
mov ebx, 0x10018ac
push ebx
call fcn.01008561
lea ecx, [ebp - 0x40]
call fcn.010047b4
push edi
push dword [ebp - 0x1c]
push dword [ebp - 0x18]
push dword [ebp - 0x2c]
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpOpen]
mov dword [esi + 0x20], eax
cmp dword [ebp - 0x18], edi
je 0x100557d
push dword [ebp - 0x18]
call sub.cmutil.dll_CmFree
cmp dword [ebp - 0x1c], edi
je 0x100558a
push dword [ebp - 0x1c]
call sub.cmutil.dll_CmFree
mov eax, dword [esi + 0x148]
cmp dword [eax], edi
je 0x100559b
push 0x62
jmp 0x10059e1
mov ecx, dword [esi + 0x20]
cmp ecx, edi
jne 0x10055b9
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov dword [esi + 0x360], eax
push 0x1001f7c
jmp 0x10059e6
mov eax, dword [esi + 0x1c]
movzx edx, word [eax + 0x18]
push edi
push edx
push dword [eax + 0x10]
push ecx
call dword [sym.imp.WINHTTP.dll_WinHttpConnect]
mov dword [esi + 0x24], eax
mov eax, dword [esi + 0x148]
cmp dword [eax], edi
je 0x10055e0
push 0x6e
jmp 0x10059e1
cmp dword [esi + 0x24], edi
jne 0x1005610
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov dword [esi + 0x360], eax
mov eax, dword [esi + 0x1c]
push dword [eax + 0x10]
push 0x1001f38
push dword [0x101135c]
call fcn.0100a43e
add esp, 0x10
jmp 0x10059f4
push 0x1002
call sub.cmutil.dll_CmMalloc
mov dword [ebp - 0x10], eax
cmp eax, edi
jne 0x1005638
push 0x1001efc
push dword [0x101135c]
call fcn.0100a43e
pop ecx
pop ecx
jmp 0x10059f4
mov eax, dword [esi + 0x1c]
push 0x900
push edi
push edi
push dword [eax + 0x2c]
mov ebx, 0x801
push ebx
push dword [ebp - 0x10]
call fcn.01004f68
cmp eax, edi
jge 0x100566b
movzx ecx, ax
push eax
mov dword [esi + 0x360], ecx
push 0x1001ec8
jmp 0x10059e6
mov eax, dword [esi + 0x1c]
push 0x900
push edi
push edi
push dword [eax + 0x34]
push ebx
push dword [ebp - 0x10]
call fcn.01005262
cmp eax, edi
jge 0x1005699
movzx ecx, ax
push eax
mov dword [esi + 0x360], ecx
push 0x1001e98
jmp 0x10059e6
push dword [ebp - 0x10]
lea ecx, [ebp - 0x50]
call fcn.01004781
push dword [eax + 4]
push 0x1001e6c
push dword [0x101135c]
call fcn.0100a43e
add esp, 0xc
lea ecx, [ebp - 0x50]
call fcn.010047b4
mov eax, dword [esi + 0x1c]
cmp dword [eax + 0xc], 2
jne 0x10056d2
mov eax, 0x800000
jmp 0x10056d4
xor eax, eax
or eax, 0x100
push eax
push edi
push edi
push edi
push dword [ebp - 0x10]
push edi
push dword [esi + 0x24]
call dword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov dword [esi + 0x28], eax
mov eax, dword [esi + 0x148]
cmp dword [eax], edi
je 0x1005701
push 0x94
jmp 0x10059e1
mov eax, dword [esi + 0x28]
cmp eax, edi
jne 0x100571f
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov dword [esi + 0x360], eax
push 0x1001e34
jmp 0x10059e6
push edi
push edi
push edi
push edi
push edi
push edi
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpSendRequest]
mov ecx, dword [esi + 0x148]
mov dword [ebp - 4], eax
cmp dword [ecx], edi
je 0x1005743
push 0xa5
jmp 0x10059e1
cmp eax, edi
jne 0x100575e
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov dword [esi + 0x360], eax
push 0x1001dfc
jmp 0x10059e6
push edi
push dword [esi + 0x28]
call dword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
mov dword [ebp - 4], eax
cmp eax, edi
jne 0x10058be
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov dword [esi + 0x360], eax
push 0x1001dc0
jmp 0x10059e6
cmp dword [ebp - 8], edi
je 0x100592e
cmp dword [ebp - 0x14], edi
je 0x10057a0
push dword [ebp - 0x14]
call sub.cmutil.dll_CmFree
push dword [ebp - 8]
call sub.cmutil.dll_CmMalloc
mov ebx, eax
mov dword [ebp - 0x14], ebx
cmp ebx, edi
je 0x10058f3
lea eax, [ebp - 0xc]
push eax
push dword [ebp - 8]
push ebx
push dword [esi + 0x28]
call dword [sym.imp.WINHTTP.dll_WinHttpReadData]
mov ecx, dword [esi + 0x148]
mov dword [ebp - 4], eax
cmp dword [ecx], edi
jne 0x100590d
cmp eax, edi
je 0x1005917
cmp dword [ebp - 0xc], edi
je 0x100592e
push edi
lea eax, [ebp - 0x20]
push eax
push dword [ebp - 0xc]
push ebx
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [esi + 0x148]
mov dword [ebp - 4], eax
cmp dword [ecx], edi
jne 0x1005999
cmp eax, edi
je 0x10059a0
mov eax, dword [ebp - 0x20]
cmp dword [ebp - 0xc], eax
jne 0x10059b4
cmp dword [esi + 0x13c], edi
jne 0x1005888
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0x28]
push eax
lea eax, [esi + 0x140]
push eax
push edi
push 0x20000005
push dword [esi + 0x28]
mov dword [ebp - 0x28], 4
mov dword [ebp - 0x24], edi
call dword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
mov ecx, dword [esi + 0x148]
mov dword [ebp - 4], eax
cmp dword [ecx], edi
jne 0x10059d5
cmp eax, edi
jne 0x1005888
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
call ebx
mov dword [esi + 0x360], eax
call ebx
push eax
push 0x1001d8c
push dword [0x101135c]
call fcn.0100a43e
add esp, 0xc
mov eax, dword [ebp - 0xc]
add dword [esi + 0x13c], eax
mov eax, dword [esi + 0x134]
mov ecx, dword [esi + 0x13c]
cmp eax, edi
je 0x10058b0
push dword [esi + 0x138]
push dword [esi + 0x140]
push ecx
call eax
mov eax, dword [esi + 0x148]
cmp dword [eax], edi
jne 0x10059dc
lea eax, [ebp - 8]
push eax
push dword [esi + 0x28]
mov dword [ebp - 0xc], edi
mov dword [ebp - 0x20], edi
mov dword [ebp - 8], edi
call dword [sym.imp.WINHTTP.dll_WinHttpQueryDataAvailable]
test eax, eax
jne 0x100578a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov dword [esi + 0x360], eax
push 0x1001d4c
jmp 0x10059e6
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push dword [ebp - 8]
mov dword [esi + 0x360], eax
push 0x1001d08
jmp 0x10055fd
push 0xd5
jmp 0x10059e1
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov dword [esi + 0x360], eax
push 0x1001cd0
jmp 0x10059e6
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0x28]
push eax
lea eax, [ebp - 0x30]
push eax
push edi
push 0x20000013
push dword [esi + 0x28]
mov dword [ebp - 0x28], 4
mov dword [ebp - 0x24], edi
call dword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
mov dword [ebp - 4], eax
cmp eax, edi
jne 0x100596e
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov dword [esi + 0x360], eax
push 0x1001d8c
jmp 0x10059e6
mov eax, dword [ebp - 0x30]
cmp eax, 0xc8
je 0x10059f4
push eax
mov dword [esi + 0x360], eax
push 0x1001ca4
push dword [0x101135c]
call fcn.0100a43e
add esp, 0xc
mov dword [ebp - 4], edi
push 2
jmp 0x10059cd
push 0xe3
jmp 0x10059e1
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov dword [esi + 0x360], eax
push 0x1001c74
jmp 0x10059e6
push eax
push dword [ebp - 0xc]
push 0x1001c3c
push dword [0x101135c]
call fcn.0100a43e
add esp, 0x10
push 0x70
call dword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x10059f4
push 0xfe
jmp 0x10059e1
push 0x10d
push 0x1001c08
push dword [0x101135c]
call fcn.0100a43e
add esp, 0xc
cmp dword [esi + 0x360], edi
jne 0x1005a12
mov eax, dword [esi + 0x148]
cmp dword [eax], edi
jne 0x1005a12
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esi + 0x360], eax
cmp dword [ebp - 0x14], edi
je 0x1005a1f
push dword [ebp - 0x14]
call sub.cmutil.dll_CmFree
mov eax, dword [esi + 0x28]
mov ebx, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
cmp eax, edi
je 0x1005a32
push eax
call ebx
mov dword [esi + 0x28], edi
mov eax, dword [esi + 0x24]
cmp eax, edi
je 0x1005a3f
push eax
call ebx
mov dword [esi + 0x24], edi
mov eax, dword [esi + 0x20]
cmp eax, edi
je 0x1005a4c
push eax
call ebx
mov dword [esi + 0x20], edi
cmp dword [ebp - 4], edi
je 0x1005a63
lea eax, [esi + 0x140]
mov esi, dword [esi + 0x13c]
cmp esi, dword [eax]
jbe 0x1005a63
mov dword [eax], esi
cmp dword [ebp - 0x10], edi
pop edi
pop esi
pop ebx
je 0x1005a73
push dword [ebp - 0x10]
call sub.cmutil.dll_CmFree
mov eax, dword [ebp - 4]
leave
ret 4