Function at 0x402014
Capabilities:
Set current directory

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffe84
push ebx
push esi
push edi
mov edi, dword [ebp + 0x1c]
mov esi, dword [ebp + 0x18]
mov ebx, dword [ebp + 0x14]
lea edx, [ebp + 0x10]
lea eax, [ebp + 0x10]
call fcn.00420000
lea edx, [ebp + 0xc]
lea eax, [ebp + 0xc]
call fcn.00420000
lea edx, [ebp + 8]
lea eax, [ebp + 8]
call fcn.00420000
inc dword [edi]
mov edx, 0x4210e7
lea eax, [ebp - 4]
call fcn.0041ffc8
lea edx, [ebp - 4]
lea eax, [ebp + 0x10]
call fcn.00420168
push eax
lea eax, [ebp - 4]
mov edx, 2
call fcn.00420080
pop ecx
test cl, cl
je 0x40207c
mov eax, dword [ebp + 0x24]
inc dword [eax]
cmp dword [ebp + 0x10], 0
je 0x402087
mov edx, dword [ebp + 0x10]
jmp 0x40208c
mov edx, 0x4210e9
push edx
call sub.KERNEL32.DLL_SetCurrentDirectoryA
test eax, eax
je 0x40230d
mov eax, dword [edi]
cmp eax, dword [ebp + 0x20]
jge 0x4022d3
mov ecx, dword [ebp + 0x24]
mov eax, dword [ecx]
cmp eax, dword [ebp + 0x28]
jg 0x4022d3
push esi
push ebx
mov edx, dword [ebp + 0xc]
push edx
mov ecx, dword [ebp + 8]
push ecx
call fcn.004017e4
add esp, 0x10
cmp esi, dword [ebx]
jle 0x4022d3
xor eax, eax
mov dword [ebp - 0x170], eax
mov edx, 0x4210ea
lea eax, [ebp - 8]
call fcn.0041ffc8
mov eax, dword [eax]
lea ecx, [ebp - 0x17c]
mov edx, 0x37
call fcn.00403708
test eax, eax
sete al
and eax, 1
push eax
lea eax, [ebp - 8]
mov edx, 2
call fcn.00420080
pop ecx
test cl, cl
je 0x4022b8
test byte [ebp - 0x174], 0x10
je 0x40229a
mov edx, 0x4210ee
lea eax, [ebp - 0xc]
call fcn.0041ffc8
lea edx, [ebp - 0xc]
lea eax, [ebp - 0x170]
call fcn.00420168
test al, al
lea eax, [ebp - 0xc]
setne cl
and ecx, 1
mov edx, 2
push ecx
call fcn.00420080
pop ecx
test ecx, ecx
je 0x40229a
mov edx, 0x4210f0
lea eax, [ebp - 0x10]
call fcn.0041ffc8
lea edx, [ebp - 0x10]
lea eax, [ebp - 0x170]
call fcn.00420168
test al, al
lea eax, [ebp - 0x10]
setne cl
and ecx, 1
mov edx, 2
push ecx
call fcn.00420080
pop ecx
test ecx, ecx
je 0x40229a
mov edx, 0x4210f3
lea eax, [ebp - 0x14]
call fcn.0041ffc8
lea edx, [ebp - 0x14]
lea eax, [ebp - 0x170]
call fcn.00420168
test al, al
lea eax, [ebp - 0x14]
setne cl
and ecx, 1
mov edx, 2
push ecx
call fcn.00420080
pop ecx
test ecx, ecx
je 0x40229a
mov edx, 0x4210f5
lea eax, [ebp - 0x18]
call fcn.0041ffc8
lea edx, [ebp - 0x18]
lea eax, [ebp - 0x170]
call fcn.00420168
test al, al
lea eax, [ebp - 0x18]
setne cl
and ecx, 1
mov edx, 2
push ecx
call fcn.00420080
pop ecx
test ecx, ecx
je 0x40229a
mov edx, 0x4210f8
lea eax, [ebp - 0x1c]
call fcn.0041ffc8
lea edx, [ebp - 0x1c]
lea eax, [ebp - 0x170]
call fcn.00420168
test al, al
lea eax, [ebp - 0x1c]
setne cl
and ecx, 1
mov edx, 2
push ecx
call fcn.00420080
pop ecx
test ecx, ecx
je 0x40229a
mov edx, 0x4210fc
lea eax, [ebp - 0x20]
call fcn.0041ffc8
lea edx, [ebp - 0x20]
lea eax, [ebp - 0x170]
call fcn.00420168
test al, al
lea eax, [ebp - 0x20]
setne cl
and ecx, 1
mov edx, 2
push ecx
call fcn.00420080
pop ecx
test ecx, ecx
je 0x40229a
mov eax, dword [ebp + 0x28]
push eax
mov edx, dword [ebp + 0x24]
push edx
mov ecx, dword [ebp + 0x20]
push ecx
push edi
push esi
push ebx
mov eax, dword [ebp - 0x170]
push eax
mov edx, dword [ebp + 0xc]
push edx
mov ecx, dword [ebp + 8]
push ecx
call fcn.00402014
add esp, 0x24
lea eax, [ebp - 0x17c]
call fcn.00403758
test eax, eax
jne 0x4022b8
cmp esi, dword [ebx]
jle 0x4022b8
mov edx, dword [edi]
cmp edx, dword [ebp + 0x20]
jl 0x402113
lea eax, [ebp - 0x17c]
call fcn.0040377c
lea eax, [ebp - 0x170]
mov edx, 2
call fcn.00420080
mov edx, 0x421101
lea eax, [ebp - 0x24]
call fcn.0041ffc8
lea edx, [ebp - 0x24]
lea eax, [ebp + 0x10]
call fcn.00420168
push eax
lea eax, [ebp - 0x24]
mov edx, 2
call fcn.00420080
pop ecx
test cl, cl
je 0x40230d
push 0x421103
call sub.KERNEL32.DLL_SetCurrentDirectoryA
mov eax, dword [ebp + 0x24]
dec dword [eax]
lea eax, [ebp + 8]
mov edx, 2
call fcn.00420080
lea eax, [ebp + 0xc]
mov edx, 2
call fcn.00420080
lea eax, [ebp + 0x10]
mov edx, 2
call fcn.00420080
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret