Function at 0x401c44
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 0x401f9b
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov esi, eax
test esi, esi
jne 0x401d89
push 0x401f87
push dword [esp + 0x228]
call fcn.00401bee
mov ebx, dword [sym.imp.KERNEL32.dll_lstrlenW]
pop ecx
test eax, eax
pop ecx
mov dword [esp + 0x10], eax
je 0x401c99
push eax
jmp 0x401cc3
push 0x401f6f
push dword [esp + 0x228]
call fcn.00401bee
pop ecx
mov dword [esp + 0x14], eax
test eax, eax
pop ecx
je 0x401ce7
push eax
call fcn.00401fc3
test al, al
pop ecx
jne 0x401ce7
push dword [esp + 0x10]
call ebx
mov esi, eax
lea eax, [esi + 1]
cmp eax, ebp
jle 0x401cd3
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 0x401d94
push 0x401f55
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
push 0x401f44
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 0x401d7d
push edi
push ecx
push ecx
push 0x1c
push ecx
call eax
test eax, eax
push edi
jge 0x401d5f
xor esi, esi
push esi
push esi
push 0x1c
push esi
call dword [esp + 0x24]
test eax, eax
jge 0x401d44
push esi
push esi
push esi
push 0x401f37
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 0x401ef5
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 0x401ed3
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 0x401d94
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 0x401dc3
mov cx, word [edi + esi*2 - 2]
lea eax, [edi + esi*2]
cmp cx, 0x5c
je 0x401dc3
cmp cx, 0x2f
je 0x401dc3
push 0x401ecf
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
mov esi, dword [esp + 0x14]
push 0x401eb7
push dword [esp + 0x228]
call fcn.00401bee
pop ecx
mov dword [esp + 0x14], eax
test eax, eax
pop ecx
je 0x401dfe
push eax
call ebx
add eax, esi
mov dword [esp + 0x14], eax
inc eax
cmp eax, ebp
jge 0x401dfe
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 0x401e25
mov ax, word [edi + esi*2 - 2]
lea esi, [edi + esi*2]
cmp ax, 0x5c
je 0x401e25
cmp ax, 0x2f
je 0x401e25
push 0x401ecf
push esi
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
push edi
call fcn.00401fc3
test al, al
pop ecx
je 0x401e3e
lea eax, [esp + 0x18]
push edi
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
jmp 0x401e9b
mov esi, dword [esp + 0x228]
push esi
call ebx
lea eax, [esi + eax*2]
cmp esi, eax
jae 0x401e66
mov dx, word [eax - 2]
lea ecx, [eax - 2]
cmp dx, 0x5c
je 0x401e66
cmp dx, 0x2f
je 0x401e66
mov eax, ecx
jmp 0x401e4b
sub eax, esi
sar eax, 1
inc eax
cmp eax, ebp
jl 0x401e71
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