Function at 0x1002297
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 [0x100c084]
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 0x100254b
push ebx
push ebx
push ebx
push ebx
push 0x10013a4
call dword [sym.imp.WININET.dll_InternetOpenA]
mov ecx, dword [esi + 0x148]
mov dword [esi + 0x20], eax
cmp dword [ecx], ebx
jne 0x100254b
cmp eax, ebx
je 0x100254b
mov ecx, dword [esi + 0x1c]
mov edx, dword [ecx + 0x24]
cmp edx, ebx
je 0x1002310
cmp byte [edx], bl
jne 0x1002312
xor edx, edx
push edi
mov edi, dword [ecx + 0x1c]
cmp edi, ebx
je 0x100231e
cmp byte [edi], bl
jne 0x1002320
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 0x100254a
cmp eax, ebx
je 0x100254a
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 0x100254a
cmp eax, ebx
je 0x100254a
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 0x100254a
cmp dword [ebp - 0x148], ebx
jne 0x1002531
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x12
jne 0x1002531
push dword [esi + 0x28]
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov eax, dword [esi + 0x148]
cmp dword [eax], ebx
jne 0x100254a
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 0x100254a
cmp eax, ebx
je 0x100254a
mov edi, 0x2000
push edi
call sub.cmutil.dll_CmMalloc
cmp eax, ebx
mov dword [ebp - 0x14c], eax
je 0x100254a
lea ecx, [ebp - 0x154]
push ecx
push edi
push eax
jmp 0x10024fc
cmp dword [ebp - 0x148], ebx
je 0x1002537
cmp dword [ebp - 0x154], ebx
je 0x100251b
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 0x1002537
cmp dword [ebp - 0x148], ebx
je 0x1002537
mov ecx, dword [ebp - 0x154]
cmp ecx, dword [ebp - 0x158]
jne 0x1002527
lea eax, [esi + 0x13c]
add dword [eax], ecx
mov ecx, dword [esi + 0x134]
cmp ecx, ebx
mov eax, dword [eax]
je 0x10024e4
push dword [esi + 0x138]
push dword [esi + 0x140]
push eax
call ecx
mov eax, dword [esi + 0x148]
cmp dword [eax], ebx
jne 0x1002537
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 0x100245b
jmp 0x1002537
mov dword [ebp - 0x148], 1
jmp 0x1002537
push 0x70
call dword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x1002537
mov dword [ebp - 0x148], ebx
cmp dword [ebp - 0x14c], ebx
je 0x100254a
push dword [ebp - 0x14c]
call sub.cmutil.dll_CmFree
pop edi
mov eax, dword [esi + 0x28]
cmp eax, ebx
je 0x100255c
push eax
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov dword [esi + 0x28], ebx
mov eax, dword [esi + 0x24]
cmp eax, ebx
je 0x100256d
push eax
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov dword [esi + 0x24], ebx
mov eax, dword [esi + 0x20]
cmp eax, ebx
je 0x100257e
push eax
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov dword [esi + 0x20], ebx
cmp dword [ebp - 0x150], ebx
pop ebx
je 0x1002592
push dword [ebp - 0x150]
call sub.cmutil.dll_CmFree
mov ecx, dword [ebp - 4]
mov eax, dword [ebp - 0x148]
call fcn.010051d5
leave
ret 4