Function at 0x404020
Capabilities:
Connect to http server
Create http request
Download and write a file
Read data from internet
Receive and write data from server to client
Receive data
Send data
Send http request
Write file on windows

Disassembly:
sub esp, 0xeb0
push ebx
push ebp
mov ebp, ecx
push esi
mov esi, dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push edi
lea ebx, [ebp + 0x824]
push ebx
call esi
mov eax, dword [ebp + 0x848]
mov edi, dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push ebx
mov dword [esp + 0x2c], eax
call edi
push ebx
call esi
mov ecx, dword [ebp + 0x860]
push ebx
mov dword [esp + 0x34], ecx
call edi
xor eax, eax
mov dword [esp + 0x20], 0x440
push eax
push eax
push eax
push 1
push str.HDFY
mov dword [esp + 0x40], eax
mov dword [esp + 0x24], eax
mov dword [esp + 0x30], eax
call dword [sym.imp.WININET.dll_InternetOpenW]
test eax, eax
mov dword [esp + 0x34], eax
je 0x404485
push ebx
call esi
mov edx, dword [ebp + 0x844]
push ebx
mov dword [esp + 0x28], edx
call edi
mov eax, dword [esp + 0x24]
test eax, eax
jne 0x404485
mov eax, dword [esp + 0xec4]
mov ecx, dword [esp + 0x34]
push 0
push 0
push 3
push 0x4241ac
push 0x4241ac
push 0x50
push eax
push ecx
call dword [sym.imp.WININET.dll_InternetConnectW]
test eax, eax
mov dword [esp + 0x24], eax
je 0x40447a
push ebx
call esi
mov edx, dword [ebp + 0x844]
push ebx
mov dword [esp + 0x18], edx
call edi
mov eax, dword [esp + 0x14]
test eax, eax
jne 0x40447a
mov eax, dword [esp + 0xec8]
mov ecx, dword [esp + 0x24]
push 0
push 0x4000000
push 0
push 0
push str.HTTP_1.0
push eax
push 0x41f1e8
push ecx
call dword [sym.imp.WININET.dll_HttpOpenRequestW]
test eax, eax
mov dword [esp + 0x18], eax
je 0x40446f
push ebx
call esi
mov edx, dword [ebp + 0x844]
push ebx
mov dword [esp + 0x18], edx
call edi
mov eax, dword [esp + 0x14]
test eax, eax
jne 0x40446f
mov eax, dword [esp + 0x18]
push 0
push 0
push 0
push 0
push eax
call dword [sym.imp.WININET.dll_HttpSendRequestW]
test eax, eax
je 0x404464
push ebx
call esi
mov ecx, dword [ebp + 0x844]
push ebx
mov dword [esp + 0x18], ecx
call edi
mov eax, dword [esp + 0x14]
test eax, eax
jne 0x404464
mov ecx, dword [esp + 0x18]
lea edx, [esp + 0x20]
push 0
lea eax, [esp + 0x30]
push edx
push eax
push 0x20000013
push ecx
mov dword [esp + 0x34], 4
call dword [sym.imp.WININET.dll_HttpQueryInfoW]
test eax, eax
je 0x404464
push ebx
call esi
mov edx, dword [ebp + 0x844]
push ebx
mov dword [esp + 0x18], edx
call edi
mov eax, dword [esp + 0x14]
test eax, eax
jne 0x404464
mov eax, 0x51eb851f
mul dword [esp + 0x2c]
shr edx, 5
cmp edx, 2
jne 0x404464
mov edx, dword [esp + 0x18]
mov ecx, 0x110
xor eax, eax
lea edi, [esp + 0x40]
rep stosd dword es:[edi], eax
push eax
lea eax, [esp + 0x24]
lea ecx, [esp + 0x44]
push eax
push ecx
push 5
push edx
mov dword [esp + 0x34], 0x440
call dword [sym.imp.WININET.dll_HttpQueryInfoW]
test eax, eax
je 0x404464
push ebx
call esi
mov edi, dword [ebp + 0x844]
push ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
test edi, edi
jne 0x404464
lea eax, [esp + 0x40]
push eax
call fcn.00408736
mov edi, dword [esp + 0x34]
add esp, 4
test edi, edi
mov dword [esp + 0x10], eax
jl 0x4042ba
push ebx
call esi
mov esi, dword [ebp + 0x850]
lea ecx, [edi + edi*4]
push ebx
lea eax, [edi + ecx*8]
mov ecx, 0x290
shl eax, 6
add esi, eax
lea edi, [esp + 0x484]
rep movsd dword es:[edi], dword [esi]
mov dword [esp + 0x18], eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov edx, dword [esp + 0x10]
push 0
mov dword [esp + 0xeac], edx
call fcn.0040807f
add esp, 4
mov dword [esp + 0xeb8], eax
push ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov edi, dword [ebp + 0x850]
mov ecx, dword [esp + 0x14]
add edi, ecx
mov ecx, 0x290
lea esi, [esp + 0x480]
push ebx
rep movsd dword es:[edi], dword [esi]
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov esi, dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x28]
push eax
push 1
push 0x5f4
push ecx
call dword [sym.imp.USER32.dll_PostMessageW]
mov ecx, 0x110
xor eax, eax
lea edi, [esp + 0x40]
mov dword [esp + 0x10], eax
rep stosd dword es:[edi], eax
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov ecx, dword [esp + 0x18]
lea edx, [esp + 0x1c]
mov dword [esp + 0x3c], eax
push edx
lea eax, [esp + 0x44]
push 0x400
push eax
push ecx
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x404450
mov eax, dword [esp + 0x1c]
test eax, eax
jbe 0x404450
push ebx
call esi
mov edi, dword [ebp + 0x844]
push ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor eax, eax
cmp edi, eax
jne 0x404496
mov dword [esp + 0x38], eax
push eax
mov eax, dword [esp + 0x20]
lea edx, [esp + 0x3c]
push edx
mov edx, dword [esp + 0xed4]
lea ecx, [esp + 0x48]
push eax
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x10]
mov edi, dword [esp + 0x30]
add ecx, eax
test edi, edi
mov dword [esp + 0x10], ecx
jl 0x404417
push ebx
call esi
mov esi, dword [ebp + 0x850]
lea ecx, [edi + edi*4]
push ebx
lea eax, [edi + ecx*8]
mov ecx, 0x290
shl eax, 6
add esi, eax
lea edi, [esp + 0x484]
rep movsd dword es:[edi], dword [esi]
mov dword [esp + 0x18], eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov esi, dword [esp + 0x10]
mov dword [esp + 0xeb0], esi
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov ecx, eax
mov eax, dword [esp + 0x3c]
sub ecx, eax
je 0x4043cc
lea eax, [esi + esi*4]
xor edx, edx
lea eax, [eax + eax*4]
lea eax, [eax + eax*4]
shl eax, 3
div ecx
mov ecx, eax
jmp 0x4043ce
mov ecx, esi
mov eax, dword [esp + 0xea8]
xor edx, edx
sub eax, esi
push ebx
div ecx
mov dword [esp + 0xeb8], ecx
mov dword [esp + 0xec0], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov edi, dword [ebp + 0x850]
mov ecx, dword [esp + 0x14]
add edi, ecx
mov ecx, 0x290
lea esi, [esp + 0x480]
push ebx
rep movsd dword es:[edi], dword [esi]
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov esi, dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov edx, dword [esp + 0x10]
mov eax, dword [esp + 0x28]
push edx
push 2
push 0x5f4
push eax
call dword [sym.imp.USER32.dll_PostMessageW]
mov eax, dword [esp + 0x18]
lea ecx, [esp + 0x1c]
push ecx
lea edx, [esp + 0x44]
push 0x400
push edx
push eax
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
jne 0x40430e
mov ecx, dword [esp + 0x28]
push 0
push 3
push 0x5f4
push ecx
call dword [sym.imp.USER32.dll_PostMessageW]
mov edx, dword [esp + 0x18]
push edx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov eax, dword [esp + 0x24]
push eax
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov ecx, dword [esp + 0x34]
push ecx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xeb0
ret 0xc
mov dword [esp + 0x10], eax
jmp 0x404464