Function at 0x406470
Capabilities:
Get file attributes
Set file attributes

Disassembly:
sub esp, 0x25c
call fcn.00418feb
test eax, eax
jne 0x406489
push 0x80004005
call fcn.004010d0
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
push esi
call eax
mov esi, eax
add esi, 0x10
mov dword [esp + 8], esi
call fcn.00418feb
test eax, eax
jne 0x4064af
push 0x80004005
call fcn.004010d0
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
push edi
call eax
mov edi, dword [esp + 0x268]
add eax, 0x10
mov dword [esp + 8], eax
test edi, edi
jne 0x4064cf
xor eax, eax
jmp 0x4064e3
mov eax, edi
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x4064d4
sub eax, edx
sar eax, 1
push ebx
push eax
push edi
lea ecx, [esp + 0x14]
call fcn.00401f60
push 4
push str..
lea ecx, [esp + 0x14]
call fcn.00402740
mov ebx, dword [esp + 0xc]
lea ecx, [esp + 0x18]
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
mov dword [esp + 0x14], eax
cmp eax, 0xffffffff
jne 0x40655c
lea eax, [ebx - 0x10]
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x406534
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea eax, [esi - 0x10]
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x406550
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
pop ebx
pop edi
xor eax, eax
pop esi
add esp, 0x25c
ret
mov ebx, dword [esp + 0x274]
push ebp
mov ebp, dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
lea ebx, [ebx]
mov ecx, 0x45075c
lea eax, [esp + 0x48]
lea esp, [esp]
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x4065a6
test dx, dx
je 0x4065a2
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x4065a6
add eax, 4
add ecx, 4
test dx, dx
jne 0x406580
xor eax, eax
jmp 0x4065ab
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x4066d5
mov ecx, 0x451370
lea eax, [esp + 0x48]
lea esp, [esp]
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x4065e6
test dx, dx
je 0x4065e2
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x4065e6
add eax, 4
add ecx, 4
test dx, dx
jne 0x4065c0
xor eax, eax
jmp 0x4065eb
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x4066d5
cmp dword [esp + 0x274], 0
jne 0x406617
lea ecx, [esp + 0x48]
push str.desktop.ini
push ecx
call fcn.0042f1fa
add esp, 8
test eax, eax
je 0x4066d5
test edi, edi
jne 0x40661f
xor eax, eax
jmp 0x406633
mov eax, edi
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x406624
sub eax, edx
sar eax, 1
push eax
push edi
lea ecx, [esp + 0x1c]
call fcn.00401f60
push 0x5c
lea ecx, [esp + 0x18]
call fcn.00405ad0
lea eax, [esp + 0x48]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x406650
sub eax, edx
sar eax, 1
push eax
lea edx, [esp + 0x4c]
push edx
lea ecx, [esp + 0x1c]
call fcn.00402740
mov esi, dword [esp + 0x14]
push esi
call ebp
test al, 1
je 0x406684
and eax, 0xfffffffe
push eax
push esi
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
test byte [esp + 0x1c], 0x10
je 0x4066a6
mov eax, dword [esp + 0x274]
push ebx
push eax
push esi
call fcn.00406470
add esp, 0xc
push esi
call dword [sym.imp.KERNEL32.dll_RemoveDirectoryW]
jmp 0x4066d5
test ebx, ebx
je 0x4066ce
lea ecx, [esp + 0x48]
push str.index.dat
push ecx
call fcn.0042f1fa
add esp, 8
test eax, eax
jne 0x4066ce
lea edx, [esp + 0x48]
push edx
push edi
call fcn.004062e0
add esp, 8
push esi
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov ecx, dword [esp + 0x18]
lea eax, [esp + 0x1c]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_FindNextFileW]
test eax, eax
jne 0x406570
mov edx, dword [esp + 0x18]
push edx
call dword [sym.imp.KERNEL32.dll_FindClose]
mov eax, dword [esp + 0x10]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
pop ebp
test edx, edx
jg 0x406719
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea eax, [esi - 0x10]
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x406735
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
pop ebx
pop edi
mov eax, 1
pop esi
add esp, 0x25c
ret