Function at 0x6b583a30
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff0
sub esp, 0x20
mov esi, esp
mov ebx, dword [ebp + 8]
push 0
push 0
push 0x6b773de2
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
test eax, eax
je 0x6b583ad8
call dword [sym.imp.KERNEL32.dll_GetACP]
mov edi, eax
add eax, 0xffff3bd4
cmp eax, 0xa
jae 0x6b583a76
xor edx, edx
mov ecx, 0x2a7
bt ecx, eax
jb 0x6b583a95
lea eax, [edi - 0xdeaa]
cmp eax, 0xa
jb 0x6b583a93
cmp edi, 0xfde8
je 0x6b583a93
mov edx, 8
cmp edi, 0x2a
jne 0x6b583a95
xor edx, edx
push 0
push 0
push 0xffffffffffffffff
push ebx
mov dword [esi + 8], edx
push edx
push edi
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
xor ecx, ecx
test eax, eax
jle 0x6b583ca3
mov ebx, eax
lea eax, [eax + eax + 8]
cmp eax, 0x400
ja 0x6b583af2
add eax, 3
and eax, 0xfffffffc
call fcn.6b714eb0
mov eax, esp
and eax, 0xfffffff0
mov esp, eax
mov dword [eax], 0xcccc
jmp 0x6b583b0b
call fcn.6b58f000
xor ecx, ecx
test eax, eax
jne 0x6b583ca3
push ebx
call sub.msvcrt.dll_getenv
jmp 0x6b583ca5
push eax
call sub.msvcrt.dll_malloc
xor ecx, ecx
add esp, 4
test eax, eax
je 0x6b583ca3
mov dword [eax], 0xdddd
mov ecx, dword [esi + 8]
mov dword [esi + 8], eax
add eax, 8
push ebx
mov ebx, eax
push eax
push 0xffffffffffffffff
push dword [ebp + 8]
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov dl, 1
xor ecx, ecx
test eax, eax
jle 0x6b583b66
push 0
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
test eax, eax
je 0x6b583b7c
mov edi, eax
mov dword [esi + 0xc], ebx
lea eax, [eax + eax + 8]
cmp eax, 0x400
ja 0x6b583b96
add eax, 3
and eax, 0xfffffffc
call fcn.6b714eb0
mov ebx, esp
and ebx, 0xfffffff0
mov esp, ebx
mov dword [ebx], 0xcccc
jmp 0x6b583bbb
xor ebx, ebx
mov eax, dword [esi + 8]
cmp dword [eax], 0xdddd
je 0x6b583c4c
jmp 0x6b583c86
xor ebx, ebx
xor ecx, ecx
mov dl, 1
mov eax, dword [esi + 8]
cmp dword [eax], 0xdddd
je 0x6b583c4c
jmp 0x6b583c86
push eax
call sub.msvcrt.dll_malloc
add esp, 4
test eax, eax
mov ebx, 0
mov ecx, 0
mov dl, 1
je 0x6b583c41
mov dword [eax], 0xdddd
mov ebx, eax
add ebx, 8
push edi
push ebx
push dword [esi + 0xc]
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
xor ecx, ecx
cmp eax, edi
jae 0x6b583c2e
push 0
push 0
push 0
push 0
push 0xffffffffffffffff
push ebx
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
test eax, eax
jle 0x6b583c3d
mov edi, eax
push 0
push 0x6b773e08
push eax
call fcn.6b584cc0
add esp, 0xc
test eax, eax
je 0x6b583c3d
push 0
push 0
push edi
push eax
push 0xffffffffffffffff
push ebx
push 0
push 0xfde9
mov edi, eax
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
xor edx, edx
test eax, eax
je 0x6b583c67
mov ecx, edi
mov eax, dword [esi + 8]
cmp dword [eax], 0xdddd
je 0x6b583c4c
jmp 0x6b583c86
xor edx, edx
mov eax, dword [esi + 8]
cmp dword [eax], 0xdddd
je 0x6b583c4c
jmp 0x6b583c86
xor ecx, ecx
xor edx, edx
mov eax, dword [esi + 8]
cmp dword [eax], 0xdddd
jne 0x6b583c86
push eax
mov edi, ecx
mov dword [esi + 8], ebx
mov ebx, edx
call fcn.6b721a48
mov ecx, edi
add esp, 4
test bl, bl
mov ebx, dword [esi + 8]
je 0x6b583c8a
jmp 0x6b583ca3
push 0
push 0x6b773e08
push edi
call fcn.6b584e00
xor edx, edx
add esp, 0xc
xor ecx, ecx
mov eax, dword [esi + 8]
cmp dword [eax], 0xdddd
je 0x6b583c4c
test dl, dl
jne 0x6b583ca3
cmp dword [ebx - 8], 0xdddd
jne 0x6b583ca3
add ebx, 0xfffffff8
push ebx
mov edi, ecx
call fcn.6b721a48
mov ecx, edi
add esp, 4
mov eax, ecx
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret