Function at 0x4180c5
Capabilities:
Check http status code
Connect to http server
Create http request
Download and write a file
Get http content length
Read data from internet
Receive and write data from server to client
Receive data
Send data
Send http request
Write file on windows

Disassembly:
push ebp
sub esp, 0x400
lea ebp, [esp - 4]
mov eax, dword [0x59099c]
xor eax, ebp
mov dword [ebp + 0x400], eax
push 0x3c
mov eax, 0x537c29
call fcn.00512afb
xor ebx, ebx
mov dword [ebp - 0x2c], ebx
xor eax, eax
lea edi, [ebp - 0x28]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
mov dword [ebp - 0x18], ebx
jmp 0x4183c4
cmp byte [esi + 0x14e], bl
jne 0x4183d0
mov eax, dword [ebp - 0x18]
sub eax, ebx
je 0x418390
dec eax
je 0x418324
dec eax
je 0x4181f4
lea ecx, [ebp - 0x14]
push ecx
mov eax, 0x400
push eax
mov dword [ebp - 0x14], eax
lea eax, [ebp]
push eax
push dword [ebp - 0x24]
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
jne 0x418156
mov dword [esi + 0x150], 0xa
mov byte [esi + 0x14e], 1
jmp 0x4183c4
cmp dword [ebp - 0x14], ebx
je 0x41814a
cmp dword [esi + 0x120], ebx
je 0x4181bf
cmp byte [esi + 0x124], bl
je 0x4181bf
lea edi, [esi + 0x154]
push edi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push dword [esi + 0x120]
lea eax, [ebp]
push dword [ebp - 0x14]
push 1
push eax
call fcn.00508f25
add esp, 0x10
cmp eax, dword [ebp - 0x14]
je 0x4181b1
mov dword [esi + 0x150], 0xb
mov byte [esi + 0x14e], 1
push edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x4183c4
push dword [esi + 0x120]
call fcn.0050ba2b
pop ecx
jmp 0x4181a5
push dword [ebp - 0x14]
lea eax, [ebp]
push eax
lea ecx, [ebp - 0x48]
call fcn.00411c8b
push 0xffffffffffffffff
push ebx
push eax
lea ecx, [esi + 0x128]
mov dword [ebp - 4], ebx
call fcn.0040b546
or dword [ebp - 4], 0xffffffff
push ebx
push 1
lea ecx, [ebp - 0x48]
call fcn.0040aca3
jmp 0x4183c4
cmp dword [esi + 0xc8], 0x1bb
mov edx, 0x400c000
jne 0x41820a
mov edx, 0x480c000
lea eax, [esi + 0xcc]
cmp dword [eax + 0x18], 0x10
jb 0x41821b
mov ecx, dword [eax + 4]
jmp 0x41821e
lea ecx, [eax + 4]
lea eax, [esi + 0xe8]
cmp dword [eax + 0x18], 0x10
jb 0x41822f
mov eax, dword [eax + 4]
jmp 0x418232
add eax, 4
push ebx
push edx
push ebx
push ebx
push ebx
push ecx
push eax
push dword [ebp - 0x28]
call dword [sym.imp.WININET.dll_HttpOpenRequestA]
mov edi, eax
cmp edi, ebx
mov dword [ebp - 0x24], edi
jne 0x418257
mov byte [esi + 0x14f], 1
jmp 0x4183c4
push ebx
push ebx
push ebx
push ebx
push edi
call dword [sym.imp.WININET.dll_HttpSendRequestA]
test eax, eax
jne 0x41827c
mov byte [esi + 0x14e], 1
mov dword [esi + 0x150], 4
jmp 0x4183c4
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0x1c]
push eax
push 0x20000013
push edi
mov edi, dword [sym.imp.WININET.dll_HttpQueryInfoA]
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 0x10], 4
mov dword [ebp - 0x20], ebx
call edi
test eax, eax
jne 0x4182ae
mov byte [esi + 0x14f], 1
cmp dword [ebp - 0x1c], 0x194
jne 0x4182c6
mov dword [esi + 0x150], 3
jmp 0x41814a
cmp dword [ebp - 0x1c], 0xc8
je 0x4182e0
mov dword [esi + 0x150], 4
mov byte [esi + 0x14e], 1
cmp byte [esi + 0x14e], bl
jne 0x4183c4
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0x1c]
push eax
push 0x20000005
push dword [ebp - 0x24]
mov dword [ebp - 0x10], 4
mov dword [ebp - 0x20], ebx
call edi
mov dword [esi + 0x144], ebx
mov dword [esi + 0x148], ebx
mov dword [ebp - 0x18], 3
jmp 0x4183c4
lea eax, [esi + 0x90]
cmp dword [eax + 0x18], 0x10
jb 0x418335
mov edx, dword [eax + 4]
jmp 0x418338
lea edx, [eax + 4]
cmp dword [esi + 0x8c], 0x10
jb 0x418346
mov ecx, dword [esi + 0x78]
jmp 0x418349
lea ecx, [esi + 0x78]
lea eax, [esi + 0xac]
cmp dword [eax + 0x18], 0x10
jb 0x41835a
mov eax, dword [eax + 4]
jmp 0x41835d
add eax, 4
push ebx
push 0x4000000
push 3
push edx
push ecx
movzx ecx, word [esi + 0xc8]
push ecx
push eax
push dword [ebp - 0x2c]
call dword [sym.imp.WININET.dll_InternetConnectA]
cmp eax, ebx
mov dword [ebp - 0x28], eax
jne 0x418387
mov byte [esi + 0x14f], 1
mov dword [ebp - 0x18], 2
jmp 0x4183c4
lea eax, [esi + 0x104]
cmp dword [eax + 0x18], 0x10
jb 0x4183a1
mov eax, dword [eax + 4]
jmp 0x4183a4
add eax, 4
push ebx
push ebx
push ebx
push ebx
push eax
call dword [sym.imp.WININET.dll_InternetOpenA]
cmp eax, ebx
mov dword [ebp - 0x2c], eax
jne 0x4183bd
mov byte [esi + 0x14f], 1
mov dword [ebp - 0x18], 1
cmp byte [esi + 0x14f], bl
je 0x4180fd
push 2
pop edi
mov eax, dword [ebp + edi*4 - 0x2c]
cmp eax, ebx
je 0x4183e2
push eax
call dword [sym.imp.WININET.dll_InternetCloseHandle]
dec edi
jns 0x4183d3
cmp byte [esi + 0x14f], bl
je 0x418400
mov dword [esi + 0x150], 6
mov byte [esi + 0x14e], 1
jmp 0x41840d
lea eax, [esi + 0x150]
cmp dword [eax], 2
jne 0x41840d
mov dword [eax], ebx
lea eax, [esi + 0x154]
push eax
mov dword [ebp - 0x10], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea edi, [esi + 0x120]
mov eax, dword [edi]
cmp eax, ebx
je 0x418430
push eax
call fcn.00508d4a
pop ecx
push dword [ebp - 0x10]
mov dword [edi], ebx
mov byte [esi + 0x124], bl
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x400]
xor ecx, ebp
call fcn.0050bc9c
add ebp, 0x404
leave
ret