Function at 0x140058190
Capabilities:
Query environment variable

Disassembly:
mov qword [rsp + 8], rbx
push rdi
sub rsp, 0x20
mov r8d, dword [0x140185710]
mov rdi, rcx
mov rdx, qword [0x140185718]
lea rcx, str.LC_ALL
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
mov ebx, eax
test eax, eax
je 0x140058210
cmp rbx, qword [0x140185710]
jbe 0x1400581fb
mov rcx, qword [0x140185718]
mov edx, ebx
call fcn.140061da0
test rax, rax
je 0x140058210
mov r8d, ebx
mov qword [0x140185718], rax
mov rdx, rax
mov qword [0x140185710], rbx
lea rcx, str.LC_ALL
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
mov rcx, qword [0x140185718]
mov rdx, rcx
test rcx, rcx
jne 0x14005836c
jmp 0x140058217
mov rcx, qword [0x140185718]
mov r8d, dword [0x140185710]
mov rdx, rcx
lea rcx, str.LC_CTYPE
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
mov ebx, eax
test eax, eax
je 0x140058286
cmp rbx, qword [0x140185710]
jbe 0x140058271
mov rcx, qword [0x140185718]
mov edx, ebx
call fcn.140061da0
test rax, rax
je 0x140058286
mov r8d, ebx
mov qword [0x140185718], rax
mov rdx, rax
mov qword [0x140185710], rbx
lea rcx, str.LC_CTYPE
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
mov rcx, qword [0x140185718]
mov rdx, rcx
test rcx, rcx
jne 0x14005836c
jmp 0x14005828d
mov rcx, qword [0x140185718]
mov r8d, dword [0x140185710]
mov rdx, rcx
lea rcx, str.LC_MESSAGES
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
mov ebx, eax
test eax, eax
je 0x1400582f8
cmp rbx, qword [0x140185710]
jbe 0x1400582e7
mov rcx, qword [0x140185718]
mov edx, ebx
call fcn.140061da0
test rax, rax
je 0x1400582f8
mov r8d, ebx
mov qword [0x140185718], rax
mov rdx, rax
mov qword [0x140185710], rbx
lea rcx, str.LC_MESSAGES
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
mov rcx, qword [0x140185718]
mov rdx, rcx
test rcx, rcx
jne 0x14005836c
jmp 0x1400582ff
mov rcx, qword [0x140185718]
mov r8d, dword [0x140185710]
mov rdx, rcx
lea rcx, str.LANG
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
mov ebx, eax
test eax, eax
je 0x1400583b1
cmp rbx, qword [0x140185710]
jbe 0x14005835d
mov rcx, qword [0x140185718]
mov edx, ebx
call fcn.140061da0
test rax, rax
je 0x1400583b1
mov r8d, ebx
mov qword [0x140185718], rax
mov rdx, rax
mov qword [0x140185710], rbx
lea rcx, str.LANG
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
mov rcx, qword [0x140185718]
mov rdx, rcx
test rcx, rcx
je 0x1400583b1
movzx r8d, byte [rcx]
test r8b, r8b
je 0x1400583b1
movzx eax, byte [0x14015c894]
lea r9, [0x14015c894]
movzx r10d, r8b
sub r10d, eax
jne 0x1400583b8
sub rcx, r9
nop
test r8b, r8b
je 0x1400583ac
movzx r8d, byte [rcx + r9 + 1]
inc r9
mov r10d, r8d
movzx eax, byte [r9]
sub r10d, eax
je 0x140058390
jmp 0x1400583b8
test r10d, r10d
jne 0x1400583b8
lea rdx, str.ASCII
movzx ecx, byte [rdx]
xor ebx, ebx
mov rax, rdx
test cl, cl
je 0x1400583d4
cmp cl, 0x2e
je 0x1400583d7
movzx ecx, byte [rax + 1]
inc rax
test cl, cl
jne 0x1400583c4
mov rax, rbx
test rax, rax
lea rcx, [rax + 1]
cmove rcx, rdx
mov rax, rcx
cmp byte [rcx], bl
je 0x140058407
nop dword [rax]
lea rax, [rax + 1]
inc rbx
cmp byte [rax], 0
jne 0x1400583f0
cmp rbx, 0x3f
jb 0x140058407
mov ebx, 0x3f
mov rdx, rcx
mov r8, rbx
mov rcx, rdi
call fcn.140039560
mov byte [rbx + rdi], 0
mov rax, rdi
movzx ecx, byte [rdi]
test cl, cl
je 0x140058447
cmp cl, 0x40
je 0x140058441
movzx ecx, byte [rax + 1]
inc rax
test cl, cl
jne 0x140058423
mov rax, rdi
mov rbx, qword [rsp + 0x30]
add rsp, 0x20
pop rdi
ret
mov byte [rax], 0
mov rax, rdi
mov rbx, qword [rsp + 0x30]
add rsp, 0x20
pop rdi
ret