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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x3c
push ebx
push esi
push edi
mov esi, ecx
mov dword [ebp - 0xc], esi
movzx eax, word [ebp + 0x14]
mov ebx, dword [ebp + 0x14]
mov dl, byte [esi + 0xe]
mov cl, al
and cl, 4
mov byte [ebp - 3], cl
mov cl, byte [0x48fba6]
mov byte [ebp - 2], cl
mov cl, al
and cl, 0x10
mov byte [ebp - 5], cl
mov cl, al
and cl, 0x40
mov byte [ebp - 1], cl
mov ecx, eax
shr ecx, 1
shl cl, 7
and dl, 0x7f
or cl, dl
mov dword [ebp + 0x14], eax
and al, 1
xor edi, edi
shr ebx, 0x10
cmp dword [ebp + 0xc], edi
mov byte [esi + 0xe], cl
mov ecx, dword [ebp + 8]
mov byte [ebp - 4], al
jne 0x45b565
mov dword [ebp + 0xc], ecx
cmp dword [ebp + 0x18], edi
jne 0x45b56d
mov dword [ebp + 0x18], ecx
mov eax, dword [esi + 0x28]
xor edx, edx
cmp eax, edi
setne dl
push ecx
lea ecx, [ebp - 0x20]
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x20], edi
mov dword [ebp - 0x1c], edx
call fcn.0044e8ba
xor eax, eax
cmp dword [ebp + 0x10], edi
mov dword [ebp - 0x18], edi
setne al
cmp eax, edi
mov dword [ebp - 0x24], eax
je 0x45b5b6
push 0x20a
lea ecx, [ebp - 0x18]
call fcn.0042aeff
push dword [ebp - 0x18]
push 0x208
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
cmp dword [ebp - 0x1c], edi
mov dword [ebp - 0x10], edi
je 0x45b600
cmp byte [ebp - 3], 0
jne 0x45b600
push 1
call fcn.00458be6
mov dword [esp], 0x8a0
call fcn.004669a8
cmp eax, edi
pop ecx
mov dword [ebp + 8], eax
je 0x45b5fd
push edi
push edi
push edi
push edi
push edi
push 0x271c
call dword [sym.imp.USER32.dll_GetDesktopWindow]
mov ecx, dword [ebp + 8]
push eax
call fcn.004361f8
mov dword [ebp - 0x10], eax
jmp 0x45b600
mov dword [ebp - 0x10], edi
mov eax, dword [ebp - 0x10]
cmp eax, edi
mov dword [ebp - 0x28], eax
mov edi, eax
jne 0x45b60f
mov edi, dword [ebp - 0x14]
mov ecx, dword [ebp + 0x1c]
test ecx, ecx
je 0x45b619
mov dword [ecx + 0x28], edi
xor eax, eax
test ecx, ecx
jne 0x45b640
push 0x90
call fcn.004669a8
test eax, eax
pop ecx
je 0x45b639
push edi
push esi
mov ecx, eax
call fcn.0041e1e7
jmp 0x45b63b
xor eax, eax
mov dword [ebp + 0x1c], eax
mov ecx, eax
test ecx, ecx
mov dword [ebp - 0x3c], eax
je 0x45b649
mov esi, ecx
mov eax, dword [esi + 0x28]
mov word [esi + 8], bx
mov ebx, 0x49062c
push ebx
mov dword [ebp - 0x38], eax
mov dword [esi + 0x28], edi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [esi + 0x3c]
mov dword [ebp - 0x30], eax
mov eax, dword [esi + 0x40]
mov dword [ebp - 0x34], eax
mov al, byte [esi + 0xb]
mov byte [ebp - 6], al
mov eax, dword [esi + 4]
mov dword [ebp - 0x2c], eax
mov al, byte [esi + 0x86]
push ebx
mov byte [ebp - 7], al
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
lea eax, [ebp - 0x20]
mov dword [esi + 0x3c], eax
mov eax, dword [ebp - 0x20]
mov eax, dword [eax]
push 1
push dword [ebp + 0xc]
mov ecx, esi
mov dword [ebp + 8], eax
mov dword [esi + 0x40], eax
call fcn.0042d162
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov dword [esi + 0x48], eax
xor eax, eax
cmp dword [ebp - 0x1c], eax
je 0x45b6c3
mov ecx, dword [ebp + 0x18]
mov dword [edi + 0x118], ecx
test byte [ebp + 0x14], 0x10
mov dword [esi + 0x18], eax
je 0x45b6d0
or byte [esi + 0xb], 1
test byte [ebp + 0x14], 0x20
je 0x45b6dd
or byte [esi + 0x86], 1
cmp dword [ebp - 0x24], eax
je 0x45b72c
lea ecx, [ebp + 0x14]
call fcn.0042aeb8
cmp byte [ebp - 1], 0
jne 0x45b715
push 1
lea eax, [ebp + 0x14]
push eax
push dword [ebp + 0x10]
call fcn.004334dc
add esp, 0xc
push dword [ebp + 0x14]
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_lstrcmpiW]
test eax, eax
jne 0x45b715
mov byte [ebp - 1], 0x40
movsx eax, byte [ebp - 1]
push eax
push dword [ebp + 0x10]
mov ecx, esi
call fcn.00413a63
lea ecx, [ebp + 0x14]
call fcn.0042602e
xor eax, eax
cmp dword [ebp + 0x10], eax
jne 0x45b73a
mov dword [ebp + 0x10], 0x47a8e8
cmp dword [ebp - 0x1c], eax
je 0x45b784
cmp dword [ebp - 0x10], eax
je 0x45b784
mov eax, dword [edi + 0xb4]
mov dword [edi + 0x110], esi
mov dword [eax], esi
push edi
mov byte [edi + 0x4e], 1
mov byte [edi + 0x4d], 0xff
call fcn.0042a75d
cmp byte [ebp - 2], 0
pop ecx
jne 0x45b784
cmp dword [ebp - 0x14], 0
je 0x45b784
push ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [ebp - 0x14]
inc dword [eax + 0x94]
push ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [ebp - 0xc]
mov al, byte [eax + 0xd]
test al, al
je 0x45b791
mov byte [esi + 0xd], al
cmp byte [ebp - 5], 0
mov al, byte [ebp - 4]
mov byte [esi + 0xc], al
jne 0x45b7eb
push ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ecx, dword [ebp - 0xc]
push 0xffffffffffffffff
push 0
push str.__MAIN__
call fcn.0040f7cf
test eax, eax
jne 0x45b7c0
mov eax, 0x47e400
jmp 0x45b7d7
push dword [eax]
push 0x481040
call fcn.00426fa9
test al, al
pop ecx
pop ecx
jne 0x45b7e4
mov eax, 0x47c098
push eax
push 0x482444
mov ecx, esi
call fcn.00429dbf
push ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp dword [0x48fdf8], 0
je 0x45b833
mov eax, dword [ebp + 0x10]
cmp word [eax], 0
je 0x45b833
test byte [esi + 0xe], 8
jne 0x45b833
push str.ENTER:
lea ecx, [ebp + 0x14]
call fcn.00434695
push dword [ebp + 0x10]
lea ecx, [ebp + 0x14]
call fcn.0042af26
push 0
push 0x11
push 0
push dword [ebp + 0x14]
mov ecx, esi
call fcn.004159f3
lea ecx, [ebp + 0x14]
call fcn.0042602e
mov eax, dword [ebp - 0xc]
mov byte [esi + 0x84], 1
test byte [eax + 0xe], 0x80
je 0x45b847
and byte [esi + 0xe], 0xfe
xor eax, eax
cmp dword [ebp - 0x1c], eax
je 0x45b8e8
cmp dword [ebp - 0x10], eax
je 0x45b8e8
cmp byte [ebp - 2], al
mov ecx, edi
je 0x45b8dd
mov edx, dword [edi]
push eax
push 0x271d
mov byte [edi + 0x4d], 0x81
mov byte [edi + 0x4c], 0x10
call dword [edx + 8]
mov eax, dword [edi + 0x18]
push str.0x_I64X
cdq
push str.__WinID
push edx
push eax
push esi
call fcn.004366f8
and dword [edi + 0x118], 0
add esp, 0x14
push dword [ebp + 0x18]
mov ecx, esi
call fcn.00457eff
xor eax, eax
cmp dword [edi + 0x94], eax
jg 0x45b8bd
mov ecx, dword [edi + 0x80]
cmp dword [ecx], eax
jg 0x45b8bd
mov ecx, dword [edi + 0x90]
cmp dword [ecx], eax
jle 0x45b914
push eax
push eax
push 0x10
push dword [edi + 0x18]
mov byte [edi + 0x4d], 0xff
call dword [sym.imp.USER32.dll_PostMessageW]
push 0x20
mov ecx, edi
call fcn.004341f0
mov byte [edi + 0x4d], 0x81
jmp 0x45b914
mov byte [edi + 0x4c], 0
call fcn.00434327
jmp 0x45b914
push dword [ebp + 8]
mov ecx, esi
call fcn.00457eff
mov eax, dword [esi + 0x28]
test eax, eax
je 0x45b914
cmp byte [ebp - 3], 0
jne 0x45b914
push 0
push 0
push 0x10
push dword [eax + 0x18]
call dword [sym.imp.USER32.dll_PostMessageW]
mov eax, dword [esi + 0x28]
mov dword [ebp - 0x28], eax
mov edi, dword [ebp + 0x10]
cmp word [edi], 0
je 0x45b951
test byte [esi + 0xe], 8
jne 0x45b951
push str.LEAVE:
lea ecx, [ebp + 0x10]
call fcn.00434695
push edi
lea ecx, [ebp + 0x10]
call fcn.0042af26
push 0
push 0x11
push 0
push dword [ebp + 0x10]
mov ecx, esi
call fcn.004159f3
lea ecx, [ebp + 0x10]
call fcn.0042602e
cmp dword [ebp + 0x1c], 0
mov eax, dword [esi + 0x80]
mov dword [ebp + 0x10], eax
je 0x45b96c
push dword [ebp - 0x2c]
mov ecx, esi
call fcn.0041c5fe
jmp 0x45b995
push ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [ebp - 0x30]
mov dword [esi + 0x3c], eax
mov eax, dword [ebp - 0x34]
mov dword [esi + 0x40], eax
mov al, byte [ebp - 6]
mov byte [esi + 0xb], al
mov al, byte [ebp - 7]
push ebx
mov byte [esi + 0x86], al
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [ebp - 0x38]
lea ecx, [ebp - 0x3c]
mov dword [esi + 0x28], eax
call fcn.004345a8
mov ecx, dword [ebp - 0x28]
xor edi, edi
cmp ecx, edi
je 0x45b9b3
mov eax, dword [ecx]
push 1
call dword [eax + 0xc]
cmp byte [ebp - 2], 0
mov esi, dword [ebp - 0x14]
jne 0x45b9ea
cmp esi, edi
je 0x45b9ea
push ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
dec dword [esi + 0x94]
cmp byte [esi + 0x4d], 0x81
je 0x45b9e3
push edi
push edi
push 0x43d
push dword [esi + 0x18]
call dword [sym.imp.USER32.dll_PostMessageW]
push ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
call fcn.004295c7
cmp dword [ebp - 0x24], edi
je 0x45ba7b
push ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ecx, dword [ebp - 0xc]
push 0xffffffffffffffff
push edi
push 0x47d3f8
call fcn.0040f7cf
cmp eax, edi
mov edi, dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
je 0x45ba22
push dword [eax]
push str.CurDir
call edi
mov ecx, dword [ebp - 0xc]
push 0xffffffffffffffff
push 0
push str.CurDrv
call fcn.0040f7cf
test eax, eax
je 0x45ba40
push dword [eax]
push 0x482404
call edi
mov ecx, dword [ebp - 0xc]
push 0xffffffffffffffff
push 0
push str.CurFile
call fcn.0040f7cf
test eax, eax
je 0x45ba5e
push dword [eax]
push 0x4823e0
call edi
cmp byte [ebp - 1], 0
jne 0x45ba72
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
call fcn.0040a64b
push ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor edi, edi
cmp byte [ebp - 2], 0
mov ecx, dword [ebp - 0xc]
mov dword [ecx + 0x28], esi
jne 0x45ba8d
push edi
call fcn.004488e0
lea ecx, [ebp - 0x18]
call fcn.0042602e
lea ecx, [ebp - 0x20]
call fcn.0041656f
mov eax, dword [ebp + 0x10]
pop edi
pop esi
pop ebx
leave
ret 0x18