Function at 0x7800cdd0
Capabilities:
Query environment variable

Disassembly:
sub esp, 8
mov eax, dword [0x78041410]
push ebx
push ebp
push esi
mov esi, dword [sym.imp.KERNEL32.dll_GetEnvironmentStringsW]
xor ebx, ebx
push edi
mov edi, dword [sym.imp.KERNEL32.dll_GetEnvironmentStrings]
test eax, eax
mov dword [esp + 0x10], ebx
mov dword [esp + 0x14], ebx
jne 0x7800ce23
call esi
test eax, eax
mov dword [esp + 0x10], eax
je 0x7800ce07
mov eax, 1
jmp 0x7800ce1a
call edi
test eax, eax
mov dword [esp + 0x10], eax
je 0x7800cfc2
mov eax, 2
mov ebx, dword [esp + 0x10]
mov dword [0x78041410], eax
cmp eax, 1
jne 0x7800ceac
test ebx, ebx
jne 0x7800ce46
call esi
test eax, eax
mov dword [esp + 0x10], eax
jne 0x7800ce42
pop edi
pop esi
pop ebp
pop ebx
add esp, 8
ret
mov ebx, dword [esp + 0x10]
cmp word [ebx], 0
mov eax, ebx
je 0x7800ce60
add eax, 2
cmp word [eax], 0
jne 0x7800ce4e
add eax, 2
cmp word [eax], 0
jne 0x7800ce4e
sub eax, ebx
add eax, 2
mov esi, eax
push esi
call sym.MSVCRT.dll_malloc
mov ebp, eax
add esp, 4
test ebp, ebp
jne 0x7800ce87
push ebx
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsW]
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 8
ret
mov ecx, esi
mov esi, ebx
mov eax, ecx
mov edi, ebp
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
push ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsW]
mov eax, ebp
pop edi
pop esi
pop ebp
pop ebx
add esp, 8
ret
cmp eax, 2
jne 0x7800cfa6
test ebx, ebx
jne 0x7800cecf
call edi
test eax, eax
mov dword [esp + 0x10], eax
jne 0x7800cecb
pop edi
pop esi
pop ebp
pop ebx
add esp, 8
ret
mov ebx, dword [esp + 0x10]
mov al, byte [ebx]
mov esi, ebx
test al, al
je 0x7800cf17
mov ecx, dword [sym.MSVCRT.dll___lc_codepage]
push 0
push 0
push 0xffffffffffffffff
push esi
push 1
push ecx
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
test eax, eax
je 0x7800cfc2
mov ebp, dword [esp + 0x14]
mov edi, esi
add ebp, eax
or ecx, 0xffffffff
xor eax, eax
mov dword [esp + 0x14], ebp
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov al, byte [esi + ecx + 1]
lea esi, [esi + ecx + 1]
test al, al
jne 0x7800ced7
mov eax, dword [esp + 0x14]
inc eax
mov dword [esp + 0x14], eax
lea edx, [eax + eax]
push edx
call sym.MSVCRT.dll_malloc
mov ebp, eax
add esp, 4
test ebp, ebp
jne 0x7800cf43
push ebx
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsA]
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 8
ret
mov eax, dword [esp + 0x10]
mov esi, ebp
cmp byte [eax], 0
je 0x7800cf94
mov edx, dword [esp + 0x14]
mov ecx, esi
sub ecx, ebp
mov eax, dword [sym.MSVCRT.dll___lc_codepage]
sar ecx, 1
sub edx, ecx
push edx
push esi
push 0xffffffffffffffff
push ebx
push 1
push eax
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
test eax, eax
je 0x7800cfae
mov edi, ebx
or ecx, 0xffffffff
xor eax, eax
push esi
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea ebx, [ebx + ecx + 1]
call sym.MSVCRT.dll_wcslen
lea esi, [esi + eax*2 + 2]
mov al, byte [ebx]
add esp, 4
test al, al
jne 0x7800cf4e
mov edx, dword [esp + 0x10]
mov word [esi], 0
push edx
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsA]
mov eax, ebp
pop edi
pop esi
pop ebp
pop ebx
add esp, 8
ret
push ebp
call sym.MSVCRT.dll_free
mov ecx, dword [esp + 0x14]
add esp, 4
push ecx
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsA]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 8
ret