Function at 0x408660
Capabilities:
Delete file
Set file attributes
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x52d0b4
mov eax, dword fs:[0]
push eax
sub esp, 0x83c
mov eax, dword [0x5976b8]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
cmp dword [0x5927ec], 0
mov eax, dword [ebp + 0x10]
mov esi, dword [ebp + 8]
mov ebx, dword [ebp + 0xc]
mov dword [ebp - 0x83c], eax
je 0x4086bd
push 0x80
push esi
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
test eax, eax
je 0x4086bd
push esi
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
push 0
push 2
push 4
push 0
push 0
push 0x40000000
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
mov dword [ebp - 0x838], edi
cmp edi, 0xffffffff
je 0x408756
xor esi, esi
cmp dword [0x5927ec], esi
je 0x408765
push 0x206
lea edx, [ebp - 0x626]
xor ecx, ecx
push esi
push edx
mov word [ebp - 0x628], cx
call fcn.005149a0
push str._UDHLDFile_
push 0x53dc54
lea eax, [ebp - 0x628]
push 0x104
push eax
call fcn.00515c51
lea ecx, [ebp - 0x628]
push 0x104
push ecx
call fcn.0051611e
add esp, 0x24
push esi
lea edx, [ebp - 0x844]
push edx
push eax
lea eax, [ebp - 0x628]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp eax, esi
jne 0x40875d
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
jmp 0x408c15
mov dword [0x5927ec], esi
jmp 0x408770
push 2
push esi
push esi
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0x206
lea edx, [ebp - 0x216]
xor ecx, ecx
push esi
push edx
mov word [ebp - 0x218], cx
call fcn.005149a0
push ebx
push str.FILE
push str._s__s__n
lea eax, [ebp - 0x218]
push 0x104
push eax
call fcn.00515c51
lea ecx, [ebp - 0x218]
push 0x104
push ecx
call fcn.0051611e
add esp, 0x28
push esi
lea edx, [ebp - 0x848]
push edx
push eax
lea eax, [ebp - 0x218]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp eax, esi
je 0x40874f
push 0x206
lea edx, [ebp - 0x82e]
xor ecx, ecx
push esi
push edx
mov word [ebp - 0x830], cx
call fcn.005149a0
push 0x206
lea ecx, [ebp - 0x41e]
xor eax, eax
push esi
push ecx
mov word [ebp - 0x420], ax
call fcn.005149a0
push ebx
lea edx, [ebp - 0x420]
push 0x104
push edx
call fcn.00515853
lea eax, [ebp - 0x420]
push 0x104
push eax
call fcn.0051611e
add esp, 0x2c
cmp eax, esi
jle 0x40885b
mov ecx, 0x5c
nop
cmp word [ebp + eax*2 - 0x420], cx
je 0x408851
dec eax
cmp eax, esi
jg 0x408840
jmp 0x40885b
xor ecx, ecx
mov word [ebp + eax*2 - 0x420], cx
lea edx, [ebp - 0x420]
push edx
lea eax, [ebp - 0x830]
push 0x104
push eax
call fcn.00515853
add esp, 0xc
call fcn.004170fe
xor ecx, ecx
cmp eax, esi
setne cl
cmp ecx, esi
jne 0x408890
push 0x80004005
call fcn.00401550
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [ebp - 0x840], eax
mov ebx, dword [ebp + 0x14]
mov dword [ebp - 4], esi
mov dword [ebp - 0x834], esi
test ebx, ebx
je 0x408908
mov edi, dword [ebp - 0x83c]
lea ecx, [edi + 0x208]
push ecx
push edi
lea edx, [ebp - 0x840]
push 0x53d734
push edx
call fcn.004047b0
mov ecx, dword [ebp - 0x840]
lea eax, [ebp - 0x830]
push eax
push ecx
call fcn.00514ba4
add esp, 0x18
test eax, eax
je 0x4088f8
inc esi
add edi, 0x410
cmp esi, ebx
jb 0x4088b8
jmp 0x408902
mov dword [ebp - 0x834], 1
mov edi, dword [ebp - 0x838]
test byte [0x598bbc], 1
jne 0x408937
or dword [0x598bbc], 1
mov ecx, 0x598ba8
mov byte [ebp - 4], 1
call fcn.00416033
push 0x53a8e0
call fcn.005164c2
add esp, 4
mov byte [ebp - 4], 0
cmp dword [ebp - 0x834], 0
je 0x408be4
mov edx, dword [ebp - 0x83c]
imul esi, esi, 0x410
lea eax, [esi + edx]
lea ecx, [eax + 0x208]
push ecx
push eax
push str.FOLDER
push str._s__s____s__n
lea edx, [ebp - 0x218]
push 0x104
push edx
call fcn.00515c51
mov esi, dword [0x598bb0]
add esp, 0x18
mov dword [ebp - 0x844], esi
call fcn.004170fe
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x40899f
push 0x80004005
call fcn.00401550
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
lea edi, [eax + 0x10]
mov dword [ebp - 0x83c], edi
xor eax, eax
mov byte [ebp - 4], 2
mov dword [ebp - 0x834], eax
test esi, esi
jne 0x408a66
lea ecx, [ebp - 0x218]
push 0x104
push ecx
call fcn.0051611e
mov esi, dword [ebp - 0x838]
add esp, 8
push 0
lea edx, [ebp - 0x848]
push edx
push eax
lea eax, [ebp - 0x218]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x408ba6
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
add edi, 0xfffffff0
mov byte [ebp - 4], 0
lea ecx, [edi + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x408a26
mov ecx, dword [edi]
mov eax, dword [ecx]
mov edx, dword [eax + 4]
push edi
call edx
mov eax, dword [ebp - 0x840]
add eax, 0xfffffff0
mov dword [ebp - 4], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x408a4f
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor eax, eax
jmp 0x408c15
mov eax, dword [ebp - 0x834]
test eax, eax
js 0x408ba1
cmp eax, dword [0x598bb0]
jge 0x408ba1
mov ecx, dword [0x598bac]
mov eax, dword [ecx + eax*4]
lea esi, [eax - 0x10]
lea ebx, [edi - 0x10]
cmp esi, ebx
je 0x408b3b
cmp dword [ebx + 0xc], 0
jl 0x408b25
mov ecx, dword [esi]
cmp ecx, dword [ebx]
jne 0x408b25
mov edx, dword [ecx]
mov eax, dword [edx + 0x10]
call eax
cmp dword [esi + 0xc], 0
lea ecx, [esi + 0xc]
jl 0x408ac6
cmp eax, dword [esi]
jne 0x408ac6
mov edi, esi
mov edx, 1
lock xadd dword [ecx], edx
jmp 0x408b01
mov ecx, dword [esi + 4]
mov edx, dword [eax]
mov edx, dword [edx]
push 2
push ecx
mov ecx, eax
call edx
mov edi, eax
test edi, edi
je 0x408b6d
mov eax, dword [esi + 4]
mov dword [edi + 4], eax
mov eax, dword [esi + 4]
lea ecx, [eax + eax + 2]
push ecx
add esi, 0x10
lea edx, [eax + eax + 2]
push esi
push edx
lea eax, [edi + 0x10]
push eax
call fcn.00515373
add esp, 0x10
lea eax, [ebx + 0xc]
or ecx, 0xffffffff
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x408b1a
mov ecx, dword [ebx]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
push ebx
call eax
add edi, 0x10
mov dword [ebp - 0x83c], edi
jmp 0x408b3b
mov ecx, dword [eax - 0xc]
push ecx
push eax
lea ecx, [ebp - 0x83c]
call fcn.00404130
mov edi, dword [ebp - 0x83c]
lea ecx, [ebp - 0x218]
push ecx
push edi
call fcn.00514ba4
add esp, 8
test eax, eax
je 0x408b72
mov eax, dword [ebp - 0x834]
inc eax
mov dword [ebp - 0x834], eax
cmp eax, dword [ebp - 0x844]
jb 0x408a60
jmp 0x4089c5
call fcn.004034f0
mov edx, dword [ebp - 0x838]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
add edi, 0xfffffff0
mov byte [ebp - 4], 0
lea eax, [edi + 0xc]
or ecx, 0xffffffff
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x408beb
mov ecx, dword [edi]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
push edi
call eax
jmp 0x408beb
call fcn.0041565f
mov edx, dword [0x598bb0]
lea ecx, [ebp - 0x218]
push ecx
push edx
mov ecx, 0x598ba8
call fcn.00416681
add edi, 0xfffffff0
mov byte [ebp - 4], 0
lea eax, [edi + 0xc]
or ecx, 0xffffffff
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x408bde
mov ecx, dword [edi]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
push edi
call eax
mov edi, dword [ebp - 0x838]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x840]
add eax, 0xfffffff0
or edx, 0xffffffff
lea ecx, [eax + 0xc]
mov dword [ebp - 4], edx
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x408c10
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00514990
mov esp, ebp
pop ebp
ret 0x10