Function at 0x4574bd
Capabilities:
Get common file path
Set current directory
Set environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
mov al, byte [0x48ab86]
mov byte [ebp - 2], al
mov al, byte [ebp + 0x14]
and al, 0x10
mov byte [ebp - 3], al
mov al, byte [ebp + 0x14]
and byte [ebp + 0x14], 1
push ebx
and al, 0x40
xor ebx, ebx
cmp dword [ebp + 0xc], ebx
push esi
mov byte [ebp - 1], al
mov eax, dword [ebp + 8]
push edi
mov dword [ebp - 8], ecx
jne 0x4574f2
mov dword [ebp + 0xc], eax
cmp dword [ebp + 0x18], ebx
jne 0x4574fa
mov dword [ebp + 0x18], eax
mov edi, dword [ecx + 0x28]
push eax
lea ecx, [ebp - 0xc]
mov dword [ebp - 0x10], edi
mov dword [ebp - 0xc], ebx
call fcn.0043eac6
xor eax, eax
cmp dword [ebp + 0x10], ebx
mov dword [ebp + 8], ebx
setne al
cmp eax, ebx
mov dword [ebp - 0x14], eax
je 0x457539
push 0x20a
lea ecx, [ebp + 8]
call fcn.00424699
push dword [ebp + 8]
push 0x208
call dword [sym.imp.KERNEL32.DLL_GetCurrentDirectoryW]
push 0x8a0
call fcn.00461a38
mov esi, eax
cmp esi, ebx
pop ecx
je 0x457566
push ebx
push ebx
push ebx
push ebx
push ebx
push 0x271c
call dword [sym.imp.USER32.dll_GetDesktopWindow]
push eax
mov ecx, esi
call fcn.00435306
mov esi, eax
jmp 0x457568
xor esi, esi
cmp esi, ebx
mov dword [ebp - 0x1c], esi
jne 0x457571
mov esi, edi
push 0x58
call fcn.00461a38
cmp eax, ebx
pop ecx
je 0x45758c
push esi
push dword [ebp - 8]
mov ecx, eax
call fcn.004342c2
mov edi, eax
jmp 0x45758e
xor edi, edi
cmp edi, ebx
mov dword [ebp - 0x18], edi
jne 0x457598
mov edi, dword [ebp - 8]
push dword [ebp + 0xc]
lea eax, [ebp - 0xc]
mov dword [edi + 0x38], eax
mov eax, dword [ebp - 0xc]
mov ebx, dword [eax]
mov ecx, edi
mov dword [edi + 0x3c], ebx
call fcn.0042da2a
push ebx
call fcn.0046176a
mov dword [edi + 0x40], eax
mov eax, dword [ebp + 0x18]
xor ebx, ebx
cmp dword [ebp - 0x14], ebx
mov dword [esi + 0xf0], eax
pop ecx
mov dword [edi + 0x18], ebx
je 0x457616
lea ecx, [ebp + 0xc]
call fcn.0042460b
cmp byte [ebp - 1], bl
jne 0x4575ff
push 1
lea eax, [ebp + 0xc]
push eax
push dword [ebp + 0x10]
call fcn.0042921d
add esp, 0xc
push dword [ebp + 0xc]
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.DLL_lstrcmpiW]
test eax, eax
jne 0x4575ff
mov byte [ebp - 1], 0x40
movsx eax, byte [ebp - 1]
push eax
push dword [ebp + 0x10]
mov ecx, edi
call fcn.00412131
lea ecx, [ebp + 0xc]
call fcn.00424686
cmp dword [ebp + 0x10], ebx
jne 0x457622
mov dword [ebp + 0x10], 0x4758e0
mov eax, dword [esi + 0x8c]
mov dword [esi + 0xe8], edi
mov dword [eax], edi
push esi
mov byte [esi + 0x4a], 1
mov byte [esi + 0x49], 0xff
call fcn.0042158d
cmp byte [ebp - 2], 0
pop ecx
mov ebx, 0x48b5d4
jne 0x457664
cmp dword [ebp - 0x10], 0
je 0x457664
push ebx
call dword [sym.imp.KERNEL32.DLL_EnterCriticalSection]
mov eax, dword [ebp - 0x10]
inc dword [eax + 0x6c]
push ebx
call dword [sym.imp.KERNEL32.DLL_LeaveCriticalSection]
mov eax, dword [ebp - 8]
mov al, byte [eax + 0xb]
test al, al
je 0x457671
mov byte [edi + 0xb], al
cmp byte [ebp - 3], 0
mov al, byte [ebp + 0x14]
mov byte [edi + 0xa], al
jne 0x4576ca
push ebx
call dword [sym.imp.KERNEL32.DLL_EnterCriticalSection]
mov ecx, dword [ebp - 8]
push 0xffffffffffffffff
push 0
push str.__MAIN__
call fcn.0040e8be
test eax, eax
je 0x4576b2
push dword [eax]
push 0x47cae0
call fcn.004257d3
test al, al
pop ecx
pop ecx
jne 0x4576c3
push 0x476efc
jmp 0x4576b7
push 0x479068
mov ecx, edi
push 0x47cdac
call fcn.00428e1b
push ebx
call dword [sym.imp.KERNEL32.DLL_LeaveCriticalSection]
cmp dword [0x48ade4], 0
je 0x45770c
mov eax, dword [ebp + 0x10]
cmp word [eax], 0
je 0x45770c
push str.ENTER:
lea ecx, [ebp + 0x14]
call fcn.0042a183
push dword [ebp + 0x10]
lea ecx, [ebp + 0x14]
call fcn.004246c0
push 0
push 0x11
push 0
push dword [ebp + 0x14]
mov ecx, edi
call fcn.00412a57
lea ecx, [ebp + 0x14]
call fcn.00424686
cmp byte [ebp - 2], 0
mov byte [edi + 0x4c], 1
mov ecx, esi
je 0x457772
mov eax, dword [esi]
push 0
push 0x271d
mov byte [esi + 0x49], 0x81
mov byte [esi + 0x48], 0x10
call dword [eax + 8]
push dword [ebp + 0x18]
and dword [esi + 0xf0], 0
mov ecx, edi
call fcn.0045051f
xor eax, eax
cmp dword [esi + 0x6c], eax
jg 0x457752
mov ecx, dword [esi + 0x58]
cmp dword [ecx], eax
jg 0x457752
mov ecx, dword [esi + 0x68]
cmp dword [ecx], eax
jle 0x45777b
push eax
push eax
push 0x10
push dword [esi + 0x18]
mov byte [esi + 0x49], 0xff
call dword [sym.imp.USER32.dll_PostMessageW]
push 0x20
mov ecx, esi
call fcn.00433e4b
mov byte [esi + 0x49], 0x81
jmp 0x45777b
mov byte [esi + 0x48], 0
call fcn.00433f87
mov esi, dword [ebp + 0x10]
cmp word [esi], 0
je 0x4577b2
push str.LEAVE:
lea ecx, [ebp + 0x14]
call fcn.0042a183
push esi
lea ecx, [ebp + 0x14]
call fcn.004246c0
push 0
push 0x11
push 0
push dword [ebp + 0x14]
mov ecx, edi
call fcn.00412a57
lea ecx, [ebp + 0x14]
call fcn.00424686
mov esi, dword [sym.imp.KERNEL32.DLL_EnterCriticalSection]
push ebx
call esi
and dword [edi + 0x3c], 0
and dword [edi + 0x38], 0
push ebx
call dword [sym.imp.KERNEL32.DLL_LeaveCriticalSection]
mov eax, dword [edi + 0x48]
lea ecx, [ebp - 0x18]
mov dword [ebp + 0x14], eax
call fcn.0043449e
mov ecx, dword [ebp - 0x1c]
test ecx, ecx
je 0x4577e6
mov eax, dword [ecx]
push 1
call dword [eax + 0xc]
cmp byte [ebp - 2], 0
jne 0x457818
mov edi, dword [ebp - 0x10]
test edi, edi
je 0x457818
push ebx
call esi
dec dword [edi + 0x6c]
cmp byte [edi + 0x49], 0x81
je 0x457811
push 0
push 0
push 0x43d
push dword [edi + 0x18]
call dword [sym.imp.USER32.dll_PostMessageW]
push ebx
call dword [sym.imp.KERNEL32.DLL_LeaveCriticalSection]
call fcn.00428817
xor edi, edi
cmp dword [ebp - 0x14], edi
je 0x45789f
push ebx
call esi
mov ecx, dword [ebp - 8]
push 0xffffffffffffffff
push edi
push 0x477ff4
call fcn.0040e8be
cmp eax, edi
mov esi, dword [sym.imp.KERNEL32.DLL_SetEnvironmentVariableW]
je 0x45784a
push dword [eax]
push str.CurDir
call esi
mov ecx, dword [ebp - 8]
push 0xffffffffffffffff
push edi
push str.CurDrv
call fcn.0040e8be
cmp eax, edi
je 0x457867
push dword [eax]
push 0x47cd7c
call esi
mov ecx, dword [ebp - 8]
push 0xffffffffffffffff
push edi
push str.CurFile
call fcn.0040e8be
cmp eax, edi
je 0x457884
push dword [eax]
push 0x47cd58
call esi
cmp byte [ebp - 1], 0
jne 0x457898
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.DLL_SetCurrentDirectoryW]
call fcn.0040a118
push ebx
call dword [sym.imp.KERNEL32.DLL_LeaveCriticalSection]
cmp byte [ebp - 2], 0
jne 0x4578ae
mov ecx, dword [ebp - 8]
push edi
call fcn.0044c8fd
lea ecx, [ebp + 8]
call fcn.00424686
lea ecx, [ebp - 0xc]
call fcn.00434280
mov eax, dword [ebp + 0x14]
pop edi
pop esi
pop ebx
leave
ret 0x14