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

Disassembly:
push 0xffffffffffffffff
push 0x4ec7ce
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0xb0
push ebx
push ebp
push esi
push edi
mov esi, ecx
mov dword [esp + 0x1c], esi
mov eax, dword [esp + 0xdc]
movzx ebx, ax
mov ebp, eax
xor ecx, ecx
mov al, bl
and al, 4
mov byte [esp + 0x13], al
mov al, byte [0x51c752]
mov cl, bl
mov byte [esp + 0x12], al
xor edx, edx
mov eax, ebx
shr eax, 1
shl al, 7
mov dl, bl
and ecx, 0x10
mov dword [esp + 0x14], ecx
mov cl, byte [esi + 0xe]
and cl, 0x7f
or al, cl
mov byte [esi + 0xe], al
mov al, bl
and edx, 0x40
and al, 1
shr ebp, 0x10
test bl, bl
mov dword [esp + 0x40], edx
mov byte [esp + 0x1a], al
js 0x49f4c2
mov al, byte [0x51d260]
test al, al
je 0x49f4c2
push esi
mov byte [0x51d260], 0
call fcn.004216e2
add esp, 4
mov eax, dword [esp + 0xd4]
xor ecx, ecx
cmp eax, ecx
mov eax, dword [esp + 0xd0]
jne 0x49f4dd
mov dword [esp + 0xd4], eax
cmp dword [esp + 0xe0], ecx
jne 0x49f4ed
mov dword [esp + 0xe0], eax
mov edi, dword [esi + 0x2c]
xor edx, edx
cmp edi, ecx
setne dl
mov dword [esp + 0x20], edi
mov dword [esp + 0x28], ecx
mov dword [esp + 0x24], edx
mov dword [esp + 0xc8], ecx
push eax
lea ecx, [esp + 0x2c]
call fcn.004867a0
mov edx, dword [esp + 0xd8]
xor eax, eax
test edx, edx
setne al
mov dword [esp + 0x2c], 0
mov dword [esp + 0x3c], eax
test eax, eax
mov byte [esp + 0xc8], 1
je 0x49f566
push 0
mov eax, 0x416
call fcn.00449190
add esp, 4
test eax, eax
mov dword [esp + 0x2c], eax
je 0x49f55a
mov word [eax + 0x414], 0
push eax
push 0x208
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
mov ecx, dword [esp + 0x24]
xor eax, eax
test ecx, ecx
mov dword [esp + 0x34], eax
je 0x49f5cb
mov cl, byte [esp + 0x13]
test cl, cl
jne 0x49f5cb
push 1
call fcn.004a43e0
push 0x8c4
call fcn.004cc845
mov edi, eax
add esp, 8
mov dword [esp + 0x30], edi
test edi, edi
mov byte [esp + 0xc8], 2
je 0x49f5c1
push 0
push 0
push 0
push 0
push 0
push 0x271c
call dword [sym.imp.USER32.dll_GetDesktopWindow]
push eax
mov ecx, edi
call fcn.00459820
jmp 0x49f5c3
xor eax, eax
mov edi, dword [esp + 0x20]
mov dword [esp + 0x34], eax
mov dword [esp + 0x48], eax
test eax, eax
mov byte [esp + 0xc8], 3
je 0x49f5dd
mov edi, eax
mov eax, dword [esp + 0xe4]
test eax, eax
je 0x49f5eb
mov dword [eax + 0x2c], edi
xor ecx, ecx
test eax, eax
mov dword [esp + 0x44], ecx
jne 0x49f62c
push 0x98
call fcn.004cc845
add esp, 4
mov dword [esp + 0x30], eax
test eax, eax
mov byte [esp + 0xc8], 4
je 0x49f61d
push edi
push esi
mov ecx, eax
call fcn.00432f6c
jmp 0x49f61f
xor eax, eax
mov ecx, eax
mov dword [esp + 0x44], ecx
mov dword [esp + 0xe4], eax
mov dword [esp + 0x54], ecx
test eax, eax
mov esi, dword [esp + 0xe4]
mov byte [esp + 0xc8], 5
jne 0x49f647
mov esi, dword [esp + 0x1c]
mov eax, dword [esi + 0x2c]
push 0x51d5ec
mov word [esi + 8], bp
mov dword [esp + 0x34], eax
mov dword [esi + 0x2c], edi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ecx, dword [esi + 0x40]
mov edx, dword [esi + 0x44]
mov al, byte [esi + 0xb]
mov dword [esp + 0x4c], ecx
mov ecx, dword [esi + 4]
mov dword [esp + 0x58], edx
mov dl, byte [esi + 0x8e]
push 0x51d5ec
mov byte [esp + 0x1d], al
mov dword [esp + 0x54], ecx
mov byte [esp + 0x1f], dl
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov edx, dword [esp + 0xd4]
lea eax, [esp + 0x28]
mov dword [esi + 0x40], eax
mov ecx, dword [esp + 0x28]
mov ebp, dword [ecx]
push 1
push edx
mov ecx, esi
mov dword [esi + 0x44], ebp
call fcn.0045b8a0
push ebp
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov dword [esi + 0x4c], eax
mov eax, dword [esp + 0x24]
test eax, eax
je 0x49f6d1
mov eax, dword [esp + 0xe0]
mov dword [edi + 0x144], eax
test bl, 0x10
mov dword [esi + 0x1c], 0
je 0x49f6e1
or byte [esi + 0xb], 1
test bl, 0x20
je 0x49f6ed
or byte [esi + 0x8e], 1
mov eax, dword [esp + 0x3c]
test eax, eax
je 0x49f70a
movzx ecx, word [esp + 0x40]
mov edx, dword [esp + 0xd8]
push ecx
push edx
mov ecx, esi
call fcn.0042829a
mov eax, dword [esp + 0xd8]
test eax, eax
jne 0x49f720
mov dword [esp + 0xd8], 0x4efd50
mov eax, dword [esp + 0x24]
test eax, eax
je 0x49f786
mov eax, dword [esp + 0x34]
test eax, eax
je 0x49f786
mov eax, dword [edi + 0xe0]
mov dword [edi + 0x13c], esi
mov dword [eax], esi
push edi
mov byte [edi + 0x6a], 1
mov byte [edi + 0x69], 0xff
call fcn.00416c03
mov al, byte [esp + 0x16]
add esp, 4
test al, al
jne 0x49f786
mov eax, dword [esp + 0x20]
test eax, eax
je 0x49f786
push 0x51d5ec
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [esp + 0x20]
mov ecx, dword [eax + 0xc0]
inc ecx
push 0x51d5ec
mov dword [eax + 0xc0], ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [esp + 0x1c]
mov al, byte [ecx + 0xd]
test al, al
je 0x49f794
mov byte [esi + 0xd], al
cmp word [esp + 0x14], 0
mov dl, byte [esp + 0x1a]
mov byte [esi + 0xc], dl
jne 0x49f814
push 0x51d5ec
mov dword [esp + 0x18], 0x51d5ec
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ecx, dword [esp + 0x1c]
push 0xffffffffffffffff
push 0
push str.__MAIN__
mov byte [esp + 0xd4], 6
call fcn.00423eea
test eax, eax
jne 0x49f7db
mov eax, 0x4f24d0
jmp 0x49f7f4
mov eax, dword [eax]
push eax
push 0x4fa540
call fcn.00444a10
add esp, 8
test al, al
jne 0x49f801
mov eax, 0x4f24cc
push eax
push 0x4fb898
mov ecx, esi
call fcn.00448be0
push 0x51d5ec
mov byte [esp + 0xcc], 5
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [esp + 0x1c]
mov cl, byte [eax + 0xe]
test cl, cl
jns 0x49f823
and byte [esi + 0xe], 0xfe
mov ecx, dword [esp + 0xd8]
cmp word [ecx], 0
je 0x49f84c
mov al, byte [esi + 0xe]
test al, 8
jne 0x49f84c
mov cl, byte [esi + 0x8c]
test cl, cl
je 0x49f84c
test al, 1
je 0x49f84c
mov eax, 1
jmp 0x49f84e
xor eax, eax
mov ecx, dword [0x51d1dc]
test ecx, ecx
mov dword [esp + 0x14], eax
je 0x49f8b7
test eax, eax
je 0x49f8b7
push str.ENTER:
lea ecx, [esp + 0x3c]
call fcn.004134f5
mov edx, dword [esp + 0xd8]
push edx
lea ecx, [esp + 0x3c]
mov byte [esp + 0xcc], 7
call fcn.00449510
mov ebx, dword [esp + 0x38]
push 0
push 0x11
push 0
push ebx
mov ecx, esi
call fcn.0042a64c
test ebx, ebx
mov byte [esp + 0xc8], 5
je 0x49f8b7
mov eax, dword [0x51d3c8]
add ebx, 0xfffffff8
push ebx
push 0
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov eax, dword [esp + 0x24]
test eax, eax
mov ebx, dword [sym.imp.USER32.dll_PostMessageW]
mov byte [esi + 0x8c], 1
je 0x49f989
mov eax, dword [esp + 0x34]
test eax, eax
je 0x49f989
mov al, byte [esp + 0x12]
test al, al
mov ecx, edi
je 0x49f97e
mov edx, dword [edi]
push 0
push 0x271d
mov byte [edi + 0x69], 0x81
mov byte [edi + 0x68], 0x10
call dword [edx + 8]
mov eax, dword [edi + 0x18]
push eax
lea eax, [esp + 0x60]
push str.0x_X
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0xc
lea ecx, [esp + 0x5c]
push ecx
push str.__WinID
mov ecx, esi
call fcn.00448be0
mov edx, dword [esp + 0xe0]
push edx
mov ecx, esi
mov dword [edi + 0x144], 0
call fcn.00496c70
mov eax, dword [edi + 0xc0]
test eax, eax
jg 0x49f95f
mov eax, dword [edi + 0xac]
cmp dword [eax], 0
jg 0x49f95f
mov ecx, dword [edi + 0xbc]
cmp dword [ecx], 0
jle 0x49f9b3
mov edx, dword [edi + 0x18]
push 0
push 0
push 0x10
push edx
mov byte [edi + 0x69], 0xff
call ebx
push 0x20
mov ecx, edi
call fcn.004a8590
mov byte [edi + 0x69], 0x81
jmp 0x49f9b3
mov byte [edi + 0x68], 0
call fcn.004a8720
jmp 0x49f9b3
push ebp
mov ecx, esi
call fcn.00496c70
mov eax, dword [esi + 0x2c]
test eax, eax
je 0x49f9b3
mov cl, byte [esp + 0x13]
test cl, cl
jne 0x49f9b3
mov eax, dword [eax + 0x18]
push 0
push 0
push 0x10
push eax
call ebx
mov ecx, dword [esi + 0x2c]
mov dword [esp + 0x48], ecx
mov edi, dword [esp + 0xd8]
cmp word [edi], 0
je 0x49fa19
mov eax, dword [esp + 0x14]
test eax, eax
je 0x49fa19
push str.LEAVE:
lea ecx, [esp + 0x18]
call fcn.004134f5
push edi
lea ecx, [esp + 0x18]
mov byte [esp + 0xcc], 8
call fcn.00449510
mov edi, dword [esp + 0x14]
push 0
push 0x11
push 0
push edi
mov ecx, esi
call fcn.0042a64c
test edi, edi
mov byte [esp + 0xc8], 5
je 0x49fa19
mov edx, dword [0x51d3c8]
add edi, 0xfffffff8
push edi
push 0
push edx
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov eax, dword [esi + 0x88]
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0xe4]
test eax, eax
je 0x49fa48
mov ecx, dword [esp + 0x50]
push ecx
mov ecx, esi
call fcn.00432a2c
mov edi, dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ebx, dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x49fa81
mov edi, dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push 0x51d5ec
call edi
mov edx, dword [esp + 0x4c]
mov eax, dword [esp + 0x58]
mov cl, byte [esp + 0x19]
mov ebx, dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov dword [esi + 0x40], edx
mov dl, byte [esp + 0x1b]
push 0x51d5ec
mov dword [esi + 0x44], eax
mov byte [esi + 0xb], cl
mov byte [esi + 0x8e], dl
call ebx
mov eax, dword [esi + 0x2c]
test eax, eax
je 0x49fa8f
mov eax, dword [esp + 0x30]
mov dword [esi + 0x2c], eax
mov esi, dword [esp + 0x44]
test esi, esi
mov byte [esp + 0xc8], 3
je 0x49faaf
mov ecx, esi
call fcn.00416681
push esi
call fcn.004cc875
add esp, 4
mov ecx, dword [esp + 0x48]
test ecx, ecx
mov byte [esp + 0xc8], 1
je 0x49fac6
mov edx, dword [ecx]
push 1
call dword [edx + 0xc]
mov al, byte [esp + 0x12]
test al, al
mov ebp, dword [esp + 0x20]
jne 0x49fb0c
test ebp, ebp
je 0x49fb0c
push 0x51d5ec
call edi
mov edx, dword [ebp + 0xc0]
mov cl, byte [ebp + 0x69]
mov eax, dword [ebp + 0x18]
dec edx
cmp cl, 0x81
mov dword [ebp + 0xc0], edx
je 0x49fb05
push 0
push 0
push 0x43d
push eax
call dword [sym.imp.USER32.dll_PostMessageW]
push 0x51d5ec
call ebx
call fcn.00447fd0
mov eax, dword [esp + 0x3c]
test eax, eax
je 0x49fbc5
cmp word [esp + 0x40], 0
jne 0x49fbc5
push 0x51d5ec
mov dword [esp + 0x58], 0x51d5ec
call edi
mov edi, dword [esp + 0x1c]
push 0xffffffffffffffff
push 0
push 0x4f5d64
mov ecx, edi
mov byte [esp + 0xd4], 9
call fcn.00423eea
test eax, eax
mov esi, dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
je 0x49fb68
mov eax, dword [eax]
push eax
push str.CurDir
call esi
push 0xffffffffffffffff
push 0
push str.CurDrv
mov ecx, edi
call fcn.00423eea
test eax, eax
je 0x49fb86
mov eax, dword [eax]
push eax
push 0x4fb858
call esi
push 0xffffffffffffffff
push 0
push str.CurFile
mov ecx, edi
call fcn.00423eea
test eax, eax
je 0x49fba4
mov eax, dword [eax]
push eax
push 0x4fb834
call esi
mov esi, dword [esp + 0x2c]
push esi
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
call fcn.0041f8a9
push 0x51d5ec
mov byte [esp + 0xcc], 1
call ebx
jmp 0x49fbcd
mov esi, dword [esp + 0x2c]
mov edi, dword [esp + 0x1c]
mov eax, dword [edi + 0x2c]
test eax, eax
je 0x49fbd7
mov dword [edi + 0x2c], ebp
mov al, byte [esp + 0x12]
test al, al
jne 0x49fbe8
push 0
mov ecx, edi
call fcn.004631f0
test esi, esi
je 0x49fbfe
mov eax, dword [0x51d3c8]
add esi, 0xfffffff8
push esi
push 0
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
lea ecx, [esp + 0x28]
mov dword [esp + 0xc8], 0xffffffff
call fcn.0042b4ef
mov ecx, dword [esp + 0xc0]
mov eax, dword [esp + 0x14]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0xbc
ret 0x18