Function at 0x76b50a3d
Capabilities:
Set environment variable

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0xc
mov eax, dword [ebp + 8]
push ebx
xor ebx, ebx
mov dword [ebp - 8], ebx
push edi
test eax, eax
jne 0x76b50a70
call sym.msvcrt.dll__errno
push ebx
push ebx
push ebx
push ebx
push ebx
mov dword [eax], 0x16
call sym.msvcrt.dll__invalid_parameter
add esp, 0x14
or eax, 0xffffffff
jmp 0x76b50add
mov ebx, dword [eax]
push esi
test ebx, ebx
je 0x76b50ace
push 0x3d
push ebx
call sym.msvcrt.dll__mbschr
mov esi, eax
mov dword [ebp - 0xc], esi
pop ecx
pop ecx
test esi, esi
je 0x76b50ace
cmp ebx, esi
je 0x76b50ace
mov al, byte [esi + 1]
mov edi, dword [sym.msvcrt.dll__environ]
mov byte [ebp - 1], al
cmp edi, dword [sym.msvcrt.dll___initenv]
jne 0x76b50ab4
push edi
call fcn.76b50cb4
mov edi, eax
mov al, byte [ebp - 1]
pop ecx
mov dword [sym.msvcrt.dll__environ], edi
test edi, edi
jne 0x76b50b24
cmp dword [ebp + 0xc], edi
je 0x76b50ae1
cmp dword [sym.msvcrt.dll__wenviron], edi
je 0x76b50ae1
call fcn.76b5132e
test eax, eax
je 0x76b50b1a
call sym.msvcrt.dll__errno
mov dword [eax], 0x16
or eax, 0xffffffff
pop esi
pop edi
pop ebx
leave
ret
test al, al
je 0x76b50ca7
push 4
call fcn.76b38776
mov dword [sym.msvcrt.dll__environ], eax
pop ecx
test eax, eax
je 0x76b50ad9
and dword [eax], 0
cmp dword [sym.msvcrt.dll__wenviron], 0
jne 0x76b50b1a
push 4
call fcn.76b38776
mov dword [sym.msvcrt.dll__wenviron], eax
pop ecx
test eax, eax
je 0x76b50ad9
and dword [eax], 0
mov edi, dword [sym.msvcrt.dll__environ]
test edi, edi
je 0x76b50ad9
mov eax, esi
sub eax, ebx
push eax
push ebx
call fcn.76b50d1c
mov esi, eax
pop ecx
pop ecx
test esi, esi
js 0x76b50b9f
cmp dword [edi], 0
je 0x76b50b9f
mov eax, dword [edi + esi*4]
cmp eax, dword [sym.msvcrt.dll___initenv]
jb 0x76b50b4f
cmp eax, dword [0x76babc90]
jbe 0x76b50b56
push eax
call sym.msvcrt.dll_free
pop ecx
cmp byte [ebp - 1], 0
je 0x76b50b72
mov dword [edi + esi*4], ebx
mov edi, dword [ebp + 8]
and dword [edi], 0
jmp 0x76b50bf1
mov eax, dword [edi + esi*4 + 4]
mov dword [edi + esi*4], eax
inc esi
cmp dword [edi + esi*4], 0
jne 0x76b50b6a
cmp esi, 0x3fffffff
jae 0x76b50bee
push 4
push esi
push dword [sym.msvcrt.dll__environ]
call fcn.76b38811
mov edi, dword [ebp + 8]
add esp, 0xc
test eax, eax
je 0x76b50bf1
mov dword [sym.msvcrt.dll__environ], eax
jmp 0x76b50bf1
cmp byte [ebp - 1], 0
je 0x76b50c9a
test esi, esi
jns 0x76b50baf
neg esi
lea eax, [esi + 2]
cmp eax, esi
jl 0x76b50ad9
cmp eax, 0x3fffffff
jae 0x76b50ad9
push eax
push 4
push dword [sym.msvcrt.dll__environ]
call fcn.76b38811
add esp, 0xc
test eax, eax
je 0x76b50ad9
mov edi, dword [ebp + 8]
and dword [eax + esi*4 + 4], 0
mov dword [eax + esi*4], ebx
and dword [edi], 0
jmp 0x76b50b98
mov edi, dword [ebp + 8]
cmp dword [ebp + 0xc], 0
je 0x76b50c82
mov ecx, ebx
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x76b50c00
sub ecx, edx
push 1
lea eax, [ecx + 2]
push eax
call fcn.76b38729
mov esi, eax
pop ecx
pop ecx
test esi, esi
je 0x76b50c82
mov ecx, ebx
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x76b50c21
sub ecx, edx
push ebx
lea eax, [ecx + 2]
push eax
push esi
call sym.msvcrt.dll_strcpy_s
add esp, 0xc
test eax, eax
je 0x76b50c4b
xor eax, eax
push eax
push eax
push eax
push eax
push eax
call fcn.76b4977b
add esp, 0x14
movsx eax, byte [ebp - 1]
mov ecx, esi
sub ecx, ebx
add ecx, dword [ebp - 0xc]
mov byte [ecx], 0
inc ecx
neg eax
sbb eax, eax
and eax, ecx
push eax
push esi
call dword [sym.imp.api_ms_win_core_processenvironment_l1_1_0.dll_SetEnvironmentVariableA]
test eax, eax
jne 0x76b50c7b
or dword [ebp - 8], 0xffffffff
call sym.msvcrt.dll__errno
mov dword [eax], 0x2a
push esi
call sym.msvcrt.dll_free
pop ecx
cmp byte [ebp - 1], 0
jne 0x76b50c92
push ebx
call sym.msvcrt.dll_free
and dword [edi], 0
pop ecx
mov eax, dword [ebp - 8]
jmp 0x76b50adc
push ebx
call sym.msvcrt.dll_free
mov edi, dword [ebp + 8]
pop ecx
and dword [edi], 0
xor eax, eax
jmp 0x76b50adc