Function at 0x40a9f0
Capabilities:
Set current directory
Terminate process

Disassembly:
push ebp
lea ebp, [esp - 0x804]
sub esp, 0x804
push 0xffffffffffffffff
push 0x44f600
mov eax, dword fs:[0]
push eax
sub esp, 0x20
mov eax, dword [0x46b9d8]
xor eax, ebp
mov dword [ebp + 0x800], 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 - 0x14]
mov ebx, ecx
push eax
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 4], 0
call fcn.00405ee0
add esp, 4
lea ecx, [ebx + 0x4e8]
push eax
mov byte [ebp - 4], 1
call fcn.00405310
mov eax, dword [ebp - 0x14]
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 0x40aa77
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [ebp - 4], 0xffffffff
jmp 0x40aada
mov eax, dword [ebx + 0x4e8]
lea esi, [ebx + 0x4e8]
sub eax, 0x10
cmp dword [eax + 0xc], 1
jle 0x40aafa
mov ecx, dword [eax + 4]
push ecx
mov ecx, esi
call fcn.00402cc0
mov edx, dword [esi]
mov eax, edx
lea edi, [eax + 1]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x40ab01
sub eax, edi
cmp byte [eax + edx - 1], 0x5c
je 0x40ab5a
push 0x454a74
lea edx, [ebp - 0x14]
push esi
push edx
call fcn.004053d0
add esp, 0xc
push eax
mov ecx, esi
mov dword [ebp - 4], 4
call fcn.00405310
mov eax, dword [ebp - 0x14]
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 0x40ab5a
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esi]
push 0x4541f2
push eax
call fcn.00438429
add esp, 8
test eax, eax
sete al
test al, al
je 0x40ab8d
push 0
push 0x454b78
push 0x454b60
mov ecx, ebx
call fcn.00415d02
push 0
call fcn.004396d7
push 0x400
lea ecx, [ebp + 0x400]
push ecx
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea edx, [ebp + 0x400]
push edx
lea ecx, [ebp - 0x20]
call fcn.00405510
lea eax, [ebp + 0x400]
push eax
mov dword [ebp - 4], 5
call fcn.004073a0
add esp, 4
push eax
lea ecx, [ebp - 0x18]
call fcn.00405510
mov ecx, dword [ebp - 0x18]
push 0x4541f2
push ecx
lea ecx, [ebp - 0x20]
mov byte [ebp - 4], 6
call fcn.00408150
mov edx, dword [ebp - 0x20]
mov eax, dword [esi]
push edx
push eax
call fcn.00438e96
add esp, 8
test eax, eax
je 0x40aca9
call fcn.0041b539
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x40ac15
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 - 0x1c], eax
mov ecx, dword [esi]
push ecx
lea edx, [ebp - 0x1c]
push 0x454b08
push edx
mov byte [ebp - 4], 7
call fcn.004086d0
mov eax, dword [ebp - 0x1c]
add esp, 0xc
push 0x24
push 0x454afc
push eax
mov ecx, ebx
call fcn.00415d02
cmp eax, 7
jne 0x40ac5a
push 0
call fcn.004396d7
push ecx
mov ecx, esp
mov dword [ebp - 0x14], esp
push 0x4541f2
call fcn.00405510
push ecx
mov ecx, esp
mov dword [ebp - 0x28], esp
lea edx, [ebp - 0x18]
push edx
push esi
push ecx
mov byte [ebp - 4], 8
call fcn.004089e0
add esp, 8
lea eax, [ebp + 0x400]
mov ecx, esp
mov dword [ebp - 0x24], esp
push eax
mov byte [ebp - 4], 9
call fcn.00405510
mov ecx, ebx
mov byte [ebp - 4], 7
call fcn.00407da0
push 0
call fcn.004396d7
mov eax, dword [ebp - 0x18]
push ecx
add eax, 0xfffffff0
mov dword [ebp - 0x24], esp
mov edi, esp
push eax
call fcn.00404ff0
add eax, 0x10
mov dword [edi], eax
mov eax, dword [esi]
sub eax, 0x10
mov dword [ebp - 0x28], esp
mov edi, esp
push eax
mov byte [ebp - 4], 0xa
call fcn.00404ff0
add eax, 0x10
mov dword [edi], eax
mov ecx, esp
mov dword [ebp - 0x14], esp
lea edx, [ebp - 0x18]
push edx
push esi
push ecx
mov byte [ebp - 4], 0xb
call fcn.004089e0
add esp, 0xc
mov ecx, ebx
mov byte [ebp - 4], 6
call fcn.004093b0
mov esi, dword [esi]
push esi
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
mov eax, dword [ebp - 0x18]
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 0x40ad27
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x20]
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 0x40ad4d
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 + 0x800]
xor ecx, ebp
call fcn.00437acc
add ebp, 0x804
mov esp, ebp
pop ebp
ret