Function at 0x1003ce0
Capabilities:
Query environment variable

Disassembly:
sub esp, 8
mov eax, dword [0x100aa88]
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 0x1003d33
call esi
test eax, eax
mov dword [esp + 0x10], eax
je 0x1003d17
mov eax, 1
jmp 0x1003d2a
call edi
test eax, eax
mov dword [esp + 0x10], eax
je 0x1003ed2
mov eax, 2
mov ebx, dword [esp + 0x10]
mov dword [0x100aa88], eax
cmp eax, 1
jne 0x1003dbc
test ebx, ebx
jne 0x1003d56
call esi
test eax, eax
mov dword [esp + 0x10], eax
jne 0x1003d52
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 0x1003d70
add eax, 2
cmp word [eax], 0
jne 0x1003d5e
add eax, 2
cmp word [eax], 0
jne 0x1003d5e
sub eax, ebx
add eax, 2
mov esi, eax
push esi
call fcn.01003480
mov ebp, eax
add esp, 4
test ebp, ebp
jne 0x1003d97
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 0x1003eb6
test ebx, ebx
jne 0x1003ddf
call edi
test eax, eax
mov dword [esp + 0x10], eax
jne 0x1003ddb
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 0x1003e27
mov ecx, dword [0x100aab0]
push 0
push 0
push 0xffffffffffffffff
push esi
push 1
push ecx
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
test eax, eax
je 0x1003ed2
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 0x1003de7
mov eax, dword [esp + 0x14]
inc eax
mov dword [esp + 0x14], eax
lea edx, [eax + eax]
push edx
call fcn.01003480
mov ebp, eax
add esp, 4
test ebp, ebp
jne 0x1003e53
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 0x1003ea4
mov edx, dword [esp + 0x14]
mov ecx, esi
sub ecx, ebp
mov eax, dword [0x100aab0]
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 0x1003ebe
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 fcn.010030f0
lea esi, [esi + eax*2 + 2]
mov al, byte [ebx]
add esp, 4
test al, al
jne 0x1003e5e
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 fcn.010031f0
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