Function at 0x491f60
Capabilities:
Get common file path
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4f6b2b
mov eax, dword fs:[0]
push eax
mov eax, 0x129c
call fcn.004c39f0
mov eax, dword [0x535a40]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 0x14]
mov ebx, dword [ebp + 0xc]
mov esi, dword [ebp + 0x10]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 0x1248], eax
mov eax, dword [ebp + 0x18]
mov dword [ebp - 0x1258], eax
mov eax, dword [ebp + 0x1c]
mov dword [ebp - 0x1280], eax
mov eax, dword [ebp + 0x20]
mov dword [ebp - 0x1260], eax
mov eax, dword [ebp + 0x24]
mov dword [ebp - 0x1240], ebx
mov dword [ebp - 0x1238], esi
mov dword [ebp - 0x1254], eax
test ebx, ebx
jne 0x492099
mov eax, dword [esi + 0x28]
mov dword [ebp - 0x1288], eax
lea eax, [ebp - 0x128c]
push eax
lea eax, [ebp - 0x12a4]
mov dword [ebp - 0x1250], 0
push eax
push 0x40
lea eax, [ebp - 0x125c]
mov dword [ebp - 0x128c], 0
push eax
mov dword [ebp - 0x12a4], 0x18
mov dword [ebp - 0x12a0], 0
mov dword [ebp - 0x1298], 0
mov dword [ebp - 0x129c], 0
mov dword [ebp - 0x1294], 0
mov dword [ebp - 0x1290], 0
call sub.ntdll.dll_NtOpenThread
test eax, eax
jne 0x492084
mov esi, dword [ebp - 0x125c]
test esi, esi
je 0x49207e
lea eax, [ebp - 0x12a8]
push eax
push 4
lea eax, [ebp - 0x1250]
push eax
push 9
push esi
call dword [sym.imp.ntdll.dll_NtQueryInformationThread]
push esi
call edi
mov esi, dword [ebp - 0x1238]
mov ebx, dword [ebp - 0x1250]
test ebx, ebx
cmove ebx, dword [ebp - 0x1258]
mov dword [ebp - 0x1240], ebx
push 0x5503a0
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push 0x104
lea eax, [ebp - 0x630]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
lea edx, [esi + 0x30]
mov dword [ebp - 0x123c], edx
nop
mov esi, dword [ebp - 0x1260]
or eax, 0xffffffff
xor ecx, ecx
mov dword [ebp - 0x1234], eax
mov word [edx], cx
test esi, esi
je 0x49226d
or ecx, 0xffffffff
xor edi, edi
mov dword [ebp - 0x1244], ecx
mov ecx, dword [esi + 0x30]
mov dword [ebp - 0x124c], ecx
cmp dword [ecx], edi
jbe 0x49226d
lea esi, [ecx + 0x10]
nop dword [eax + eax]
mov ecx, dword [esi - 4]
cmp ebx, ecx
jbe 0x492143
mov eax, dword [esi]
add eax, ecx
cmp ebx, eax
jae 0x49213d
movzx eax, word [esi + 0xe]
add eax, 0x10
mov dword [ebp - 0x1244], ecx
add eax, esi
push eax
push 0x50c900
push edx
call fcn.0042fa30
mov edx, dword [ebp - 0x123c]
mov eax, edi
add esp, 0xc
mov dword [ebp - 0x1234], eax
jmp 0x492143
mov eax, dword [ebp - 0x1234]
mov ecx, dword [ebp - 0x124c]
inc edi
add esi, 0x11c
cmp edi, dword [ecx]
jb 0x492100
cmp eax, 0xffffffff
je 0x49226d
cmp byte [ebp + 8], 0
je 0x4924ef
imul edi, eax, 0x11c
add edi, ecx
lea ecx, [ebp - 0x1264]
mov dword [ebp - 0x124c], edi
lea ebx, [edi + 0x20]
push ebx
call fcn.004665b0
push dword [eax]
call fcn.004c8d00
mov ecx, dword [ebp - 0x1238]
add esp, 4
mov dword [ecx + 0x238], eax
lea ecx, [ebp - 0x1264]
call fcn.0042cfb0
cmp dword [0x555158], 0
je 0x4924ef
mov esi, dword [0x555184]
lea ecx, [ebp - 0x1268]
push ebx
call fcn.004665b0
lea ecx, [ebp - 0x21c]
mov dword [ebp - 4], 0
push ecx
push 0
push dword [eax]
call esi
lea ecx, [ebp - 0x1268]
mov dword [ebp - 0x1234], eax
mov dword [ebp - 4], 0xffffffff
call fcn.0042cfb0
mov eax, dword [edi + 0xc]
lea ecx, [ebp - 0x126c]
mov ebx, dword [0x555158]
cdq
mov edi, eax
mov esi, edx
mov eax, dword [ebp - 0x124c]
add eax, 0x20
push eax
call fcn.004665b0
push 0
push esi
mov esi, dword [ebp - 0x1234]
push edi
push 0
push dword [eax]
mov dword [ebp - 4], 1
push esi
push dword [ebp - 0x1248]
call ebx
lea ecx, [ebp - 0x126c]
mov dword [ebp - 4], 0xffffffff
call fcn.0042cfb0
test esi, esi
je 0x4924ef
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
call edi
mov dword [ebp - 0xa30], 0x58
mov dword [ebp - 0x9e0], 0x1d5
jmp 0x49250d
mov ecx, dword [ebp - 0x1254]
xor edi, edi
mov dword [ebp - 0x1244], 0xffffffff
cmp dword [ecx], edi
jbe 0x4924ef
lea esi, [ecx + 0x20]
nop word [eax + eax]
mov ecx, dword [esi - 0x14]
cmp ebx, ecx
jbe 0x4922da
mov eax, dword [esi - 0x10]
add eax, ecx
cmp ebx, eax
jae 0x4922d4
push 0x5c
push esi
mov dword [ebp - 0x1244], ecx
call fcn.004c5d30
test eax, eax
lea ecx, [eax + 1]
cmove ecx, esi
push ecx
push 0x50c900
push dword [ebp - 0x123c]
call fcn.0042fa30
mov eax, edi
add esp, 0x14
mov dword [ebp - 0x1234], eax
jmp 0x4922da
mov eax, dword [ebp - 0x1234]
mov ecx, dword [ebp - 0x1254]
inc edi
add esi, 0x11c
cmp edi, dword [ecx]
jb 0x492290
cmp eax, 0xffffffff
je 0x4924ef
imul ebx, eax, 0x11c
xor edi, edi
add ebx, ecx
lea ecx, [ebp - 0x1270]
mov dword [ebp - 0x1234], ebx
lea eax, [ebx + 0x20]
push eax
call fcn.0048d9e0
push 0xc
push str.SystemRoot_
push dword [eax]
call fcn.004c95b0
add esp, 0xc
lea ecx, [ebp - 0x1270]
mov esi, eax
call fcn.0042cfb0
test esi, esi
jne 0x492383
lea eax, [ebx + 0x2c]
push eax
lea ecx, [ebp - 0x1274]
call fcn.0048d9e0
push dword [eax]
lea eax, [ebp - 0x428]
push str.__SystemRoot___s
push eax
call fcn.0048d6f0
add esp, 0xc
lea ecx, [ebp - 0x1274]
call fcn.0042cfb0
push 0x105
lea eax, [ebp - 0x21c]
push eax
lea eax, [ebp - 0x428]
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
jmp 0x49249e
cmp byte [ebx + 0x21], 0x3a
jne 0x4923be
lea eax, [ebx + 0x20]
push eax
lea ecx, [ebp - 0x1278]
call fcn.004665b0
push dword [eax]
lea eax, [ebp - 0x21c]
push 0x105
push eax
call fcn.004c913a
add esp, 0xc
lea ecx, [ebp - 0x1278]
call fcn.0042cfb0
jmp 0x49249e
cmp byte [ebx + 0x25], 0x3a
jne 0x4923f9
lea eax, [ebx + 0x24]
push eax
lea ecx, [ebp - 0x127c]
call fcn.004665b0
push dword [eax]
lea eax, [ebp - 0x21c]
push 0x105
push eax
call fcn.004c913a
add esp, 0xc
lea ecx, [ebp - 0x127c]
call fcn.0042cfb0
jmp 0x49249e
mov ebx, dword [ebp - 0x123c]
lea eax, [ebp - 0x630]
push ebx
push eax
lea eax, [ebp - 0x21c]
push str._sdrivers_s
push eax
call fcn.0048d6f0
mov eax, dword [0x555184]
lea ecx, [ebp - 0x428]
add esp, 0x10
push ecx
lea ecx, [ebp - 0x630]
push ecx
lea ecx, [ebp - 0x21c]
push ecx
call eax
mov edi, eax
test edi, edi
je 0x49245e
lea eax, [ebp - 0x21c]
push eax
lea eax, [ebp - 0x428]
push eax
call fcn.004c9460
add esp, 8
test eax, eax
je 0x492498
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
lea eax, [ebp - 0x630]
push eax
lea eax, [ebp - 0x428]
push str._sdrivers_s
push eax
call fcn.0048d6f0
mov eax, dword [0x555184]
lea ecx, [ebp - 0x21c]
add esp, 0x10
push ecx
lea ecx, [ebp - 0x630]
push ecx
lea ecx, [ebp - 0x428]
push ecx
call eax
mov edi, eax
mov ebx, dword [ebp - 0x1234]
lea eax, [ebp - 0x21c]
push eax
call fcn.004c8d00
mov ecx, dword [ebp - 0x1238]
add esp, 4
mov dword [ecx + 0x238], eax
mov ecx, dword [0x555158]
test ecx, ecx
je 0x4924e4
cmp byte [ebp + 8], 0
je 0x4924e4
push dword [ebx + 0x10]
mov eax, dword [ebx + 0xc]
cdq
push edx
push eax
push 0
lea eax, [ebp - 0x21c]
push eax
push edi
push dword [ebp - 0x1248]
call ecx
test edi, edi
je 0x4924ef
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp byte [ebp + 8], 0
mov dword [ebp - 0xa30], 0x58
mov dword [ebp - 0x9e0], 0x1d5
je 0x4925c5
mov ecx, dword [0x555148]
mov esi, dword [ebp - 0x1240]
test ecx, ecx
je 0x4925cb
lea eax, [ebp - 0xa30]
push eax
lea eax, [ebp - 0x1284]
push eax
mov eax, esi
cdq
push edx
push eax
push dword [ebp - 0x1248]
call ecx
test eax, eax
je 0x4925cb
mov ecx, dword [ebp - 0x123c]
mov edx, ecx
mov eax, dword [ebp - 0x9e4]
lea esi, [edx + 2]
mov byte [ebp + eax*2 - 0x9dc], 0
nop dword [eax]
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x492560
sub edx, esi
lea esi, [ecx + 2]
sar edx, 1
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x492572
mov edi, dword [ebp - 0x1280]
sub ecx, esi
mov esi, dword [ebp - 0x1284]
mov eax, esi
sar ecx, 1
or eax, edi
lea eax, [ebp - 0x9dc]
je 0x4925ee
push edi
push esi
push eax
push str.__s0x_I64x
mov eax, 0x104
sub eax, edx
push 0xffffffffffffffff
push eax
mov eax, dword [ebp - 0x1238]
lea eax, [eax + ecx*2]
add eax, 0x30
push eax
call fcn.004b2fb0
add esp, 0x1c
jmp 0x492652
mov esi, dword [ebp - 0x1240]
mov edx, dword [ebp - 0x123c]
cmp word [edx], 0
jne 0x49261d
mov eax, dword [ebp - 0x1258]
cmp esi, eax
je 0x492615
mov ebx, eax
mov dword [ebp - 0x1240], ebx
jmp 0x4920c0
push eax
push 0x511210
mov eax, 0x104
sub eax, edx
push 0xffffffffffffffff
push eax
mov eax, dword [ebp - 0x1238]
lea eax, [eax + ecx*2]
add eax, 0x30
push eax
call fcn.004b2fb0
add esp, 0x14
jmp 0x492652
push esi
push str.0x_p
jmp 0x492629
sub esi, dword [ebp - 0x1244]
push esi
push str.0x_x
lea eax, [ebp - 0x1230]
push eax
call fcn.0044be00
add esp, 0xc
lea eax, [ebp - 0x1230]
push eax
push 0x104
push dword [ebp - 0x123c]
call fcn.004d6355
add esp, 0xc
push 0x5503a0
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004c34b7
mov esp, ebp
pop ebp
ret