Function at 0x10219bf0
Capabilities:
Set environment variable

Disassembly:
sub esp, 8
push ebx
push esi
push edi
push ebp
mov edi, dword [esp + 0x1c]
test edi, edi
je 0x10219e22
push 0x3d
push edi
call sym.MSVCRT40.dll_wcschr
add esp, 8
mov ebx, eax
test ebx, ebx
je 0x10219e22
cmp edi, ebx
je 0x10219e22
cmp word [ebx + 2], 1
sbb eax, eax
mov ecx, dword [sym.MSVCRT40.dll__wenviron]
neg eax
mov dword [esp + 0x14], eax
cmp dword [sym.MSVCRT40.dll___winitenv], ecx
jne 0x10219c49
push ecx
call fcn.10219e90
add esp, 4
mov dword [sym.MSVCRT40.dll__wenviron], eax
cmp dword [sym.MSVCRT40.dll__wenviron], 0
jne 0x10219cf9
cmp dword [esp + 0x20], 0
je 0x10219c80
cmp dword [sym.MSVCRT40.dll__environ], 0
je 0x10219c80
call fcn.10218040
test eax, eax
je 0x10219cf9
mov eax, 0xffffffff
pop ebp
pop edi
pop esi
pop ebx
add esp, 8
ret
cmp dword [esp + 0x14], 0
je 0x10219c91
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 8
ret
cmp dword [sym.MSVCRT40.dll__environ], 0
jne 0x10219cc5
push 4
call sym.MSVCRT40.dll_malloc
add esp, 4
mov dword [sym.MSVCRT40.dll__environ], eax
test eax, eax
jne 0x10219cba
mov eax, 0xffffffff
pop ebp
pop edi
pop esi
pop ebx
add esp, 8
ret
mov eax, dword [sym.MSVCRT40.dll__environ]
mov dword [eax], 0
cmp dword [sym.MSVCRT40.dll__wenviron], 0
jne 0x10219cf9
push 4
call sym.MSVCRT40.dll_malloc
add esp, 4
mov dword [sym.MSVCRT40.dll__wenviron], eax
test eax, eax
jne 0x10219cee
mov eax, 0xffffffff
pop ebp
pop edi
pop esi
pop ebx
add esp, 8
ret
mov eax, dword [sym.MSVCRT40.dll__wenviron]
mov dword [eax], 0
mov eax, dword [sym.MSVCRT40.dll__wenviron]
sub ebx, edi
mov dword [esp + 0x10], eax
mov eax, ebx
sar eax, 1
push eax
push edi
call fcn.10219e30
add esp, 8
mov esi, eax
test esi, esi
jl 0x10219d6e
mov eax, dword [esp + 0x10]
cmp dword [eax], 0
je 0x10219d6e
cmp dword [esp + 0x14], 0
je 0x10219d65
lea ebp, [eax + esi*4]
mov ecx, dword [ebp]
push ecx
call sym.MSVCRT40.dll_free
add esp, 4
cmp dword [ebp], 0
je 0x10219d4e
mov eax, dword [ebp + 4]
add ebp, 4
inc esi
mov dword [ebp - 4], eax
cmp dword [ebp], 0
jne 0x10219d3e
shl esi, 2
mov eax, dword [esp + 0x10]
push esi
push eax
call sym.MSVCRT40.dll_realloc
add esp, 8
test eax, eax
je 0x10219db6
jmp 0x10219db1
mov eax, dword [esp + 0x10]
mov dword [eax + esi*4], edi
jmp 0x10219db6
cmp dword [esp + 0x14], 0
jne 0x10219e18
test esi, esi
jge 0x10219d7f
neg esi
lea eax, [esi*4 + 8]
mov ecx, dword [esp + 0x10]
push eax
push ecx
call sym.MSVCRT40.dll_realloc
add esp, 8
test eax, eax
jne 0x10219da5
mov eax, 0xffffffff
pop ebp
pop edi
pop esi
pop ebx
add esp, 8
ret
lea ecx, [eax + esi*4]
mov dword [ecx], edi
mov dword [ecx + 4], 0
mov dword [sym.MSVCRT40.dll__wenviron], eax
cmp dword [esp + 0x20], 0
je 0x10219e0e
push edi
call sym.MSVCRT40.dll_wcslen
add esp, 4
lea eax, [eax*2 + 4]
push eax
call sym.MSVCRT40.dll_malloc
add esp, 4
mov esi, eax
test esi, esi
je 0x10219e0e
push edi
and ebx, 0xfffffffe
push esi
call sym.MSVCRT40.dll_wcscpy
add esp, 8
lea ecx, [ebx + esi]
mov word [ecx], 0
lea ecx, [ecx + 2]
cmp dword [esp + 0x14], 1
sbb eax, eax
and eax, ecx
push eax
push esi
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
push esi
call sym.MSVCRT40.dll_free
add esp, 4
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 8
ret
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 8
ret
mov eax, 0xffffffff
pop ebp
pop edi
pop esi
pop ebx
add esp, 8
ret