Function at 0x418590
Capabilities:
Set current directory

Disassembly:
sub esp, 0xc
push ebx
push ebp
push esi
xor ebx, ebx
mov esi, eax
push edi
mov byte [0x4cc790], 1
mov word [0x4ccffc], bx
cmp esi, ebx
jne 0x4185b3
mov esi, dword [0x4ccfe0]
cmp dword [0x4cc494], ebx
jne 0x4185c9
call fcn.00474770
mov dword [0x4cc494], eax
cmp eax, ebx
je 0x418615
mov ecx, dword [0x4cc498]
cmp dword [ecx + 8], 0x14
jae 0x4185e7
call fcn.00474770
mov ecx, dword [0x4cc498]
mov dword [ecx + 0xc], eax
cmp eax, ebx
je 0x418615
mov eax, dword [ecx + 4]
add dword [ecx + 8], 0xffffffec
lea edx, [eax + 0x14]
mov dword [0x4cc49c], eax
mov dword [ecx + 4], edx
cmp eax, ebx
je 0x418615
mov dword [eax], vtable.Label.0
mov dword [eax + 4], 0x4a4910
mov dword [eax + 8], ebx
mov dword [eax + 0xc], ebx
mov dword [eax + 0x10], ebx
jmp 0x418617
xor eax, eax
mov dword [0x4ccb50], eax
cmp eax, ebx
je 0x418831
cmp dword [0x4ccff8], 2
mov eax, 0x4a968c
je 0x418634
mov eax, esi
mov edi, dword [0x4cc478]
push eax
lea eax, [esp + 0x14]
push eax
mov dword [esp + 0x18], ebx
call fcn.004189a0
mov ebp, dword [esp + 0x10]
mov esi, eax
cmp esi, 3
jne 0x41865d
push edi
push ebp
call fcn.00418a70
mov esi, eax
mov edi, 1
cmp ebp, ebx
je 0x418670
mov edx, dword [ebp]
mov eax, dword [edx]
push edi
mov ecx, ebp
call eax
cmp esi, edi
jne 0x418831
push ebx
push ebx
push ebx
push 0x68
push 0x4cc518
call fcn.0041efb0
test eax, eax
je 0x418831
mov ecx, dword [0x4cc51c]
mov dword [ecx + 0xc], edi
mov eax, dword [0x4cc518]
call fcn.004246d0
test eax, eax
je 0x418831
mov eax, dword [0x4cc518]
call fcn.00424780
cmp dword [0x4cc520], ebx
je 0x4186e3
mov eax, dword [0x4cc518]
mov edx, dword [0x4cc524]
mov dword [edx + 0x14], eax
mov ecx, dword [0x4cc518]
mov edx, dword [0x4cc524]
mov dword [ecx + 0x10], edx
mov eax, dword [0x4cc520]
mov dword [0x4cc518], eax
xor ebp, ebp
cmp dword [0x4cc534], ebx
jle 0x41872a
lea ecx, [ecx]
mov ecx, dword [0x4cc530]
mov edi, dword [ecx + ebp*4]
cmp byte [edi + 0x3d], bl
jne 0x41871c
test byte [edi + 0x3c], 4
jne 0x41871c
mov eax, dword [edi + 0x1c]
lea esi, [edi + 0x28]
push edi
call fcn.00431470
mov eax, dword [edi + 0x20]
lea esi, [edi + 0x30]
push edi
call fcn.00431470
inc ebp
cmp ebp, dword [0x4cc534]
jl 0x4186f0
mov edi, 1
cmp dword [0x4cc77c], ebx
je 0x418752
call fcn.004220a0
test eax, eax
je 0x418831
mov eax, dword [0x4cc77c]
mov edx, dword [eax]
push eax
mov eax, dword [edx + 8]
call eax
mov dword [0x4cc77c], ebx
cmp dword [0x4cb6a8], ebx
je 0x41875f
call fcn.00431510
mov ecx, dword [0x4cbd68]
push ecx
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
add dword [0x4cc78c], edi
push ebx
push ebx
push ebx
push 0x68
push 0x4cc518
call fcn.0041efb0
test eax, eax
je 0x418831
push ebx
push ebx
push ebx
push 0x68
push 0x4cc518
call fcn.0041efb0
test eax, eax
je 0x418831
mov edx, dword [0x4cc51c]
mov eax, dword [edx + 0x10]
mov dword [eax + 0xc], edi
mov ecx, dword [0x4cc51c]
mov dword [ecx + 0xc], edi
mov edx, dword [0x4ccb50]
mov eax, dword [0x4cc51c]
push ebx
push ebx
mov dword [edx + 8], eax
mov ecx, dword [0x4cc518]
push ebx
push ecx
mov ecx, 0x4cc518
call fcn.004247f0
test eax, eax
je 0x418831
mov eax, dword [0x4cc518]
call fcn.00424c10
test eax, eax
je 0x418831
push 3
push ebx
push 0x4a9690
mov ecx, 0x4cc518
call fcn.00423cc0
mov dword [0x4cbd60], eax
cmp eax, ebx
je 0x418831
push edi
push ebx
push 0xffffffffffffffff
push 0x4a4920
push eax
call fcn.0047a6b0
lea edx, [esp + 0x10]
push edx
call dword [sym.imp.KERNEL32.dll_GetSystemTimeAsFileTime]
mov eax, dword [esp + 0x10]
call fcn.00414ed0
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0xc
ret