Function at 0x401276
Capabilities:
Check http status code
Check if file exists
Create directory
Create http request
Delete file
Download and write a file
Print debug messages
Read data from internet
Receive and write data from server to client
Receive data
Write file on windows

Disassembly:
jmp 0x40416d
push ebp
lea ebp, [esp - 0x20c]
sub esp, 0x20c
push 0xffffffffffffffff
push 0x43986e
mov eax, dword fs:[0]
push eax
mov eax, 0x402c
call fcn.0040c150
mov eax, dword [0x4481f4]
xor eax, ebp
mov dword [ebp + 0x208], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 0x214]
mov ecx, dword [eax - 0xc]
xor ebx, ebx
cmp ecx, ebx
mov dword [ebp - 4], 4
jne 0x40420a
lea ecx, [eax - 0x10]
call fcn.00401050
mov ecx, dword [ebp + 0x218]
add ecx, 0xfffffff0
call fcn.00401050
mov ecx, dword [ebp + 0x21c]
add ecx, 0xfffffff0
call fcn.00401050
mov ecx, dword [ebp + 0x220]
add ecx, 0xfffffff0
call fcn.00401050
mov ecx, dword [ebp + 0x224]
add ecx, 0xfffffff0
call fcn.00401050
xor eax, eax
jmp 0x404646
push eax
lea eax, [ebp - 0x38]
push eax
call fcn.00401438
pop ecx
pop ecx
push 0x44988c
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 5
call fcn.0040147e
lea eax, [ebp - 0x1c]
push eax
mov byte [ebp - 4], 6
call fcn.00401460
pop ecx
push eax
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 7
call fcn.00401069
mov ecx, dword [ebp - 0x1c]
add ecx, 0xfffffff0
mov byte [ebp - 4], 6
call fcn.00401050
mov esi, 0x104
push esi
lea ecx, [ebp - 0x14]
call fcn.00401375
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
push 0xffffffffffffffff
lea ecx, [ebp - 0x14]
call fcn.0040150a
push 0x43f85c
push esi
lea ecx, [ebp - 0x14]
call fcn.00401375
mov edi, dword [sym.imp.SHLWAPI.dll_PathAppendW]
push eax
call edi
push 0xffffffffffffffff
lea ecx, [ebp - 0x14]
call fcn.0040150a
push dword [ebp - 0x14]
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x4042c0
push ebx
push dword [ebp - 0x14]
push ebx
call dword [sym.imp.SHELL32.dll_SHCreateDirectoryExW]
push dword [ebp - 0x14]
call fcn.004016db
pop ecx
push 0x80
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
lea eax, [ebp - 0x14]
push eax
lea ecx, [ebp - 0x18]
call fcn.004010b9
push dword [ebp + 0x21c]
lea ecx, [ebp - 0x18]
push esi
mov byte [ebp - 4], 8
call fcn.00401375
push eax
call edi
push 0xffffffffffffffff
lea ecx, [ebp - 0x18]
call fcn.0040150a
lea eax, [ebp - 0x14]
push eax
lea ecx, [ebp - 0x24]
call fcn.004010b9
push 0x43f844
lea eax, [ebp + 0x220]
push eax
lea eax, [ebp - 0x1c]
push eax
mov byte [ebp - 4], 9
call fcn.00401005
add esp, 0xc
push dword [eax]
lea ecx, [ebp - 0x24]
push esi
mov byte [ebp - 4], 0xa
call fcn.00401375
push eax
call edi
mov ecx, dword [ebp - 0x1c]
add ecx, 0xfffffff0
mov byte [ebp - 4], 9
call fcn.00401050
push 0xffffffffffffffff
lea ecx, [ebp - 0x24]
call fcn.0040150a
push 0x43f838
lea ecx, [ebp - 0x24]
call fcn.004013cf
push dword [ebp - 0x18]
mov esi, dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov byte [ebp - 0xd], bl
call esi
push ebx
push ebx
push ebx
push ebx
push 0x43f804
call dword [sym.imp.WININET.dll_InternetOpenW]
cmp eax, ebx
mov dword [ebp - 0x30], eax
je 0x404494
push ebx
push SysReAllocString
push ebx
push ebx
push dword [ebp + 0x214]
push eax
call dword [sym.imp.WININET.dll_InternetOpenUrlW]
cmp eax, ebx
mov dword [ebp - 0x20], eax
je 0x40447a
mov edi, dword [sym.imp.WININET.dll_HttpQueryInfoW]
push ebx
lea ecx, [ebp - 0x34]
push ecx
lea ecx, [ebp - 0x1c]
push ecx
push 0x20000005
push eax
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 0x34], 4
call edi
test eax, eax
jne 0x4043c8
push 0x43f758
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
mov byte [ebp - 0xd], 1
push ebx
lea eax, [ebp - 0x34]
push eax
lea eax, [ebp - 0x2c]
push eax
push 0x20000013
push dword [ebp - 0x20]
mov dword [ebp - 0x2c], ebx
call edi
test eax, eax
jne 0x4043e6
mov byte [ebp - 0xd], 1
cmp dword [ebp - 0x2c], 0xc8
je 0x4043f3
mov byte [ebp - 0xd], 1
cmp byte [ebp - 0xd], bl
jne 0x40446f
cmp dword [ebp - 0x1c], ebx
je 0x40446f
push 0x43f46c
push dword [ebp - 0x18]
call fcn.0040c0e6
mov edi, eax
cmp edi, ebx
pop ecx
pop ecx
jne 0x404423
push 0x43f6b0
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
mov byte [ebp - 0xd], 1
jmp 0x40446f
mov dword [ebp - 0x28], ebx
lea eax, [ebp - 0x28]
push eax
push 0x4000
lea eax, [ebp - 0x4038]
push eax
push dword [ebp - 0x20]
call dword [sym.imp.WININET.dll_InternetReadFile]
cmp eax, ebx
je 0x404464
cmp dword [ebp - 0x28], ebx
je 0x404468
push edi
push dword [ebp - 0x28]
lea eax, [ebp - 0x4038]
push 1
push eax
call fcn.0040bf9e
add esp, 0x10
cmp dword [ebp - 0x28], ebx
jne 0x404426
jmp 0x404468
mov byte [ebp - 0xd], 1
push edi
call fcn.0040bdc3
pop ecx
push dword [ebp - 0x20]
call dword [sym.imp.WININET.dll_InternetCloseHandle]
jmp 0x404489
push 0x43f600
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
mov byte [ebp - 0xd], 1
push dword [ebp - 0x30]
call dword [sym.imp.WININET.dll_InternetCloseHandle]
jmp 0x4044a3
push 0x43f558
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
mov byte [ebp - 0xd], 1
cmp byte [ebp - 0xd], bl
mov edi, dword [ebp - 0x24]
jne 0x4045cf
push ebx
call dword [sym.imp.ole32.dll_CoInitialize]
cmp eax, ebx
jge 0x4044f3
mov ecx, edi
add ecx, 0xfffffff0
call fcn.00401050
mov ecx, dword [ebp - 0x18]
add ecx, 0xfffffff0
call fcn.00401050
mov ecx, dword [ebp - 0x14]
add ecx, 0xfffffff0
call fcn.00401050
mov ecx, dword [ebp - 0x38]
add ecx, 0xfffffff0
call fcn.00401050
mov ecx, dword [ebp + 0x214]
add ecx, 0xfffffff0
jmp 0x4041c6
push edi
call esi
push dword [ebp + 0x224]
push dword [ebp + 0x218]
push dword [ebp - 0x18]
push edi
call fcn.00401546
add esp, 0x10
cmp eax, ebx
je 0x4045c4
lea eax, [ebp]
push eax
call fcn.00401406
pop ecx
lea eax, [ebp]
push eax
lea ecx, [ebp - 0x2c]
call fcn.004013ca
push 0x43f554
push eax
lea eax, [ebp - 0x1c]
push eax
mov byte [ebp - 4], 0xb
call fcn.00401005
lea ecx, [ebp + 0x220]
push ecx
push eax
lea eax, [ebp - 0x30]
push eax
mov byte [ebp - 4], 0xc
call fcn.00401384
push 0x43f548
push eax
lea eax, [ebp - 0x20]
push eax
mov byte [ebp - 4], 0xd
call fcn.00401005
add esp, 0x24
mov ecx, dword [ebp - 0x30]
add ecx, 0xfffffff0
call fcn.00401050
mov ecx, dword [ebp - 0x1c]
add ecx, 0xfffffff0
call fcn.00401050
mov ecx, dword [ebp - 0x2c]
add ecx, 0xfffffff0
mov byte [ebp - 4], 0x11
call fcn.00401050
push dword [ebp - 0x20]
call esi
push ebx
push dword [ebp + 0x224]
push edi
push dword [ebp - 0x18]
push ebx
push dword [ebp - 0x20]
call fcn.00401339
add esp, 0x18
test eax, eax
jne 0x4045b7
push dword [ebp - 0x18]
call esi
push edi
call esi
mov ecx, dword [ebp - 0x20]
add ecx, 0xfffffff0
call fcn.00401050
jmp 0x4045c9
push dword [ebp - 0x18]
call esi
call dword [sym.imp.ole32.dll_CoUninitialize]
lea ecx, [edi - 0x10]
call fcn.00401050
mov ecx, dword [ebp - 0x18]
add ecx, 0xfffffff0
call fcn.00401050
mov ecx, dword [ebp - 0x14]
add ecx, 0xfffffff0
call fcn.00401050
mov ecx, dword [ebp - 0x38]
add ecx, 0xfffffff0
call fcn.00401050
mov ecx, dword [ebp + 0x214]
add ecx, 0xfffffff0
call fcn.00401050
mov ecx, dword [ebp + 0x218]
add ecx, 0xfffffff0
call fcn.00401050
mov ecx, dword [ebp + 0x21c]
add ecx, 0xfffffff0
call fcn.00401050
mov ecx, dword [ebp + 0x220]
add ecx, 0xfffffff0
call fcn.00401050
mov ecx, dword [ebp + 0x224]
add ecx, 0xfffffff0
call fcn.00401050
xor eax, eax
cmp byte [ebp - 0xd], bl
sete al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x208]
xor ecx, ebp
call fcn.0040bc38
add ebp, 0x20c
leave
ret 0x14