Function at 0x1002b2f1
Capabilities:
Set environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc
mov eax, dword [ebp + 8]
push esi
xor esi, esi
mov dword [ebp - 8], esi
test eax, eax
je 0x1005cbfe
push ebx
mov ebx, dword [eax]
push edi
test ebx, ebx
je 0x1002b3a3
push 0x3d
push ebx
call sym.MSVCR110.dll_wcschr
mov edi, eax
pop ecx
pop ecx
test edi, edi
je 0x1002b3a3
cmp ebx, edi
jne 0x1005cc16
jmp 0x1002b3a3
push 2
push ebx
call sym.MSVCR110.dll_wcslen
pop ecx
add eax, 2
push eax
call sym.MSVCR110.dll__calloc_crt
mov esi, eax
pop ecx
pop ecx
test esi, esi
je 0x1005cdb0
push ebx
push ebx
call sym.MSVCR110.dll_wcslen
pop ecx
add eax, 2
push eax
push esi
call sym.MSVCR110.dll_wcscpy_s
add esp, 0xc
test eax, eax
jne 0x1005cddc
mov eax, dword [ebp - 0xc]
lea ecx, [esi + eax*2]
xor eax, eax
mov word [ecx], ax
mov eax, dword [ebp - 4]
add ecx, 2
neg eax
sbb eax, eax
not eax
and eax, ecx
push eax
push esi
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
test eax, eax
je 0x1005cd9c
push esi
call sym.MSVCR110.dll_free
pop ecx
jmp 0x1005cdb0
pop edi
pop ebx
pop esi
leave
ret
call sym.MSVCR110.dll__errno
jmp 0x1005cc7b
call sym.MSVCR110.dll__errno
mov dword [eax], 0x16
call sym.MSVCR110.dll__invalid_parameter_noinfo
or eax, 0xffffffff
jmp 0x1002b3a0
xor eax, eax
cmp word [edi + 2], si
mov esi, dword [sym.MSVCR110.dll__wenviron]
sete al
mov dword [ebp - 4], eax
cmp esi, dword [sym.MSVCR110.dll___winitenv]
jne 0x1005cc42
push esi
call fcn.100a4a58
mov esi, eax
mov eax, dword [ebp - 4]
pop ecx
mov dword [sym.MSVCR110.dll__wenviron], esi
test esi, esi
jne 0x1005ccd1
mov ecx, dword [sym.MSVCR110.dll__environ]
cmp dword [ebp + 0xc], esi
je 0x1005cc89
test ecx, ecx
je 0x1005cc89
call fcn.100a07c5
mov dword [0x100c8d8c], eax
call fcn.1002668e
test eax, eax
jns 0x1005ccc7
call fcn.100a074a
test eax, eax
jne 0x1002b3a3
jmp 0x1005ccc7
mov dword [eax], 0x16
or eax, 0xffffffff
jmp 0x1002b39e
test eax, eax
jne 0x1005cdd5
test ecx, ecx
jne 0x1005ccb3
push 4
call sym.MSVCR110.dll__malloc_crt
pop ecx
mov dword [sym.MSVCR110.dll__environ], eax
test eax, eax
je 0x1005cc81
and dword [eax], 0
mov esi, dword [sym.MSVCR110.dll__wenviron]
test esi, esi
jne 0x1005ccd1
push 4
call sym.MSVCR110.dll__malloc_crt
pop ecx
mov dword [sym.MSVCR110.dll__wenviron], eax
test eax, eax
je 0x1005cc81
and dword [eax], 0
mov esi, dword [sym.MSVCR110.dll__wenviron]
test esi, esi
je 0x1005cc81
sub edi, ebx
sar edi, 1
push edi
push ebx
mov dword [ebp - 0xc], edi
call fcn.100a4aba
mov edi, eax
pop ecx
pop ecx
test edi, edi
js 0x1005cd3e
cmp dword [esi], 0
je 0x1005cd3e
push dword [esi + edi*4]
call sym.MSVCR110.dll_free
cmp dword [ebp - 4], 0
pop ecx
jne 0x1005cd11
mov dword [esi + edi*4], ebx
mov edi, dword [ebp + 8]
and dword [edi], 0
jmp 0x1005cd90
mov eax, dword [esi + edi*4 + 4]
mov dword [esi + edi*4], eax
inc edi
cmp dword [esi + edi*4], 0
jne 0x1005cd09
cmp edi, 0x3fffffff
jae 0x1005cd8d
push 4
push edi
push dword [sym.MSVCR110.dll__wenviron]
call sym.MSVCR110.dll__recalloc_crt
mov edi, dword [ebp + 8]
add esp, 0xc
test eax, eax
je 0x1005cd90
mov dword [sym.MSVCR110.dll__wenviron], eax
jmp 0x1005cd90
cmp dword [ebp - 4], 0
jne 0x1005cdc8
test edi, edi
jns 0x1005cd4e
neg edi
lea eax, [edi + 2]
cmp eax, edi
jl 0x1005cc81
cmp eax, 0x3fffffff
jae 0x1005cc81
push eax
push 4
push dword [sym.MSVCR110.dll__wenviron]
call sym.MSVCR110.dll__recalloc_crt
add esp, 0xc
test eax, eax
je 0x1005cc81
and dword [eax + edi*4 + 4], 0
mov dword [eax + edi*4], ebx
mov edi, dword [ebp + 8]
and dword [edi], 0
jmp 0x1005cd37
mov edi, dword [ebp + 8]
cmp dword [ebp + 0xc], 0
jne 0x1002b32e
jmp 0x1005cdb0
or dword [ebp - 8], 0xffffffff
call sym.MSVCR110.dll__errno
mov dword [eax], 0x2a
jmp 0x1002b392
cmp dword [ebp - 4], 0
je 0x1005cdc0
push ebx
call sym.MSVCR110.dll_free
and dword [edi], 0
pop ecx
mov eax, dword [ebp - 8]
jmp 0x1002b39e
push ebx
call sym.MSVCR110.dll_free
mov edi, dword [ebp + 8]
pop ecx
and dword [edi], 0
xor eax, eax
jmp 0x1002b39e
xor eax, eax
push eax
push eax
push eax
push eax
push eax
call sym.MSVCR110.dll__invoke_watson
int3