Function at 0x40bd80
Capabilities:
Get common file path
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x535436
mov eax, dword fs:[0]
push eax
push ecx
mov eax, 0x16bc
call fcn.005127a0
mov eax, dword [0x586f40]
xor eax, ebp
mov dword [ebp - 0x18], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov eax, dword [ebp + 0xc]
mov ebx, dword [ebp + 8]
mov edi, dword [ebp + 0x10]
mov dword [ebp - 0x1654], eax
xor eax, eax
push 0x206
mov dword [ebp - 0x1680], ecx
push eax
lea ecx, [ebp - 0x242]
push ecx
mov dword [ebp - 0x1664], ebx
mov dword [ebp - 0x167c], edx
mov word [ebp - 0x244], ax
call fcn.005121a0
xor eax, eax
add esp, 0xc
push eax
xor edx, edx
lea ecx, [ebx + 0x30]
push 0x564794
mov word [ebp - 0x38], dx
mov dword [ebp - 0x36], eax
mov dword [ebp - 0x32], eax
mov dword [ebp - 0x2e], eax
mov dword [ebp - 0x2a], eax
mov dword [ebp - 0x26], eax
mov dword [ebp - 0x22], eax
mov dword [ebp - 0x1e], eax
mov word [ebp - 0x1a], ax
call fcn.00406780
cmp dword [ebx + 4], 0
mov dword [ebx + 0x20], 0
jne 0x40be42
mov ecx, edi
mov esi, ebx
call fcn.0040b750
test eax, eax
je 0x40bf37
test edi, edi
je 0x40be4c
mov eax, dword [ebx + 4]
mov dword [eax + 0x14], edi
mov eax, dword [ebp - 0x1654]
push 0
push 0
push 2
push 1
mov dword [ebp - 4], 0
mov ecx, dword [ebx + 4]
push eax
call fcn.00422c61
mov edi, eax
mov dword [ebp - 0x165c], edi
mov dword [ebp - 4], 0xffffffff
call fcn.004133ab
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x40be93
push 0x80004005
call fcn.00406890
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [ebp - 0x1648], eax
push 0
lea ecx, [ebp - 0x1648]
push ecx
push 5
mov ecx, edi
mov dword [ebp - 4], 2
call fcn.004228b0
mov edx, dword [ebp - 0x1648]
push edx
call fcn.00510371
add esp, 4
lea esi, [ebp - 0x16c0]
mov dword [ebx + 0x34], eax
call fcn.0040cc00
test edi, edi
je 0x40c267
push 0x1000
push 0
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov dword [ebp - 0x1654], eax
test eax, eax
jne 0x40bf57
mov eax, dword [edi]
mov edx, dword [eax + 0x50]
mov ecx, edi
call edx
mov eax, dword [edi]
mov edx, dword [eax + 4]
push 1
mov ecx, edi
call edx
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0x1648]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40bf37
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x18]
xor ecx, ebp
call fcn.0051026e
mov esp, ebp
pop ebp
ret 0xc
lea ecx, [ebp - 0x244]
push ecx
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
lea edi, [ebp - 0x38]
call fcn.0040c930
mov eax, edi
mov esi, edi
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40bf75
lea edi, [ebp - 0x244]
sub eax, esi
add edi, 0xfffffffe
jmp 0x40bf90
mov cx, word [edi + 2]
add edi, 2
test cx, cx
jne 0x40bf90
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
xor esi, esi
push esi
push esi
push 2
push esi
push esi
push 0x40000000
lea edx, [ebp - 0x244]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x1668], eax
mov dword [ebp - 0x1678], esi
call fcn.004133ab
xor ecx, ecx
cmp eax, esi
setne cl
cmp ecx, esi
jne 0x40bfea
push 0x80004005
call fcn.00406890
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [ebp - 0x164c], eax
fldz
fstp qword [ebx + 0x38]
mov dword [ebp - 0x1658], esi
mov byte [ebp - 4], 4
mov dword [ebp - 0x1650], esi
mov edi, dword [ebp - 0x165c]
mov edx, dword [edi]
mov edx, dword [edx + 0x38]
push 0xfff
lea eax, [ebp - 0x1644]
push eax
mov ecx, edi
call edx
mov esi, eax
mov dword [ebp - 0x1660], esi
test esi, esi
je 0x40c190
mov edx, dword [ebp - 0x1668]
push 0
lea eax, [ebp - 0x1678]
push eax
push esi
lea ecx, [ebp - 0x1644]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
add dword [ebp - 0x1650], esi
lea eax, [ebp - 0x16c0]
push eax
lea esi, [ebp - 0x16cc]
call fcn.0040cc00
lea esi, [ebp - 0x16b4]
call fcn.0040c9b0
fldz
fld qword [ebp - 0x16b4]
fcom st(1)
fnstsw ax
fstp st(1)
test ah, 5
jp 0x40c098
fld qword [0x5656f0]
jmp 0x40c09e
fld qword [0x564b28]
faddp st(1)
fmul qword [0x565708]
call fcn.00514ad6
mov ecx, dword [ebp - 0x1650]
mov dword [ebp - 0x168c], eax
mov dword [ebp - 0x1688], edx
fild qword [ebp - 0x168c]
fstp qword [ebp - 0x16a4]
fild dword [ebp - 0x1650]
test ecx, ecx
jns 0x40c0d9
fadd qword [0x565740]
fst qword [ebp - 0x1694]
fmul qword [0x565738]
fidiv dword [ebx + 0x34]
fst qword [ebp - 0x1674]
fsub qword [ebx + 0x38]
fcomp qword [0x565730]
fnstsw ax
test ah, 1
jne 0x40c18a
push 0x1e
call dword [sym.imp.KERNEL32.dll_Sleep]
fldz
fld qword [ebp - 0x16a4]
fcom st(1)
fnstsw ax
fstp st(1)
test ah, 0x41
jne 0x40c156
fld qword [ebp - 0x1694]
fmul qword [0x565728]
fdivrp st(1)
fst qword [ebx + 0x10]
fld qword [ebp - 0x1674]
call fcn.00514aa0
mov ecx, dword [ebx + 4]
sub esp, 8
fstp qword [esp]
push str.Downloading_Files...___0.1f_Kb_s_
mov dword [0x1bc8950], eax
call fcn.0040c7b0
add esp, 0xc
jmp 0x40c181
fstp st(0)
fld qword [ebp - 0x1674]
call fcn.00514aa0
mov ecx, dword [ebx + 4]
push str.Downloading_Files...
mov dword [0x1bc8950], eax
call fcn.0040c7b0
fld qword [ebp - 0x1694]
fstp qword [ebx + 0x10]
add esp, 4
fld qword [ebp - 0x1674]
fstp qword [ebx + 0x38]
mov esi, dword [ebp - 0x1660]
mov eax, dword [ebp - 0x1658]
inc eax
mov dword [ebp - 0x1658], eax
cmp eax, 0x3e8
jne 0x40c1eb
mov eax, dword [ebp - 0x164c]
cmp dword [eax - 4], 1
jle 0x40c1c5
mov edx, dword [eax - 0xc]
push edx
lea ecx, [ebp - 0x164c]
call fcn.004065e0
mov eax, dword [ebp - 0x164c]
fld qword [ebx + 0x10]
mov ecx, dword [ebp - 0x1650]
sub esp, 8
fstp qword [esp]
push ecx
mov ecx, dword [ebx + 4]
push eax
call fcn.0040c7b0
add esp, 0x10
mov dword [ebp - 0x1658], 0
test esi, esi
jne 0x40c011
mov edx, dword [ebp - 0x1668]
push edx
mov dword [ebp - 4], 3
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea eax, [ebx + 0x20]
push eax
mov ecx, edi
call fcn.00421b88
push esi
lea eax, [ebx + 0x30]
push eax
push 0x15
mov ecx, edi
call fcn.004228b0
mov edx, dword [edi]
mov eax, dword [edx + 0x50]
mov ecx, edi
call eax
mov ecx, dword [ebp - 0x1654]
push ecx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov edx, dword [edi]
mov eax, dword [edx + 4]
push 1
mov ecx, edi
call eax
mov byte [ebp - 4], 2
mov eax, dword [ebp - 0x164c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40c267
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [ebx + 4]
push 0x564794
call fcn.0040c7b0
lea eax, [ebp - 0x244]
add esp, 4
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40c280
mov ecx, dword [ebp - 0x1680]
sub eax, edx
sar eax, 1
push eax
lea edx, [ebp - 0x244]
push edx
call fcn.00406780
lea eax, [ebp - 0x38]
lea edx, [eax + 2]
jmp 0x40c2b0
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40c2b0
mov ecx, dword [ebp - 0x167c]
sub eax, edx
sar eax, 1
push eax
lea eax, [ebp - 0x38]
push eax
call fcn.00406780
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0x1648]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40c2f8
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, 1
jmp 0x40bf39