Function at 0x10016788
Capabilities:
Check http status code
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x454
push esi
push edi
xor edi, edi
lea ecx, [ebp - 0x54]
mov dword [ebp - 4], edi
mov word [ebp - 0x454], di
call fcn.10020d9d
cmp byte [ebp - 0x20], 0
mov esi, dword [ebp + 8]
je 0x10016b4b
push 0x10000000
push edi
push edi
push edi
push dword [esi + 0x74]
call dword [ebp - 0x48]
cmp eax, edi
mov dword [ebp - 0x10], eax
jne 0x100167d7
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esi + 0x50], eax
jmp 0x10016b02
push 0x104a
call fcn.1001761b
cmp eax, edi
pop ecx
mov dword [ebp - 0xc], eax
jne 0x100167f7
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esi + 0x60], eax
jmp 0x10016afc
mov ecx, 0x825
mov byte [eax], 0
inc eax
dec ecx
jne 0x100167fc
mov edi, dword [sym.imp.SHLWAPI.dll_StrStrIW]
push ebx
mov ebx, str.http:__
push ebx
push dword [esi + 0x6c]
call edi
test eax, eax
jne 0x1001683f
push str.ftp:__
push dword [esi + 0x6c]
call edi
test eax, eax
jne 0x1001683f
push str.https:__
push dword [esi + 0x6c]
call edi
test eax, eax
jne 0x1001683f
push ebx
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_lstrcatW]
push dword [esi + 0x6c]
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_lstrcatW]
mov eax, dword [esi + 0x78]
test eax, eax
je 0x1001685f
push dword [esi + 0x78]
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov ebx, eax
jmp 0x10016861
xor ebx, ebx
push 0x10023a80
push dword [ebp - 0x10]
call dword [ebp - 0x50]
cmp eax, 0xffffffff
jne 0x1001687f
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esi + 0x58], eax
jmp 0x10016aef
lea edi, [esi + 0x28]
push edi
push 0x80000000
push ebx
push dword [esi + 0x78]
push dword [ebp - 0xc]
push dword [ebp - 0x10]
call dword [ebp - 0x4c]
push dword [esi + 0xc]
lea eax, [ebp - 0x54]
push eax
push edi
call fcn.10021dff
xor ebx, ebx
cmp eax, ebx
mov dword [ebp + 8], eax
jne 0x100168b7
mov dword [ebp - 4], 0x1000
jmp 0x10016aef
push dword [esi + 0x2c]
mov edi, dword [sym.imp.KERNEL32.dll_ResetEvent]
call edi
push ebx
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 0x454]
push eax
push 0x13
push dword [ebp + 8]
mov dword [ebp - 4], 0x10
mov dword [ebp - 0x18], 0x400
call dword [ebp - 0x40]
lea eax, [ebp - 0x454]
push eax
call fcn.1000c829
mov dword [esi + 4], eax
cmp dword [esi + 4], 0xc8
pop ecx
mov dword [esi + 0x5c], eax
jne 0x10016aa9
mov al, byte [esi + 0x8c]
test al, al
jne 0x1001691d
mov ecx, esi
call fcn.100055be
test al, al
je 0x10016aa9
mov dword [ebp - 0x14], ebx
mov dword [esi + 0x80], ebx
mov al, byte [esi + 0x8c]
test al, al
jne 0x1001693b
push ebx
push ebx
push ebx
push dword [esi]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ecx, esi
call fcn.100078be
test eax, eax
je 0x1001699a
push dword [esi + 0x2c]
call edi
push 0
push 0
lea eax, [ebp - 8]
push eax
push dword [ebp + 8]
call dword [ebp - 0x2c]
mov ebx, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
test ebx, ebx
jne 0x10016987
cmp eax, 0x3e5
jne 0x10016a10
mov ecx, esi
call fcn.100078be
test eax, eax
je 0x1001699a
push eax
push dword [esi + 0x2c]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
jmp 0x1001693b
cmp ebx, 1
jne 0x10016a10
cmp dword [ebp - 8], 0
jne 0x10016a1a
mov al, byte [esi + 0x8c]
test al, al
jne 0x10016a02
push dword [esi]
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push dword [esi]
call fcn.1001a18a
mov dword [esi + 0x90], eax
mov eax, dword [esi + 0x90]
push 2
pop ebx
and eax, ebx
sub al, bl
neg al
sbb eax, eax
inc eax
mov byte [esi + 0x8e], al
mov eax, dword [esi + 0x90]
push dword [esi]
and eax, 4
sub al, 4
neg al
sbb eax, eax
inc eax
mov byte [esi + 0x8f], al
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esi + 0x90]
and eax, ebx
cmp al, bl
jne 0x10016a02
mov ecx, esi
call fcn.1001f352
mov dword [ebp - 4], 0x11
xor ebx, ebx
jmp 0x10016ab9
cmp dword [ebp - 8], 0
je 0x1001693b
mov al, byte [esi + 0x8c]
test al, al
je 0x10016a2c
mov eax, dword [esi + 0x80]
jmp 0x10016a2e
xor eax, eax
mov ecx, 0x2800
sub ecx, eax
mov al, byte [esi + 0x8c]
test al, al
je 0x10016a47
mov edx, dword [esi + 0x80]
jmp 0x10016a49
xor edx, edx
mov eax, dword [esi + 0x84]
add eax, edx
cmp ecx, dword [ebp - 8]
jb 0x10016a59
mov ecx, dword [ebp - 8]
lea edx, [ebp - 0x14]
push edx
push ecx
push eax
push dword [ebp + 8]
call dword [ebp - 0x30]
cmp eax, 1
jne 0x1001693b
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x1001693b
add dword [esi + 0x80], eax
mov al, byte [esi + 0x8c]
test al, al
jne 0x1001693b
push 0
lea eax, [ebp - 0x1c]
push eax
push dword [ebp - 0x14]
push dword [esi + 0x84]
push dword [esi]
call dword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x1001693b
cmp dword [esi + 4], 0xc9
jne 0x10016ab9
mov dword [ebp - 4], 0x110
push dword [ebp + 8]
call fcn.1002432c
push str.adpi
push dword [esi + 0x7c]
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
push 0x800
push dword [esi + 0x7c]
push dword [ebp + 8]
call fcn.10006e58
test eax, eax
jne 0x10016ae9
mov eax, dword [esi + 0x7c]
mov word [eax], bx
push dword [ebp + 8]
call dword [ebp - 0x3c]
push dword [ebp - 0xc]
call fcn.1000e77a
mov edi, dword [ebp - 4]
pop ecx
pop ebx
push dword [ebp - 0x10]
call dword [ebp - 0x3c]
mov eax, edi
and al, 1
dec al
neg al
sbb al, al
inc al
mov byte [esi + 0x88], al
mov eax, edi
and al, 0x10
cmp al, 0x10
sete al
mov byte [esi + 0x89], al
mov eax, 0x100
mov ecx, edi
and ecx, eax
cmp ecx, eax
sete al
mov byte [esi + 0x8a], al
mov eax, 0x1000
mov ecx, edi
and ecx, eax
cmp ecx, eax
sete al
mov byte [esi + 0x8b], al
push dword [ebp - 0x54]
mov dword [esi + 0x4c], edi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov eax, edi
pop edi
pop esi
leave
ret 8