Function at 0x1004e8ba
Capabilities:
Query environment variable

Disassembly:
push ebp
lea ebp, [esp - 0x6c]
sub esp, 0x88
push ebx
push esi
push edi
mov esi, ecx
push 0x100e3d7c
mov dword [ebp + 0x64], esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [ebp + 0x7c], 0
mov bl, byte [esi + 9]
setl byte [ebp + 0x6b]
and bl, 0x11
cmp byte [ebp + 0x6b], 0
jne 0x1004e8f2
test byte [ebp + 0x7c], 0x40
je 0x1004e8f4
xor bl, bl
mov esi, dword [ebp + 0x74]
cmp word [esi], 0x26
mov dword [ebp + 0x74], esi
mov edi, esi
jne 0x1004e90a
inc edi
inc edi
cmp word [edi], 0x26
je 0x1004e902
push 0x100cf63c
push edi
call dword [sym.imp.KERNEL32.dll_lstrcmpiW]
test eax, eax
jne 0x1004e927
call fcn.1004217a
and edx, 0x7fffffff
jmp 0x1004e941
push str.__THIS
push edi
call dword [sym.imp.KERNEL32.dll_lstrcmpiW]
test eax, eax
jne 0x1004e9a4
mov eax, dword [ebp + 0x64]
add eax, 0x75bd036
xor edx, edx
and word [ebp - 0x1c], 0
push edx
push eax
lea eax, [ebp - 0x1c]
push eax
call fcn.100a0e5d
and word [ebp + 0x5e], 0
add esp, 0xc
lea eax, [ebp - 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov edi, eax
cmp edi, 1
jge 0x1004e96c
xor edi, edi
mov esi, dword [ebp + 0x78]
lea eax, [edi + 2]
push eax
mov ecx, esi
call fcn.10046168
dec edi
mov esi, dword [esi]
mov edx, esi
mov dword [ebp + 0x78], edx
js 0x1004eada
lea eax, [ebp - 0x1c]
sub eax, esi
lea ecx, [edi + 1]
mov di, word [eax + edx]
mov word [edx], di
inc edx
inc edx
dec ecx
jne 0x1004e990
mov dword [ebp + 0x78], edx
jmp 0x1004eada
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
cmp byte [ebp + 0x6b], 0
mov edi, dword [ebp + 0x78]
movsx eax, bl
mov byte [ebp + 0x7f], 0
mov dword [ebp + 0x60], eax
jne 0x1004e9d0
cmp word [esi], 0x26
je 0x1004ea82
test bl, bl
jne 0x1004ea5b
push 0x52
mov ecx, edi
call fcn.10046168
mov esi, dword [edi]
and word [esi], 0
push 0
mov dword [ebp + 0x78], esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [edi]
push 0x50
push eax
push dword [ebp + 0x74]
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov ebx, eax
test ebx, ebx
jle 0x1004ea3a
cmp word [esi], 0
jne 0x1004ea32
lea eax, [ebx + 0xc]
push eax
mov ecx, edi
call fcn.10046168
mov esi, dword [edi]
and word [esi], 0
push 0
mov dword [ebp + 0x78], esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [edi]
add ebx, 0xa
push ebx
push eax
push dword [ebp + 0x74]
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov ebx, eax
test ebx, ebx
jg 0x1004ead4
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xcb
jne 0x1004ead0
cmp byte [ebp + 0x7f], 0
jne 0x1004eace
cmp byte [ebp + 0x6b], 0
mov byte [ebp + 0x7f], 1
jne 0x1004eace
mov ecx, dword [ebp + 0x64]
push 0xffffffffffffffff
xor ebx, ebx
push ebx
push dword [ebp + 0x74]
call fcn.100152b4
cmp eax, ebx
jne 0x1004ea91
cmp dword [ebp + 0x60], ebx
jne 0x1004ea9f
cmp byte [ebp + 0x7f], bl
jne 0x1004ea9f
mov byte [ebp + 0x7f], 1
jmp 0x1004e9d0
add esi, 2
mov dword [ebp + 0x74], esi
mov dword [ebp + 0x60], 1
jmp 0x1004ea5b
mov eax, dword [eax]
push eax
mov dword [ebp + 0x74], eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov ebx, eax
lea eax, [ebx + 2]
push eax
mov ecx, edi
call fcn.10046168
dec ebx
mov esi, dword [edi]
mov dword [ebp + 0x78], esi
js 0x1004eada
lea eax, [ebx + 1]
mov ecx, dword [ebp + 0x74]
mov edx, dword [ebp + 0x78]
mov cx, word [ecx]
add dword [ebp + 0x78], 2
add dword [ebp + 0x74], 2
dec eax
mov word [edx], cx
jne 0x1004eab5
jmp 0x1004eada
xor ebx, ebx
test ebx, ebx
jle 0x1004eada
lea eax, [esi + ebx*2]
mov dword [ebp + 0x78], eax
mov eax, dword [ebp + 0x78]
and word [eax], 0
mov eax, 0x100e3d7c
test eax, eax
je 0x1004eaf1
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop edi
mov eax, esi
pop esi
pop ebx
add ebp, 0x6c
leave
ret 0xc