Function at 0x401780
Capabilities:
Delete directory
Set current directory

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x674
mov eax, dword [0x408040]
mov cx, word [0x406258]
push ebx
mov dword [esp + 0x674], eax
mov eax, dword [0x406254]
push esi
push edi
lea edx, [esp + 0x18]
mov dword [esp + 0x18], eax
mov eax, dword [ebp + 0x10]
push edx
push eax
mov word [esp + 0x24], cx
call fcn.00401730
mov esi, eax
add esp, 8
test esi, esi
je 0x401a49
jmp 0x4017d0
push 0x406230
push esi
call fcn.00401b49
add esp, 8
cmp eax, esi
je 0x40180b
lea ecx, [esp + 0x18]
push ecx
push esi
call fcn.00401730
mov esi, eax
add esp, 8
test esi, esi
jne 0x4017d0
mov ecx, dword [esp + 0x67c]
call fcn.00401ac1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10
lea edx, [esp + 0x18]
push edx
push esi
call fcn.00401730
mov esi, eax
lea eax, [esp + 0x20]
push eax
push esi
call fcn.00401730
mov ebx, eax
mov word [esp + 0x30], 0
xor eax, eax
mov ecx, 0xf
lea edi, [esp + 0x32]
rep stosd dword es:[edi], eax
mov ecx, ebx
sub ecx, esi
sar ecx, 1
dec ecx
mov edx, ecx
stosw word es:[edi], ax
shr ecx, 2
lea edi, [esp + 0x30]
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea eax, [esp + 0x30]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
call fcn.00401b44
push ebx
mov esi, eax
call fcn.00401b44
xor edi, edi
add esp, 0x18
lea ecx, [esp + 0x10]
mov ebx, eax
mov dword [esp + 0x10], edi
mov dword [esp + 0x14], edi
call fcn.00401000
test eax, eax
jne 0x401897
mov esi, dword [esp + 0x10]
cmp esi, edi
je 0x401a49
cmp dword [esp + 0x14], edi
jmp 0x401a39
push esi
push edi
push 0x1f0fff
call dword [sym.imp.KERNEL32.dll_OpenProcess]
mov esi, eax
cmp esi, edi
je 0x4018ba
push 0xffffffffffffffff
push esi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0xbb8
call dword [sym.imp.KERNEL32.dll_Sleep]
mov word [esp + 0x470], di
xor eax, eax
mov ecx, 0x81
lea edi, [esp + 0x472]
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x470]
push 0x104
push ecx
stosw word es:[edi], ax
call fcn.00401090
lea edx, [esp + 0x478]
push edx
call fcn.00401acf
add esp, 0xc
cmp eax, 8
jae 0x40191d
mov esi, dword [esp + 0x10]
test esi, esi
je 0x401a49
mov eax, dword [esp + 0x14]
test eax, eax
jmp 0x401a39
xor eax, eax
xor esi, esi
mov word [esp + 0x60], si
mov ecx, 0x81
lea edi, [esp + 0x62]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
xor eax, eax
mov word [esp + 0x268], si
mov ecx, 0x81
lea edi, [esp + 0x26a]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [esp + 0x268]
push eax
call fcn.00401050
add esp, 4
test eax, eax
je 0x401995
mov ecx, dword [str.backup]
push ecx
lea edx, [esp + 0x26c]
push edx
lea eax, [esp + 0x68]
push eax
call dword [sym.imp.SHLWAPI.dll_PathCombineW]
cmp ebx, 0x64
je 0x4019c9
lea ecx, [esp + 0x60]
push ecx
lea edx, [esp + 0x26c]
push edx
call fcn.00401440
add esp, 8
cmp ebx, 0x64
je 0x4019c9
push 1
call fcn.00401180
add esp, 4
lea eax, [esp + 0x268]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
push 1
lea ecx, [esp + 0x474]
push 0x4061d8
push ecx
call fcn.00401270
add esp, 0xc
cmp dword [0x4082c0], esi
jne 0x4019d6
cmp ebx, 0x64
jne 0x4019eb
lea edx, [esp + 0x268]
push edx
lea eax, [esp + 0x64]
push eax
call fcn.00401440
add esp, 8
push esi
call fcn.00401180
lea ecx, [esp + 0x64]
push ecx
call fcn.004015f0
add esp, 8
lea edx, [esp + 0x60]
push edx
call dword [sym.imp.KERNEL32.dll_RemoveDirectoryW]
mov esi, dword [esp + 0x10]
test esi, esi
mov edi, dword [esp + 0x14]
je 0x401a29
test edi, edi
je 0x401a20
push esi
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor esi, esi
cmp ebx, 2
je 0x401a33
call fcn.00401370
test esi, esi
je 0x401a49
test edi, edi
je 0x401a42
push esi
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [esp + 0x67c]
xor eax, eax
call fcn.00401ac1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10