Function at 0x40b5e0
Capabilities:
Set current directory

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x53018e
mov eax, dword fs:[0]
push eax
sub esp, 0x824
mov eax, dword [0x58deec]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
lea eax, [ebp - 0x818]
mov ebx, ecx
push eax
mov dword [ebp - 0x820], ebx
mov dword [ebp - 4], 0
call fcn.00406190
add esp, 4
lea ecx, [ebx + 0x5f8]
push eax
mov byte [ebp - 4], 1
call fcn.004056a0
mov eax, dword [ebp - 0x818]
add eax, 0xfffffff0
mov byte [ebp - 4], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40b665
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [ebp - 4], 0xffffffff
jmp 0x40b6e3
mov eax, dword [ebx + 0x5f8]
cmp dword [eax - 4], 1
lea esi, [ebx + 0x5f8]
jle 0x40b700
mov ecx, dword [eax - 0xc]
push ecx
mov ecx, esi
call fcn.00401aa0
mov edx, dword [esi]
mov eax, edx
lea edi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40b707
sub eax, edi
cmp byte [eax + edx - 1], 0x5c
je 0x40b764
push 0x541364
lea edx, [ebp - 0x818]
push esi
push edx
call fcn.00405750
add esp, 0xc
push eax
mov ecx, esi
mov dword [ebp - 4], 4
call fcn.004056a0
mov eax, dword [ebp - 0x818]
add eax, 0xfffffff0
mov dword [ebp - 4], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40b764
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esi]
push 0x5409a6
push eax
call fcn.0051628c
add esp, 8
test eax, eax
sete al
test al, al
je 0x40b797
push 0
push 0x541468
push 0x541450
mov ecx, ebx
call fcn.004188ff
push 0
call fcn.00517932
push 0x400
lea ecx, [ebp - 0x414]
push ecx
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea edx, [ebp - 0x414]
push edx
lea ecx, [ebp - 0x824]
call fcn.00405830
lea eax, [ebp - 0x414]
push eax
mov dword [ebp - 4], 5
call fcn.004077d0
add esp, 4
push eax
lea ecx, [ebp - 0x81c]
call fcn.00405830
mov ecx, dword [ebp - 0x81c]
push 0x5409a6
push ecx
lea ecx, [ebp - 0x824]
mov byte [ebp - 4], 6
call fcn.00408670
mov ecx, dword [ebp - 0x824]
xor eax, eax
test ecx, ecx
setne al
test eax, eax
jne 0x40b815
push 0x80004005
call fcn.00401010
mov eax, dword [esi]
push ecx
push eax
call fcn.005172a3
add esp, 8
test eax, eax
je 0x40b8ec
call fcn.0041e837
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x40b843
push 0x80004005
call fcn.00401010
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [ebp - 0x820], eax
mov ecx, dword [esi]
push ecx
lea edx, [ebp - 0x820]
push 0x5413f8
push edx
mov byte [ebp - 4], 7
call fcn.00401f90
mov eax, dword [ebp - 0x820]
add esp, 0xc
push 0x24
push 0x5413ec
push eax
mov ecx, ebx
call fcn.004188ff
cmp eax, 7
jne 0x40b891
push 0
call fcn.00517932
push ecx
mov ecx, esp
mov dword [ebp - 0x818], esp
push 0x5409a6
call fcn.00405830
push ecx
mov ecx, esp
mov dword [ebp - 0x82c], esp
lea edx, [ebp - 0x81c]
push edx
push esi
push ecx
mov byte [ebp - 4], 8
call fcn.00409340
add esp, 8
lea eax, [ebp - 0x414]
mov ecx, esp
mov dword [ebp - 0x828], esp
push eax
mov byte [ebp - 4], 9
call fcn.00405830
mov ecx, ebx
mov byte [ebp - 4], 7
call fcn.004083a0
push 0
call fcn.00517932
mov eax, dword [ebp - 0x81c]
push ecx
add eax, 0xfffffff0
mov dword [ebp - 0x828], esp
mov edi, esp
push eax
call fcn.00405390
add eax, 0x10
mov dword [edi], eax
mov eax, dword [esi]
sub eax, 0x10
mov dword [ebp - 0x82c], esp
mov edi, esp
push eax
mov byte [ebp - 4], 0xa
call fcn.00405390
add eax, 0x10
mov dword [edi], eax
mov ecx, esp
mov dword [ebp - 0x818], esp
lea edx, [ebp - 0x81c]
push edx
push esi
push ecx
mov byte [ebp - 4], 0xb
call fcn.00409340
add esp, 0xc
mov ecx, ebx
mov byte [ebp - 4], 6
call fcn.00409f70
mov esi, dword [esi]
push esi
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
mov eax, dword [ebp - 0x81c]
add eax, 0xfffffff0
mov byte [ebp - 4], 5
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40b97c
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x824]
add eax, 0xfffffff0
mov dword [ebp - 4], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40b9a5
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.005156a7
mov esp, ebp
pop ebp
ret