Function at 0x401795
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x98
mov ecx, dword [ebp + 8]
and dword [ebp - 8], 0
and dword [ebp - 0xc], 0
push ebx
push esi
push edi
test ecx, ecx
je 0x4019e6
mov al, byte [ecx]
test al, al
je 0x4019e6
cmp al, 0x5c
je 0x4019c5
cmp al, 0x2f
je 0x4019c5
mov esi, dword [sym.imp.MSVCRT.dll_getenv]
push str.I4_LANG
call esi
test eax, eax
pop ecx
mov dword [ebp - 4], eax
je 0x4017e8
cmp byte [eax], 0
jne 0x401803
push str.LANG
call esi
test eax, eax
pop ecx
mov dword [ebp - 4], eax
je 0x4017fc
cmp byte [eax], 0
jne 0x401803
mov dword [ebp - 4], 0x408ab8
push str.NLSPATH
call esi
mov ebx, eax
pop ecx
test ebx, ebx
jne 0x401829
push str.I4_INSTALL_DRIVE
mov ebx, str.C:IFORLSMSG_L_N
call esi
test eax, eax
pop ecx
je 0x401829
mov al, byte [eax]
mov byte [str.C:IFORLSMSG_L_N], al
mov eax, dword [0x40ae38]
test eax, eax
je 0x401899
push eax
call sub.MSVCRT.dll_strlen
push ebx
mov esi, eax
call sub.MSVCRT.dll_strlen
lea eax, [esi + eax + 3]
push eax
call dword [sym.imp.MSVCRT.dll_malloc]
mov esi, eax
add esp, 0xc
test esi, esi
mov dword [ebp - 0xc], esi
je 0x4019f2
push ebx
push esi
call sub.MSVCRT.dll_strcpy
push esi
call sub.MSVCRT.dll_strlen
add esp, 0xc
cmp byte [eax + esi - 1], 0x3b
je 0x401889
mov eax, dword [0x40ae38]
cmp byte [eax], 0x3b
je 0x401889
push 0x408a80
push esi
call sub.MSVCRT.dll_strcat
pop ecx
pop ecx
push dword [0x40ae38]
push esi
call sub.MSVCRT.dll_strcat
pop ecx
mov ebx, esi
pop ecx
push ebx
call sub.MSVCRT.dll_strlen
mov edi, eax
lea eax, [edi + 2]
push eax
call dword [sym.imp.MSVCRT.dll_malloc]
mov esi, eax
pop ecx
test esi, esi
pop ecx
mov dword [ebp - 0x10], esi
je 0x4019f2
push ebx
push esi
call sub.MSVCRT.dll_strcpy
lea eax, [esi + edi]
pop ecx
pop ecx
mov ebx, esi
and byte [eax + 1], 0
mov byte [eax], 0x3b
jmp 0x40196d
cmp al, 0x3b
jne 0x40196c
and byte [esi], 0
lea edi, [ebp - 0x98]
jmp 0x40192d
cmp al, 0x25
jne 0x401929
lea eax, [ebx + 1]
mov cl, byte [eax]
cmp cl, 0x4c
jne 0x401905
push dword [ebp - 4]
mov ebx, eax
push edi
call sub.MSVCRT.dll_strcpy
push dword [ebp - 4]
jmp 0x401918
cmp cl, 0x4e
jne 0x401924
push dword [ebp + 8]
mov ebx, eax
push edi
call sub.MSVCRT.dll_strcpy
push dword [ebp + 8]
call sub.MSVCRT.dll_strlen
add esp, 0xc
add edi, eax
jmp 0x40192c
mov byte [edi], 0x25
jmp 0x40192b
mov byte [edi], al
inc edi
inc ebx
mov al, byte [ebx]
test al, al
jne 0x4018e7
and byte [edi], al
lea eax, [ebp - 0x34]
push eax
lea eax, [ebp - 0x98]
push eax
call dword [sym.imp.MSVCRT.dll__stat]
pop ecx
test eax, eax
pop ecx
jne 0x401969
push dword [ebp + 0xc]
lea eax, [ebp - 0x98]
push eax
call fcn.00401b5e
pop ecx
mov dword [ebp - 8], eax
test eax, eax
pop ecx
je 0x401969
cmp eax, 0xffffffff
jne 0x401977
lea ebx, [esi + 1]
inc esi
mov al, byte [esi]
test al, al
jne 0x4018d4
push dword [ebp - 0x10]
mov esi, dword [sym.imp.MSVCRT.dll_free]
call esi
xor edi, edi
pop ecx
cmp dword [ebp - 0xc], edi
je 0x401990
push dword [ebp - 0xc]
call esi
pop ecx
cmp dword [ebp - 8], edi
mov dword [ebp - 0xc], edi
je 0x40199e
cmp dword [ebp - 8], 0xffffffff
jne 0x4019c0
mov esi, 0x408ab8
push esi
push dword [ebp - 4]
call sub.MSVCRT.dll_strcmp
pop ecx
test eax, eax
pop ecx
je 0x4019c0
mov dword [ebp - 4], esi
mov esi, dword [sym.imp.MSVCRT.dll_getenv]
jmp 0x401803
mov eax, dword [ebp - 8]
jmp 0x4019f5
lea eax, [ebp - 0x34]
lea esi, [ecx + 1]
push eax
push esi
call dword [sym.imp.MSVCRT.dll__stat]
pop ecx
test eax, eax
pop ecx
jne 0x4019f2
push dword [ebp + 0xc]
push esi
call fcn.00401b5e
pop ecx
pop ecx
jmp 0x4019f5
call dword [sym.imp.MSVCRT.dll__errno]
mov dword [eax], 0x16
or eax, 0xffffffff
pop edi
pop esi
pop ebx
leave
ret