Function at 0x4121c0
Capabilities:
Query environment variable

Disassembly:
sub esp, 8
mov eax, dword [0x43c5e8]
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 0x412213
call esi
test eax, eax
mov dword [esp + 0x10], eax
je 0x4121f7
mov eax, 1
jmp 0x41220a
call edi
test eax, eax
mov dword [esp + 0x10], eax
je 0x4123b2
mov eax, 2
mov ebx, dword [esp + 0x10]
mov dword [0x43c5e8], eax
cmp eax, 1
jne 0x41229c
test ebx, ebx
jne 0x412236
call esi
test eax, eax
mov dword [esp + 0x10], eax
jne 0x412232
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 0x412250
add eax, 2
cmp word [eax], 0
jne 0x41223e
add eax, 2
cmp word [eax], 0
jne 0x41223e
sub eax, ebx
add eax, 2
mov esi, eax
push esi
call fcn.00410a10
mov ebp, eax
add esp, 4
test ebp, ebp
jne 0x412277
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 0x412396
test ebx, ebx
jne 0x4122bf
call edi
test eax, eax
mov dword [esp + 0x10], eax
jne 0x4122bb
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 0x412307
mov ecx, dword [0x43c680]
push 0
push 0
push 0xffffffffffffffff
push esi
push 1
push ecx
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
test eax, eax
je 0x4123b2
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 0x4122c7
mov eax, dword [esp + 0x14]
inc eax
mov dword [esp + 0x14], eax
lea edx, [eax + eax]
push edx
call fcn.00410a10
mov ebp, eax
add esp, 4
test ebp, ebp
jne 0x412333
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 0x412384
mov edx, dword [esp + 0x14]
mov ecx, esi
sub ecx, ebp
mov eax, dword [0x43c680]
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 0x41239e
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.00410170
lea esi, [esi + eax*2 + 2]
mov al, byte [ebx]
add esp, 4
test al, al
jne 0x41233e
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.0040fd40
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