Function at 0x404d30
Capabilities:
Check http status code
Check if file exists
Delete file
Initialize winhttp library
Move file
Prepare http request
Read http header
Receive http response
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xd1c
mov eax, dword [0x4a4300]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
xor eax, eax
mov dword [ebp - 0xd00], 0
push 0xc6
push eax
mov word [ebp - 0x138], ax
xor ebx, ebx
lea eax, [ebp - 0x136]
mov dword [ebp - 0xcf8], 4
push eax
mov esi, ecx
mov dword [ebp - 0xcf4], 0
mov dword [ebp - 0xcfc], ebx
mov dword [ebp - 0xd04], ebx
mov dword [ebp - 0xd0c], ebx
call fcn.004523e0
add esp, 0xc
xor eax, eax
mov word [ebp - 0xcf0], ax
push 0x4ae
push eax
lea eax, [ebp - 0xcee]
push eax
call fcn.004523e0
add esp, 0xc
mov dword [ebp - 0xd18], ebx
lea eax, [ebp - 0x38f]
mov dword [ebp - 0xd14], ebx
mov dword [ebp - 0xd10], ebx
mov byte [ebp - 0x390], bl
push 0x257
push ebx
push eax
call fcn.004523e0
mov ecx, esi
add esp, 0xc
lea edx, [ecx + 2]
jmp 0x404df0
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x404df0
sub ecx, edx
sar ecx, 1
je 0x405328
push 0x482a34
push esi
call fcn.004534e6
add esp, 8
test eax, eax
je 0x405328
lea edx, [eax + 4]
mov esi, edx
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x404e20
lea edi, [ebp - 0x138]
sub edx, esi
add edi, 0xfffffffe
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x404e36
mov ecx, edx
lea eax, [ebp - 0x138]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
push 0x482a3c
rep movsb byte es:[edi], byte [esi]
push eax
call fcn.004534e6
add esp, 8
test eax, eax
je 0x405328
xor ecx, ecx
lea edx, [eax + 2]
mov word [eax], cx
mov esi, edx
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x404e76
lea edi, [ebp - 0xcf0]
sub edx, esi
add edi, 0xfffffffe
lea esp, [esp]
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x404e90
mov ecx, edx
lea eax, [ebp - 0x138]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
push 0x482a40
rep movsb byte es:[edi], byte [esi]
push eax
call fcn.004534e6
add esp, 8
test eax, eax
je 0x404ed7
xor ecx, ecx
mov word [eax], cx
add eax, 2
push eax
call fcn.004549b9
add esp, 4
mov esi, eax
jmp 0x404edc
mov esi, 0x50
push 0
push 0
push 0
push 0
push 0x482a44
call dword [sym.imp.WINHTTP.dll_WinHttpOpen]
mov edi, dword [sym.imp.KERNEL32.dll_DeleteFileA]
mov dword [ebp - 0xd08], eax
test eax, eax
je 0x40521b
push 0x7530
push 0x7530
push 0x1770
push 0x7530
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpSetTimeouts]
test eax, eax
je 0x405009
push 0
push esi
lea eax, [ebp - 0x138]
push eax
push dword [ebp - 0xd08]
call dword [sym.imp.WINHTTP.dll_WinHttpConnect]
mov dword [ebp - 0xd18], eax
test eax, eax
je 0x405009
push 0
push 0
push 0
push 0
lea ecx, [ebp - 0xcf0]
push ecx
push 0x482a5c
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov esi, eax
mov dword [ebp - 0xd14], esi
test esi, esi
je 0x405009
push 0
push 0
push 0
push 0
push 0
push 0
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpSendRequest]
test eax, eax
je 0x405009
push 0
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
test eax, eax
je 0x405009
mov edi, dword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
lea eax, [ebp - 0xcf8]
push 0
push eax
lea eax, [ebp - 0xd00]
push eax
push 0
push 0x20000013
push esi
call edi
test eax, eax
je 0x405009
cmp dword [ebp - 0xd00], 0xc8
jne 0x405009
push 0
lea eax, [ebp - 0xcf8]
mov dword [ebp - 0xcf8], 4
push eax
lea eax, [ebp - 0xcf4]
push eax
push 0
push 0x20000005
push esi
call edi
test eax, eax
je 0x405009
mov eax, dword [ebp - 0xcf4]
test eax, eax
jne 0x405071
mov dword [ebp - 0xd0c], 1
xor edi, edi
push dword [ebp - 0xd08]
mov esi, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
call esi
mov eax, dword [ebp - 0xd14]
test eax, eax
je 0x405026
push eax
call esi
mov eax, dword [ebp - 0xd18]
test eax, eax
je 0x405033
push eax
call esi
test edi, edi
je 0x405040
push edi
call fcn.00453dbd
add esp, 4
mov ebx, dword [ebp - 0xd10]
test ebx, ebx
je 0x405058
push ebx
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [ebp - 0xd0c]
mov edi, dword [sym.imp.KERNEL32.dll_DeleteFileA]
test esi, esi
jne 0x405226
jmp 0x40521d
add eax, 0xffff0000
cmp eax, 0x7fff0000
ja 0x405009
push 0x258
lea eax, [ebp - 0x390]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea ecx, [ebp - 0x390]
dec ecx
mov al, byte [ecx + 1]
lea ecx, [ecx + 1]
test al, al
jne 0x405098
mov eax, dword [str..tmp]
mov edi, dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
mov dword [ecx], eax
mov al, byte [0x482a68]
mov byte [ecx + 4], al
lea eax, [ebp - 0x390]
push eax
call edi
cmp eax, 1
jne 0x4050d2
lea eax, [ebp - 0x390]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
lea eax, [ebp - 0x390]
push eax
call edi
cmp eax, 1
je 0x405009
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
lea eax, [ebp - 0x390]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0xd10], eax
cmp eax, 0xffffffff
je 0x405009
push 0x2000
call fcn.00452c03
mov edi, eax
add esp, 4
test edi, edi
je 0x40500b
cmp dword [ebp - 0xcf4], ebx
je 0x4051f5
jmp 0x405140
lea eax, [ebp - 0xcfc]
push eax
push 0x2000
push edi
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpReadData]
test eax, eax
je 0x4051ed
push 0
lea eax, [ebp - 0xd04]
push eax
push dword [ebp - 0xcfc]
push edi
push dword [ebp - 0xd10]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4051ed
add ebx, dword [ebp - 0xcfc]
mov ecx, dword [0x4a8b54]
test ecx, ecx
je 0x4051df
movd xmm1, ebx
mov eax, ebx
cvtdq2pd xmm1, xmm1
shr eax, 0x1f
addsd xmm1, qword [eax*8 + 0x4837e0]
mov eax, dword [ebp - 0xcf4]
movd xmm0, eax
cvtdq2pd xmm0, xmm0
shr eax, 0x1f
addsd xmm0, qword [eax*8 + 0x4837e0]
divsd xmm1, xmm0
mulsd xmm1, qword [0x4837d8]
cvttsd2si eax, xmm1
push eax
push 0x482558
call ecx
call eax
mov ecx, dword [0x4a8b54]
add esp, 4
cmp ebx, dword [ebp - 0xcf4]
jne 0x405140
jmp 0x4051fb
mov ecx, dword [0x4a8b54]
jmp 0x405205
mov ecx, dword [0x4a8b54]
mov dword [ebp - 0xd0c], 1
test ecx, ecx
je 0x40500b
push str._STS_DUILIB_CloseUpdateWnd
call ecx
call eax
jmp 0x40500b
xor esi, esi
lea eax, [ebp - 0x390]
push eax
call edi
lea eax, [ebp - 0x390]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
jne 0x40524a
mov eax, esi
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004516e1
mov esp, ebp
pop ebp
ret
push 0x63
lea eax, [ebp - 0x6f]
mov byte [ebp - 0x70], 0
push 0
push eax
call fcn.004523e0
add esp, 0xc
lea edx, [ebp - 0x70]
lea ecx, [ebp - 0x390]
call fcn.004024a0
test eax, eax
je 0x405328
lea ecx, [ebp - 0x70]
call fcn.0040dfa0
push 0x257
lea eax, [ebp - 0x83f]
mov byte [ebp - 0x840], 0
push 0
push eax
call fcn.004523e0
mov ebx, dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea eax, [ebp - 0x840]
add esp, 0xc
push 0x258
push eax
push 0
call ebx
push 0x257
lea eax, [ebp - 0x5e7]
mov byte [ebp - 0x5e8], 0
push 0
push eax
call fcn.004523e0
add esp, 0xc
lea eax, [ebp - 0x5e8]
push 0x258
push eax
push 0
call ebx
lea ecx, [ebp - 0x5e8]
dec ecx
mov al, byte [ecx + 1]
lea ecx, [ecx + 1]
test al, al
jne 0x4052e3
mov eax, dword [str..del]
mov dword [ecx], eax
mov al, byte [0x482a70]
mov byte [ecx + 4], al
lea eax, [ebp - 0x5e8]
push eax
call edi
mov esi, dword [sym.imp.KERNEL32.dll_MoveFileA]
lea eax, [ebp - 0x5e8]
push eax
lea eax, [ebp - 0x840]
push eax
call esi
test eax, eax
jne 0x40533b
lea eax, [ebp - 0x390]
push eax
call edi
mov ecx, dword [ebp - 4]
xor eax, eax
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004516e1
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x840]
push eax
lea eax, [ebp - 0x390]
push eax
call esi
test eax, eax
je 0x40531f
lea eax, [ebp - 0x840]
push eax
lea ecx, [ebp - 0x5e8]
call fcn.00402f80
add esp, 4
call fcn.00401440
int3