Function at 0x40c560
Capabilities:
Set current directory

Disassembly:
mov eax, dword [0x49d540]
push esi
mov esi, dword [sym.imp.KERNEL32.dll_FreeLibrary]
test eax, eax
je 0x40c57d
push eax
call esi
mov dword [0x49d540], 0
push 0xffffffffffffffff
push dword [0x49d7c4]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [0x49d3b0]
test eax, eax
je 0x40c5a1
push eax
call esi
mov dword [0x49d3b0], 0
mov eax, dword [0x49d5e4]
test eax, eax
je 0x40c5f0
push eax
call fcn.004660d5
mov esi, eax
add esp, 4
test esi, esi
je 0x40c5f0
push 0x5c
push esi
call fcn.004622e5
add esp, 8
test eax, eax
je 0x40c5e7
mov ecx, eax
sub ecx, esi
sar ecx, 1
cmp ecx, 3
jae 0x40c5db
xor ecx, ecx
mov word [eax + 2], cx
jmp 0x40c5e0
xor ecx, ecx
mov word [eax], cx
push esi
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
push esi
call fcn.004648aa
add esp, 4
mov esi, dword [0x49d7c8]
test esi, esi
je 0x40c677
cmp word [esi], 0
je 0x40c66e
push esi
call fcn.00465b90
mov eax, esi
add esp, 4
lea edx, [eax + 2]
nop
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40c610
sub eax, edx
sar eax, 1
lea esi, [esi + eax*2]
add esi, 2
cmp word [esi], cx
jne 0x40c600
mov ecx, dword [0x49d3b4]
mov edx, ecx
lea esi, [edx + 2]
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x40c635
sub edx, esi
sar edx, 1
cmp edx, 3
jle 0x40c658
cmp word [ecx + edx*2 - 2], 0x5c
jne 0x40c658
xor eax, eax
mov word [ecx + edx*2 - 2], ax
call fcn.0040c2f0
mov ecx, dword [0x49d3b4]
call fcn.0045ee00
mov esi, dword [0x49d7c8]
push esi
call fcn.004648aa
add esp, 4
mov ecx, dword [0x49d3b4]
test ecx, ecx
je 0x40c78f
mov eax, dword [0x49c268]
cmp eax, 0xffffffff
je 0x40c6a6
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [0x49d3b4]
mov dword [0x49c268], 0xffffffff
lea edx, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40c6b0
sub ecx, edx
push ebx
sar ecx, 1
push edi
push 2
lea eax, [ecx + 0x14]
push eax
call fcn.00464894
mov edx, dword [0x49d3b4]
mov edi, eax
mov esi, edi
add esp, 8
sub esi, edx
nop dword [eax + eax]
movzx ecx, word [edx]
lea edx, [edx + 2]
mov word [esi + edx - 2], cx
test cx, cx
jne 0x40c6e0
lea ecx, [edi - 2]
mov ax, word [ecx + 2]
lea ecx, [ecx + 2]
test ax, ax
jne 0x40c6f3
mov eax, dword [str..lock]
mov dword [ecx], eax
mov eax, dword [0x48ccb0]
mov dword [ecx + 4], eax
mov eax, dword [0x48ccb4]
push edi
mov dword [ecx + 8], eax
call fcn.00465b90
push edi
call fcn.004648aa
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
add esp, 8
xor esi, esi
nop dword [eax]
mov edx, dword [0x49d3b4]
mov ecx, edx
lea edi, [ecx + 2]
nop dword [eax + eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40c740
sub ecx, edi
sar ecx, 1
cmp ecx, 3
jle 0x40c763
cmp word [edx + ecx*2 - 2], 0x5c
jne 0x40c763
xor eax, eax
mov word [edx + ecx*2 - 2], ax
push edx
call fcn.00466021
add esp, 4
test eax, eax
je 0x40c787
call fcn.004660c2
cmp dword [eax], 2
je 0x40c787
push 0x3e8
call ebx
inc esi
cmp esi, 3
jl 0x40c730
mov ecx, dword [0x49d3b4]
pop edi
pop ebx
push ecx
call fcn.004648aa
add esp, 4
mov dword [0x49d3b4], 0
push dword [0x49d7c4]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push dword [0x49d7c4]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [0x49d53c]
pop esi
test eax, eax
je 0x40c7d7
push eax
call fcn.004648aa
add esp, 4
mov dword [0x49d53c], 0
push dword [0x49d5e4]
call fcn.004648aa
add esp, 4
mov dword [0x49d5e4], 0
ret