Function at 0x402db0
Capabilities:
Set current directory

Disassembly:
sub esp, 0x10c
mov eax, dword [0x40e8fc]
push ebx
push esi
push eax
call fcn.004012f0
mov ecx, dword [0x40e8fc]
mov esi, dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
add esp, 4
push ecx
call esi
push 0x40c144
call esi
mov edx, dword [0x40e8fc]
push edx
call fcn.004012a0
mov eax, dword [0x40e924]
add esp, 4
mov dword [esp + 8], eax
mov eax, dword [0x40e928]
xor ebx, ebx
mov byte [esp + 0x10], 0
test eax, eax
jbe 0x403007
mov edx, dword [0x40e900]
push ebp
push edi
mov ecx, dword [esp + 0x10]
mov ebp, dword [ecx]
test byte [ebp + 8], 2
jne 0x402fec
mov edi, dword [ebp]
cmp byte [edi], 0x2e
jne 0x402e7d
mov edi, dword [0x40e8fc]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [ebp]
cmp byte [eax + 1], 0x5c
jne 0x402e9a
lea edi, [eax + 2]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, dword [0x40e900]
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
jmp 0x402e95
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebp + 4]
mov edx, dword [0x40e900]
mov eax, edx
cmp byte [ecx], 0
je 0x402efd
push edx
call fcn.004012a0
mov edi, dword [ebp + 4]
or ecx, 0xffffffff
xor eax, eax
push 0x5c
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, dword [0x40e900]
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [0x40e900]
push eax
call fcn.004043f0
add esp, 0xc
test eax, eax
je 0x402fa9
mov byte [eax], 0
mov edx, dword [0x40e900]
test eax, eax
je 0x402faf
push edx
call fcn.004012f0
mov edx, dword [0x40e900]
lea ecx, [esp + 0x1c]
push ecx
push edx
call fcn.004049c0
add esp, 0xc
test eax, eax
je 0x402fa9
mov eax, dword [0x40e900]
xor ebp, ebp
push eax
call fcn.004026d0
add esp, 4
test eax, eax
jne 0x402fa9
mov ecx, dword [0x40e900]
push ecx
call fcn.00404960
add esp, 4
test eax, eax
jne 0x402fa9
mov edx, dword [0x40e900]
test ebp, ebp
jne 0x402f84
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
lea esi, [esp + 0x18]
sub edi, ecx
mov eax, ecx
mov dword [esp + 0x14], esi
mov esi, edi
mov edi, dword [esp + 0x14]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
mov ebp, 1
and ecx, 3
rep movsb byte es:[edi], byte [esi]
push 0x5c
push edx
call fcn.004043f0
add esp, 8
test eax, eax
je 0x402fa9
mov byte [eax], 0
mov ecx, dword [0x40e900]
push ecx
call fcn.004026d0
add esp, 4
test eax, eax
je 0x402f3b
mov edx, dword [0x40e900]
mov ecx, dword [0x40e938]
test ecx, ecx
je 0x402fec
mov edx, dword [0x40e920]
mov eax, dword [0x40e918]
mov edi, dword [0x40e928]
add eax, edx
add eax, edi
xor edx, edx
add eax, ebx
lea eax, [eax + eax*4]
lea eax, [eax + eax*4]
shl eax, 2
div ecx
push eax
call fcn.00401d20
mov edx, dword [0x40e900]
add esp, 4
mov ecx, dword [esp + 0x10]
mov eax, dword [0x40e928]
inc ebx
add ecx, 4
cmp ebx, eax
mov dword [esp + 0x10], ecx
jb 0x402e10
pop edi
pop ebp
mov ecx, dword [0x40e8fc]
push ecx
call fcn.004012a0
add esp, 4
pop esi
pop ebx
add esp, 0x10c
ret