Function at 0x1002037
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
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x15c
mov eax, dword [0x1007084]
push ebx
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
xor ebx, ebx
push 0x1001
mov dword [ebp - 0x15c], eax
mov dword [ebp - 0x148], ebx
mov dword [ebp - 0x14c], ebx
call sub.cmutil.dll_CmMalloc
cmp eax, ebx
mov dword [ebp - 0x150], eax
je 0x10022eb
push ebx
push ebx
push ebx
push ebx
push 0x10013b4
call dword [sym.imp.WININET.dll_InternetOpenA]
mov ecx, dword [esi + 0x148]
mov dword [esi + 0x20], eax
cmp dword [ecx], ebx
jne 0x10022eb
cmp eax, ebx
je 0x10022eb
mov ecx, dword [esi + 0x1c]
mov edx, dword [ecx + 0x24]
cmp edx, ebx
je 0x10020b0
cmp byte [edx], bl
jne 0x10020b2
xor edx, edx
push edi
mov edi, dword [ecx + 0x1c]
cmp edi, ebx
je 0x10020be
cmp byte [edi], bl
jne 0x10020c0
xor edi, edi
push ebx
push ebx
push 1
push edx
xor edx, edx
mov dx, word [ecx + 0x18]
push edi
push edx
push dword [ecx + 0x10]
push eax
call dword [sym.imp.WININET.dll_InternetConnectA]
mov ecx, dword [esi + 0x148]
mov dword [esi + 0x24], eax
cmp dword [ecx], ebx
jne 0x10022ea
cmp eax, ebx
je 0x10022ea
mov eax, dword [esi + 0x1c]
push dword [eax + 0x2c]
push dword [ebp - 0x150]
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push 0x50
pop ecx
push ebx
xor eax, eax
lea edi, [ebp - 0x144]
push 0x84000000
rep stosd dword es:[edi], eax
lea eax, [ebp - 0x144]
push eax
push dword [ebp - 0x150]
push dword [esi + 0x24]
call dword [sym.imp.WININET.dll_FtpFindFirstFileA]
mov ecx, dword [esi + 0x148]
mov dword [esi + 0x28], eax
cmp dword [ecx], ebx
jne 0x10022ea
cmp eax, ebx
je 0x10022ea
lea ecx, [ebp - 0x144]
push ecx
push eax
call dword [sym.imp.WININET.dll_InternetFindNextFileA]
mov dword [ebp - 0x148], eax
mov eax, dword [esi + 0x148]
cmp dword [eax], ebx
jne 0x10022ea
cmp dword [ebp - 0x148], ebx
jne 0x10022d1
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x12
jne 0x10022d1
push dword [esi + 0x28]
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov eax, dword [esi + 0x148]
cmp dword [eax], ebx
jne 0x10022ea
mov eax, dword [ebp - 0x124]
push ebx
push 2
push 0x80000000
push dword [ebp - 0x150]
mov dword [esi + 0x140], eax
push dword [esi + 0x24]
call dword [sym.imp.WININET.dll_FtpOpenFileA]
mov ecx, dword [esi + 0x148]
mov dword [esi + 0x28], eax
cmp dword [ecx], ebx
jne 0x10022ea
cmp eax, ebx
je 0x10022ea
mov edi, 0x2000
push edi
call sub.cmutil.dll_CmMalloc
cmp eax, ebx
mov dword [ebp - 0x14c], eax
je 0x10022ea
lea ecx, [ebp - 0x154]
push ecx
push edi
push eax
jmp 0x100229c
cmp dword [ebp - 0x148], ebx
je 0x10022d7
cmp dword [ebp - 0x154], ebx
je 0x10022bb
push ebx
lea eax, [ebp - 0x158]
push eax
push dword [ebp - 0x154]
push dword [ebp - 0x14c]
push dword [ebp - 0x15c]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [ebp - 0x148], eax
mov eax, dword [esi + 0x148]
cmp dword [eax], ebx
jne 0x10022d7
cmp dword [ebp - 0x148], ebx
je 0x10022d7
mov ecx, dword [ebp - 0x154]
cmp ecx, dword [ebp - 0x158]
jne 0x10022c7
lea eax, [esi + 0x13c]
add dword [eax], ecx
mov ecx, dword [esi + 0x134]
cmp ecx, ebx
mov eax, dword [eax]
je 0x1002284
push dword [esi + 0x138]
push dword [esi + 0x140]
push eax
call ecx
mov eax, dword [esi + 0x148]
cmp dword [eax], ebx
jne 0x10022d7
lea eax, [ebp - 0x154]
push eax
push edi
push dword [ebp - 0x14c]
push dword [esi + 0x28]
call dword [sym.imp.WININET.dll_InternetReadFile]
mov dword [ebp - 0x148], eax
mov eax, dword [esi + 0x148]
cmp dword [eax], ebx
je 0x10021fb
jmp 0x10022d7
mov dword [ebp - 0x148], 1
jmp 0x10022d7
push 0x70
call dword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x10022d7
mov dword [ebp - 0x148], ebx
cmp dword [ebp - 0x14c], ebx
je 0x10022ea
push dword [ebp - 0x14c]
call sub.cmutil.dll_CmFree
pop edi
mov eax, dword [esi + 0x28]
cmp eax, ebx
je 0x10022fc
push eax
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov dword [esi + 0x28], ebx
mov eax, dword [esi + 0x24]
cmp eax, ebx
je 0x100230d
push eax
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov dword [esi + 0x24], ebx
mov eax, dword [esi + 0x20]
cmp eax, ebx
je 0x100231e
push eax
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov dword [esi + 0x20], ebx
cmp dword [ebp - 0x150], ebx
pop ebx
je 0x1002332
push dword [ebp - 0x150]
call sub.cmutil.dll_CmFree
mov ecx, dword [ebp - 4]
mov eax, dword [ebp - 0x148]
call fcn.01004f75
leave
ret 4