Function at 0x401c49
Capabilities:
Query environment variable

Disassembly:
sub esp, 0x210
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x22c]
mov ebp, 0x104
push ebp
push edi
and word [edi], 0
push 0x401fa0
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov esi, eax
test esi, esi
jne 0x401d8e
push 0x401f8c
push dword [esp + 0x228]
call fcn.00401bf3
mov ebx, dword [sym.imp.KERNEL32.dll_lstrlenW]
pop ecx
test eax, eax
pop ecx
mov dword [esp + 0x10], eax
je 0x401c9e
push eax
jmp 0x401cc8
push 0x401f74
push dword [esp + 0x228]
call fcn.00401bf3
pop ecx
mov dword [esp + 0x14], eax
test eax, eax
pop ecx
je 0x401cec
push eax
call fcn.00401fc8
test al, al
pop ecx
jne 0x401cec
push dword [esp + 0x10]
call ebx
mov esi, eax
lea eax, [esi + 1]
cmp eax, ebp
jle 0x401cd8
mov esi, 0x103
lea eax, [esi + 1]
push eax
push dword [esp + 0x14]
push edi
call dword [sym.imp.KERNEL32.dll_lstrcpynW]
and word [edi + esi*2], 0
cmp word [edi], 0
jne 0x401d99
push 0x401f5a
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
push 0x401f49
push eax
mov dword [esp + 0x1c], eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
xor ecx, ecx
mov dword [esp + 0x10], eax
cmp eax, ecx
je 0x401d82
push edi
push ecx
push ecx
push 0x1c
push ecx
call eax
test eax, eax
push edi
jge 0x401d64
xor esi, esi
push esi
push esi
push 0x1c
push esi
call dword [esp + 0x24]
test eax, eax
jge 0x401d49
push esi
push esi
push esi
push 0x401f3c
push 3
call fcn.00401057
add esp, 0x14
push edi
call ebx
mov ecx, 0x103
sub ecx, eax
lea eax, [edi + eax*2]
push ecx
push 0x401efa
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpynW]
push edi
call ebx
mov ecx, 0x103
sub ecx, eax
lea eax, [edi + eax*2]
push ecx
push 0x401ed8
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpynW]
push edi
call ebx
mov esi, eax
push dword [esp + 0x14]
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
jmp 0x401d99
mov ebx, dword [sym.imp.KERNEL32.dll_lstrlenW]
push edi
call ebx
mov esi, eax
lea eax, [esi + 1]
cmp eax, ebp
mov dword [esp + 0x14], eax
jge 0x401dc8
mov cx, word [edi + esi*2 - 2]
lea eax, [edi + esi*2]
cmp cx, 0x5c
je 0x401dc8
cmp cx, 0x2f
je 0x401dc8
push 0x401ed4
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
mov esi, dword [esp + 0x14]
push 0x401ebc
push dword [esp + 0x228]
call fcn.00401bf3
pop ecx
mov dword [esp + 0x14], eax
test eax, eax
pop ecx
je 0x401e03
push eax
call ebx
add eax, esi
mov dword [esp + 0x14], eax
inc eax
cmp eax, ebp
jge 0x401e03
push dword [esp + 0x10]
lea eax, [edi + esi*2]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
mov esi, dword [esp + 0x14]
lea eax, [esi + 1]
cmp eax, ebp
jge 0x401e2a
mov ax, word [edi + esi*2 - 2]
lea esi, [edi + esi*2]
cmp ax, 0x5c
je 0x401e2a
cmp ax, 0x2f
je 0x401e2a
push 0x401ed4
push esi
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
push edi
call fcn.00401fc8
test al, al
pop ecx
je 0x401e43
lea eax, [esp + 0x18]
push edi
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
jmp 0x401ea0
mov esi, dword [esp + 0x228]
push esi
call ebx
lea eax, [esi + eax*2]
cmp esi, eax
jae 0x401e6b
mov dx, word [eax - 2]
lea ecx, [eax - 2]
cmp dx, 0x5c
je 0x401e6b
cmp dx, 0x2f
je 0x401e6b
mov eax, ecx
jmp 0x401e50
sub eax, esi
sar eax, 1
inc eax
cmp eax, ebp
jl 0x401e76
mov eax, ebp
push eax
lea eax, [esp + 0x1c]
push esi
mov esi, dword [sym.imp.KERNEL32.dll_lstrcpynW]
push eax
call esi
lea eax, [esp + 0x18]
push eax
call ebx
mov ecx, ebp
sub ecx, eax
lea eax, [esp + 0x18]
push ecx
push edi
push eax
call ebx
lea eax, [esp + eax*2 + 0x20]
push eax
call esi
push 0
push edi
lea eax, [esp + 0x20]
push ebp
push eax
call dword [sym.imp.KERNEL32.dll_GetFullPathNameW]
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x210
ret