Function at 0x78ac1f52
Capabilities:
Set environment variable

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x10
mov eax, dword [ebp + 8]
push esi
xor esi, esi
mov dword [ebp - 0xc], esi
cmp eax, esi
je 0x78ae143f
push ebx
mov ebx, dword [eax]
push edi
mov dword [ebp - 4], ebx
cmp ebx, esi
je 0x78ac7450
push 0x3d
push ebx
call sym.MSVCR100.dll_wcschr
mov edi, eax
pop ecx
pop ecx
cmp edi, esi
je 0x78ac7450
cmp ebx, edi
je 0x78ac7450
xor eax, eax
cmp word [edi + 2], si
sete al
mov dword [ebp - 8], eax
mov eax, dword [sym.MSVCR100.dll__wenviron]
cmp eax, dword [sym.MSVCR100.dll___winitenv]
je 0x78ac7441
cmp eax, esi
je 0x78ae1457
mov ebx, dword [sym.MSVCR100.dll__wenviron]
cmp ebx, esi
je 0x78ac745a
sub edi, dword [ebp - 4]
push dword [ebp - 4]
sar edi, 1
mov dword [ebp - 0x10], edi
call fcn.78ac1f16
mov edi, eax
pop ecx
cmp edi, esi
jge 0x78ae14e5
cmp dword [ebp - 8], esi
je 0x78ae15e2
push dword [ebp - 4]
call sym.MSVCR100.dll_free
mov eax, dword [ebp + 8]
pop ecx
mov dword [eax], esi
xor eax, eax
pop edi
pop ebx
pop esi
leave
ret
call fcn.78ac73e5
mov dword [sym.MSVCR100.dll__wenviron], eax
jmp 0x78ac1fb3
call sym.MSVCR100.dll__errno
jmp 0x78ae148e
or eax, 0xffffffff
jmp 0x78ac1ffd
call sym.MSVCR100.dll__errno
mov dword [eax], 0x16
call sym.MSVCR100.dll__invalid_parameter_noinfo
or eax, 0xffffffff
jmp 0x78ac1fff
mov eax, dword [sym.MSVCR100.dll__environ]
cmp dword [ebp + 0xc], esi
je 0x78ae1499
cmp eax, esi
je 0x78ae1499
call fcn.78ac22f7
mov dword [0x78b557dc], eax
call fcn.78ac23b8
test eax, eax
jns 0x78ac1fbb
call fcn.78b2b7c4
test eax, eax
jne 0x78ac7450
jmp 0x78ac1fbb
mov dword [eax], 0x16
jmp 0x78ac745a
cmp dword [ebp - 8], esi
jne 0x78ac1ffb
cmp eax, esi
jne 0x78ae14c9
push 4
call sym.MSVCR100.dll__malloc_crt
pop ecx
mov dword [sym.MSVCR100.dll__environ], eax
cmp eax, esi
je 0x78ac745a
mov dword [eax], esi
cmp dword [sym.MSVCR100.dll__wenviron], esi
jne 0x78ac1fbb
push 4
call sym.MSVCR100.dll__malloc_crt
pop ecx
mov dword [sym.MSVCR100.dll__wenviron], eax
cmp eax, esi
je 0x78ac745a
mov dword [eax], esi
jmp 0x78ac1fbb
cmp dword [ebx], esi
je 0x78ac1fe4
lea esi, [ebx + edi*4]
push dword [esi]
call sym.MSVCR100.dll_free
xor eax, eax
pop ecx
cmp dword [ebp - 8], eax
jne 0x78ae15af
mov ecx, dword [ebp - 4]
mov dword [esi], ecx
mov ecx, dword [ebp + 8]
mov dword [ecx], eax
xor esi, esi
cmp dword [ebp + 0xc], esi
je 0x78ae158b
push 2
pop ebx
push ebx
push dword [ebp - 4]
call sym.MSVCR100.dll_wcslen
pop ecx
add eax, ebx
push eax
call sym.MSVCR100.dll__calloc_crt
mov edi, eax
pop ecx
pop ecx
cmp edi, esi
je 0x78ae158b
push dword [ebp - 4]
push dword [ebp - 4]
call sym.MSVCR100.dll_wcslen
pop ecx
add eax, ebx
push eax
push edi
call sym.MSVCR100.dll_wcscpy_s
add esp, 0xc
test eax, eax
jne 0x78ae1631
mov eax, dword [ebp - 0x10]
xor ecx, ecx
lea eax, [edi + eax*2]
mov word [eax], cx
mov ecx, dword [ebp - 8]
add eax, ebx
neg ecx
sbb ecx, ecx
not ecx
and ecx, eax
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
test eax, eax
jne 0x78ae1584
or dword [ebp - 0xc], 0xffffffff
call sym.MSVCR100.dll__errno
mov dword [eax], 0x2a
push edi
call sym.MSVCR100.dll_free
pop ecx
cmp dword [ebp - 8], esi
je 0x78ae159e
push dword [ebp - 4]
call sym.MSVCR100.dll_free
mov eax, dword [ebp + 8]
pop ecx
mov dword [eax], esi
mov eax, dword [ebp - 0xc]
jmp 0x78ac1ffd
mov ecx, dword [esi + 4]
inc edi
mov dword [esi], ecx
lea esi, [ebx + edi*4]
cmp dword [esi], eax
jne 0x78ae15a6
cmp edi, 0x3fffffff
jae 0x78ae150d
push 4
push edi
push dword [sym.MSVCR100.dll__wenviron]
call sym.MSVCR100.dll__recalloc_crt
add esp, 0xc
test eax, eax
je 0x78ae150d
mov dword [sym.MSVCR100.dll__wenviron], eax
jmp 0x78ae150d
cmp edi, esi
jge 0x78ae15e8
neg edi
lea eax, [edi + 2]
cmp eax, edi
jl 0x78ac745a
cmp eax, 0x3fffffff
jae 0x78ac745a
push eax
push 4
push dword [sym.MSVCR100.dll__wenviron]
call sym.MSVCR100.dll__recalloc_crt
add esp, 0xc
cmp eax, esi
je 0x78ac745a
mov edx, dword [ebp - 4]
lea ecx, [eax + edi*4]
mov dword [ecx], edx
mov dword [ecx + 4], esi
mov ecx, dword [ebp + 8]
mov dword [ecx], esi
mov dword [sym.MSVCR100.dll__wenviron], eax
jmp 0x78ae150f
push esi
push esi
push esi
push esi
push esi
call sym.MSVCR100.dll__invoke_watson
int3