Function at 0x1020fe20
Capabilities:
Set environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
push esi
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x14], 0
cmp dword [ebp + 8], 0
jne 0x1020fe65
xor eax, eax
jne 0x1020fe5d
push str.FALSE
push 0
push 0x5a
push str.f:_vs70builds3077_vccrtbldcrt_src_setenv.c
push 2
call sym.MSVCR71D.dll__CrtDbgReport
add esp, 0x14
cmp eax, 1
jne 0x1020fe5d
int3
or eax, 0xffffffff
jmp 0x10210329
mov edx, dword [ebp + 8]
mov eax, dword [edx]
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
je 0x1020fe92
push 0x3d
mov ecx, dword [ebp - 0x14]
push ecx
call sym.MSVCR71D.dll_wcschr
add esp, 8
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x20], 0
je 0x1020fe92
mov edx, dword [ebp - 0x14]
cmp edx, dword [ebp - 0x20]
jne 0x1020fe9a
or eax, 0xffffffff
jmp 0x10210329
mov eax, dword [ebp - 0x20]
movzx ecx, word [eax + 2]
neg ecx
sbb ecx, ecx
inc ecx
mov dword [ebp - 0x1c], ecx
mov edx, dword [sym.MSVCR71D.dll__wenviron]
cmp edx, dword [sym.MSVCR71D.dll___winitenv]
jne 0x1020feca
mov eax, dword [sym.MSVCR71D.dll__wenviron]
push eax
call fcn.102103b0
add esp, 4
mov dword [sym.MSVCR71D.dll__wenviron], eax
cmp dword [sym.MSVCR71D.dll__wenviron], 0
jne 0x1020ff8b
cmp dword [ebp + 0xc], 0
je 0x1020fefc
cmp dword [sym.MSVCR71D.dll__environ], 0
je 0x1020fefc
call fcn.1020ce00
test eax, eax
je 0x1020fef7
or eax, 0xffffffff
jmp 0x10210329
jmp 0x1020ff8b
cmp dword [ebp - 0x1c], 0
je 0x1020ff09
xor eax, eax
jmp 0x10210329
cmp dword [sym.MSVCR71D.dll__environ], 0
jne 0x1020ff4a
push 0x9c
push str.f:_vs70builds3077_vccrtbldcrt_src_setenv.c
push 2
push 4
call sym.MSVCR71D.dll__malloc_dbg
add esp, 0x10
mov dword [sym.MSVCR71D.dll__environ], eax
cmp dword [sym.MSVCR71D.dll__environ], 0
jne 0x1020ff3e
or eax, 0xffffffff
jmp 0x10210329
mov ecx, dword [sym.MSVCR71D.dll__environ]
mov dword [ecx], 0
cmp dword [sym.MSVCR71D.dll__wenviron], 0
jne 0x1020ff8b
push 0xa3
push str.f:_vs70builds3077_vccrtbldcrt_src_setenv.c
push 2
push 4
call sym.MSVCR71D.dll__malloc_dbg
add esp, 0x10
mov dword [sym.MSVCR71D.dll__wenviron], eax
cmp dword [sym.MSVCR71D.dll__wenviron], 0
jne 0x1020ff7f
or eax, 0xffffffff
jmp 0x10210329
mov edx, dword [sym.MSVCR71D.dll__wenviron]
mov dword [edx], 0
mov eax, dword [sym.MSVCR71D.dll__wenviron]
mov dword [ebp - 8], eax
mov ecx, dword [ebp - 0x20]
sub ecx, dword [ebp - 0x14]
sar ecx, 1
push ecx
mov edx, dword [ebp - 0x14]
push edx
call fcn.10210330
add esp, 8
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
jl 0x10210056
mov eax, dword [ebp - 8]
cmp dword [eax], 0
je 0x10210056
push 2
mov ecx, dword [ebp - 0xc]
mov edx, dword [ebp - 8]
mov eax, dword [edx + ecx*4]
push eax
call sym.MSVCR71D.dll__free_dbg
add esp, 8
cmp dword [ebp - 0x1c], 0
je 0x1021003c
jmp 0x1020ffe6
mov ecx, dword [ebp - 0xc]
add ecx, 1
mov dword [ebp - 0xc], ecx
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp - 8]
cmp dword [eax + edx*4], 0
je 0x10210007
mov ecx, dword [ebp - 0xc]
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 0xc]
mov esi, dword [ebp - 8]
mov eax, dword [esi + eax*4 + 4]
mov dword [edx + ecx*4], eax
jmp 0x1020ffdd
push 0xd1
push str.f:_vs70builds3077_vccrtbldcrt_src_setenv.c
push 2
mov ecx, dword [ebp - 0xc]
shl ecx, 2
push ecx
mov edx, dword [sym.MSVCR71D.dll__wenviron]
push edx
call sym.MSVCR71D.dll__realloc_dbg
add esp, 0x14
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
je 0x1021003a
mov eax, dword [ebp - 8]
mov dword [sym.MSVCR71D.dll__wenviron], eax
jmp 0x10210051
mov ecx, dword [ebp - 0xc]
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 0x14]
mov dword [edx + ecx*4], eax
mov ecx, dword [ebp + 8]
mov dword [ecx], 0
jmp 0x102100ec
cmp dword [ebp - 0x1c], 0
jne 0x102100ce
cmp dword [ebp - 0xc], 0
jge 0x1021006a
mov edx, dword [ebp - 0xc]
neg edx
mov dword [ebp - 0xc], edx
push 0xe9
push str.f:_vs70builds3077_vccrtbldcrt_src_setenv.c
push 2
mov eax, dword [ebp - 0xc]
lea ecx, [eax*4 + 8]
push ecx
mov edx, dword [sym.MSVCR71D.dll__wenviron]
push edx
call sym.MSVCR71D.dll__realloc_dbg
add esp, 0x14
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
jne 0x102100a1
or eax, 0xffffffff
jmp 0x10210329
mov eax, dword [ebp - 0xc]
mov ecx, dword [ebp - 8]
mov edx, dword [ebp - 0x14]
mov dword [ecx + eax*4], edx
mov eax, dword [ebp - 0xc]
mov ecx, dword [ebp - 8]
mov dword [ecx + eax*4 + 4], 0
mov edx, dword [ebp + 8]
mov dword [edx], 0
mov eax, dword [ebp - 8]
mov dword [sym.MSVCR71D.dll__wenviron], eax
jmp 0x102100ec
push 2
mov ecx, dword [ebp - 0x14]
push ecx
call sym.MSVCR71D.dll__free_dbg
add esp, 8
mov edx, dword [ebp + 8]
mov dword [edx], 0
xor eax, eax
jmp 0x10210329
cmp dword [ebp + 0xc], 0
je 0x10210312
push 0x109
push str.f:_vs70builds3077_vccrtbldcrt_src_setenv.c
push 2
mov eax, dword [ebp - 0x14]
push eax
call sym.MSVCR71D.dll_wcslen
add esp, 4
lea ecx, [eax + eax + 4]
push ecx
call sym.MSVCR71D.dll__malloc_dbg
add esp, 0x10
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
je 0x10210312
mov edx, dword [ebp - 0x14]
push edx
mov eax, dword [ebp - 0x18]
push eax
call sym.MSVCR71D.dll_wcscpy
add esp, 8
mov ecx, dword [ebp - 0x20]
sub ecx, dword [ebp - 0x14]
sar ecx, 1
mov edx, dword [ebp - 0x18]
lea eax, [edx + ecx*2]
mov dword [ebp - 4], eax
mov ecx, dword [ebp - 4]
mov word [ecx], 0
mov edx, dword [ebp - 4]
add edx, 2
mov dword [ebp - 4], edx
cmp dword [0x1027c7f8], 1
jne 0x1021019d
xor eax, eax
cmp dword [ebp - 0x1c], 0
setne al
dec eax
and eax, dword [ebp - 4]
push eax
mov ecx, dword [ebp - 0x18]
push ecx
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
test eax, eax
jne 0x1021019d
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x78
jne 0x10210196
mov dword [0x1027c7f8], 0
jmp 0x1021019d
mov dword [ebp - 0x10], 0xffffffff
cmp dword [0x1027c7f8], 0
jne 0x10210304
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x2c], 0
push 0
push 0
push 0
push 0
push 0xffffffffffffffff
mov edx, dword [ebp - 0x18]
push edx
push 0
push 0
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov dword [ebp - 0x28], eax
cmp dword [ebp - 0x28], 0
jne 0x102101e5
mov dword [ebp - 0x10], 0xffffffff
jmp 0x102102bf
push 0x121
push str.f:_vs70builds3077_vccrtbldcrt_src_setenv.c
push 2
mov eax, dword [ebp - 0x28]
push eax
call sym.MSVCR71D.dll__malloc_dbg
add esp, 0x10
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0x24], 0
jne 0x10210212
mov dword [ebp - 0x10], 0xffffffff
jmp 0x102102bf
push 0
push 0
mov ecx, dword [ebp - 0x28]
push ecx
mov edx, dword [ebp - 0x24]
push edx
push 0xffffffffffffffff
mov eax, dword [ebp - 0x18]
push eax
push 0
push 0
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
test eax, eax
jne 0x1021023e
mov dword [ebp - 0x10], 0xffffffff
jmp 0x102102bf
cmp dword [ebp - 0x1c], 0
jne 0x102102bf
push 0
push 0
push 0
push 0
push 0xffffffffffffffff
mov ecx, dword [ebp - 4]
push ecx
push 0
push 0
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov dword [ebp - 0x28], eax
cmp dword [ebp - 0x28], 0
jne 0x1021026e
mov dword [ebp - 0x10], 0xffffffff
jmp 0x102102bf
push 0x12d
push str.f:_vs70builds3077_vccrtbldcrt_src_setenv.c
push 2
mov edx, dword [ebp - 0x28]
push edx
call sym.MSVCR71D.dll__malloc_dbg
add esp, 0x10
mov dword [ebp - 0x2c], eax
cmp dword [ebp - 0x2c], 0
jne 0x10210298
mov dword [ebp - 0x10], 0xffffffff
jmp 0x102102bf
push 0
push 0
mov eax, dword [ebp - 0x28]
push eax
mov ecx, dword [ebp - 0x2c]
push ecx
push 0xffffffffffffffff
mov edx, dword [ebp - 4]
push edx
push 0
push 0
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
test eax, eax
jne 0x102102bf
mov dword [ebp - 0x10], 0xffffffff
cmp dword [ebp - 0x10], 0xffffffff
je 0x102102e8
xor eax, eax
cmp dword [ebp - 0x1c], 0
setne al
dec eax
and eax, dword [ebp - 0x2c]
push eax
mov ecx, dword [ebp - 0x24]
push ecx
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableA]
test eax, eax
jne 0x102102e8
mov dword [ebp - 0x10], 0xffffffff
push 2
mov edx, dword [ebp - 0x2c]
push edx
call sym.MSVCR71D.dll__free_dbg
add esp, 8
push 2
mov eax, dword [ebp - 0x24]
push eax
call sym.MSVCR71D.dll__free_dbg
add esp, 8
push 2
mov ecx, dword [ebp - 0x18]
push ecx
call sym.MSVCR71D.dll__free_dbg
add esp, 8
cmp dword [ebp - 0x1c], 0
je 0x10210326
push 2
mov edx, dword [ebp - 0x14]
push edx
call sym.MSVCR71D.dll__free_dbg
add esp, 8
mov eax, dword [ebp - 0x10]
pop esi
mov esp, ebp
pop ebp
ret