Function at 0x408610
Capabilities:
Set environment variable

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x48a891
mov eax, dword fs:[0]
push eax
sub esp, 0xb0
mov eax, dword [0x4b74b0]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
mov dword [ebp - 0xb4], eax
mov dword [ebp - 0xa4], eax
xor eax, eax
mov dword [ebp - 0xbc], eax
mov dword [ebp - 0xac], eax
mov dword [ebp - 0x48], eax
mov dword [ebp - 0x44], 7
mov word [ebp - 0x58], ax
mov dword [ebp - 4], eax
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x14], 7
mov word [ebp - 0x28], ax
mov ebx, 7
mov dword [ebp - 0x60], eax
mov dword [ebp - 0x5c], ebx
mov word [ebp - 0x70], ax
mov dword [ebp - 0x78], eax
mov dword [ebp - 0x74], ebx
mov word [ebp - 0x88], ax
push 0xe
push str._k_Scenario_t_
lea ecx, [ebp - 0x58]
mov byte [ebp - 4], 3
call fcn.00404550
lea eax, [ebp - 0x58]
push eax
lea eax, [ebp - 0xa0]
push eax
call fcn.0040cfa0
mov esi, eax
add esp, 8
lea eax, [ebp - 0x28]
cmp eax, esi
je 0x40874d
mov edx, dword [ebp - 0x14]
cmp edx, 8
jb 0x408703
mov ecx, dword [ebp - 0x28]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x4086f9
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40877f
push edx
push ecx
call fcn.00487869
add esp, 8
mov dword [ebp - 0x18], 0
xor eax, eax
mov word [ebp - 0x28], ax
mov dword [ebp - 0x14], 7
mov eax, dword [esi]
mov dword [ebp - 0x28], eax
mov eax, dword [esi + 4]
mov dword [ebp - 0x24], eax
mov eax, dword [esi + 8]
mov dword [ebp - 0x20], eax
mov eax, dword [esi + 0xc]
mov dword [ebp - 0x1c], eax
mov eax, dword [esi + 0x10]
mov dword [ebp - 0x18], eax
mov eax, dword [esi + 0x14]
mov dword [ebp - 0x14], eax
xor eax, eax
mov dword [esi + 0x10], 0
mov dword [esi + 0x14], 7
mov word [esi], ax
mov edx, dword [ebp - 0x8c]
cmp edx, 8
jb 0x40878f
mov ecx, dword [ebp - 0xa0]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x408785
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x408785
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push edx
push ecx
call fcn.00487869
add esp, 8
cmp dword [ebp - 0x18], 0
jne 0x40885e
mov eax, dword [ebp - 0xa4]
xor ecx, ecx
mov dword [eax + 0x10], 0
mov dword [eax + 0x14], 7
mov word [eax], cx
mov edx, dword [ebp - 0x14]
cmp edx, 8
jb 0x4087ec
mov ecx, dword [ebp - 0x28]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x4087e2
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4090ee
push edx
push ecx
call fcn.00487869
add esp, 8
mov edx, dword [ebp - 0x44]
xor eax, eax
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 7
mov word [ebp - 0x28], ax
cmp edx, 8
jb 0x40883a
mov ecx, dword [ebp - 0x58]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x408830
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4090ee
push edx
push ecx
call fcn.00487869
add esp, 8
mov eax, dword [ebp - 0xa4]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00487877
mov esp, ebp
pop ebp
ret 4
cmp dword [ebp - 0x44], 8
lea eax, [ebp - 0x58]
mov edi, dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
cmovae eax, dword [ebp - 0x58]
push 0
push eax
call edi
cmp dword [ebp - 0x14], 8
lea eax, [ebp - 0x28]
push dword [ebp - 0x18]
cmovae eax, dword [ebp - 0x28]
lea ecx, [ebp - 0x58]
push eax
call fcn.00401cf0
lea eax, [ebp - 0x58]
push eax
lea eax, [ebp - 0xa0]
push eax
call fcn.0040cfa0
mov esi, eax
add esp, 8
lea eax, [ebp - 0x28]
cmp eax, esi
je 0x40892f
mov edx, dword [ebp - 0x14]
cmp edx, 8
jb 0x4088e5
mov ecx, dword [ebp - 0x28]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x4088db
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x408961
push edx
push ecx
call fcn.00487869
add esp, 8
mov dword [ebp - 0x18], 0
xor eax, eax
mov word [ebp - 0x28], ax
mov dword [ebp - 0x14], 7
mov eax, dword [esi]
mov dword [ebp - 0x28], eax
mov eax, dword [esi + 4]
mov dword [ebp - 0x24], eax
mov eax, dword [esi + 8]
mov dword [ebp - 0x20], eax
mov eax, dword [esi + 0xc]
mov dword [ebp - 0x1c], eax
mov eax, dword [esi + 0x10]
mov dword [ebp - 0x18], eax
mov eax, dword [esi + 0x14]
mov dword [ebp - 0x14], eax
xor eax, eax
mov dword [esi + 0x10], 0
mov dword [esi + 0x14], 7
mov word [esi], ax
mov edx, dword [ebp - 0x8c]
cmp edx, 8
jb 0x408971
mov ecx, dword [ebp - 0xa0]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x408967
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x408967
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push edx
push ecx
call fcn.00487869
add esp, 8
cmp dword [ebp - 0x44], 8
lea eax, [ebp - 0x58]
push 0
cmovae eax, dword [ebp - 0x58]
push eax
call edi
mov eax, dword [ebp - 0x18]
mov edi, dword [ebp - 0x88]
mov dword [ebp - 0xa8], eax
test eax, eax
je 0x408fd1
mov dword [ebp - 0xb0], edi
mov edx, dword [ebp - 0x28]
lea ebx, [ebp - 0x28]
or ecx, 0xffffffff
cmp dword [ebp - 0x14], 8
cmovae ebx, edx
cmp eax, 2
jb 0x408fdf
add eax, 0xfffffffe
cmp eax, ecx
cmovb ecx, eax
lea edi, [ebx + ecx*2]
mov esi, edi
sub esi, 0x49698c
lea ebx, [ebx]
cmp word [edi], 0x26
jne 0x408a83
mov edx, 2
mov eax, 0x49698c
jmp 0x4089f0
mov cx, word [esi + eax]
cmp cx, word [eax]
jne 0x408a83
add eax, 2
sub edx, 1
jne 0x4089f0
sub edi, ebx
sar edi, 1
cmp edi, 0xffffffff
je 0x408fd6
xor eax, eax
mov dword [ebp - 0x2c], 7
mov word [ebp - 0x40], ax
mov eax, dword [ebp - 0xa8]
cmp eax, edi
jb 0x4090f9
sub eax, edi
or ecx, 0xffffffff
cmp eax, ecx
mov esi, ecx
cmovb esi, eax
cmp dword [ebp - 0x14], 8
lea eax, [ebp - 0x28]
mov dword [ebp - 0xb4], esi
cmovae eax, dword [ebp - 0x28]
lea eax, [eax + edi*2]
mov dword [ebp - 0xb8], eax
cmp esi, 7
ja 0x408a96
mov dword [ebp - 0x30], esi
add esi, esi
push esi
push eax
lea eax, [ebp - 0x40]
push eax
call sub.VCRUNTIME140.dll_memmove
add esp, 0xc
xor eax, eax
mov word [ebp + esi - 0x40], ax
mov eax, dword [ebp - 0x40]
mov ebx, dword [ebp - 0x2c]
mov esi, dword [ebp - 0x30]
mov dword [ebp - 0xa8], eax
jmp 0x408af7
cmp edi, ebx
je 0x408fd6
sub edi, 2
sub esi, 2
jmp 0x4089d0
cmp esi, 0x7ffffffe
ja 0x4090f4
mov ebx, esi
or ebx, 7
cmp ebx, 0x7ffffffe
jbe 0x408ab6
mov ebx, 0x7ffffffe
jmp 0x408ac1
cmp ebx, 0xa
mov eax, 0xa
cmovb ebx, eax
lea eax, [ebx + 1]
push eax
lea ecx, [ebp - 0x40]
call fcn.00401c90
add esi, esi
mov dword [ebp - 0xa8], eax
push esi
push dword [ebp - 0xb8]
push eax
call sub.VCRUNTIME140.dll_memcpy
mov ecx, dword [ebp - 0xa8]
add esp, 0xc
xor eax, eax
mov word [ecx + esi], ax
mov esi, dword [ebp - 0xb4]
or dword [ebp - 0xac], 2
mov eax, dword [ebp - 0x5c]
cmp eax, 8
jb 0x408b38
mov ecx, dword [ebp - 0x70]
lea edx, [eax*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x408b2e
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4090ee
push edx
push ecx
call fcn.00487869
add esp, 8
mov eax, dword [ebp - 0xa8]
lea ecx, [ebp - 0x40]
mov dword [ebp - 0x70], eax
mov eax, dword [ebp - 0x3c]
mov dword [ebp - 0x6c], eax
mov eax, dword [ebp - 0x38]
mov dword [ebp - 0x68], eax
mov eax, dword [ebp - 0x34]
mov dword [ebp - 0x64], eax
xor eax, eax
cmp dword [ebp - 0x18], edi
mov word [ebp - 0x40], ax
lea eax, [ebp - 0x28]
cmovb edi, dword [ebp - 0x18]
cmp dword [ebp - 0x14], 8
push edi
cmovae eax, dword [ebp - 0x28]
push eax
mov dword [ebp - 0x60], esi
mov dword [ebp - 0x5c], ebx
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x2c], 7
call fcn.00404550
mov edi, dword [ebp - 0xac]
mov edx, dword [ebp - 0x14]
or edi, 4
cmp edx, 8
jb 0x408bcc
mov ecx, dword [ebp - 0x28]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x408bc2
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4090ee
push edx
push ecx
call fcn.00487869
add esp, 8
mov eax, dword [ebp - 0x40]
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 0x3c]
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x38]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x34]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x30]
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x14], eax
xor eax, eax
mov byte [ebp - 4], 4
mov word [ebp - 0x40], ax
lea ecx, [ebp - 0x40]
mov eax, dword [ebp - 0x48]
or edi, 8
add eax, esi
mov dword [ebp - 0x30], 0
push eax
mov dword [ebp - 0x2c], 7
mov dword [ebp - 0xac], edi
mov dword [ebp - 0xbc], edi
call fcn.00407ff0
cmp dword [ebp - 0x44], 8
lea eax, [ebp - 0x58]
push dword [ebp - 0x48]
cmovae eax, dword [ebp - 0x58]
lea ecx, [ebp - 0x40]
push eax
call fcn.00401cf0
cmp ebx, 8
lea eax, [ebp - 0x70]
push esi
cmovae eax, dword [ebp - 0xa8]
lea ecx, [ebp - 0x40]
push eax
call fcn.00401cf0
lea eax, [ebp - 0x40]
push eax
lea eax, [ebp - 0xa0]
push eax
call fcn.0040cfa0
mov esi, eax
add esp, 8
lea eax, [ebp - 0x88]
cmp eax, esi
je 0x408cf7
mov eax, dword [ebp - 0x74]
cmp eax, 8
jb 0x408cb3
mov edx, dword [ebp - 0xb0]
lea ecx, [eax*2 + 2]
mov eax, edx
cmp ecx, 0x1000
jb 0x408ca9
mov edx, dword [edx - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40877f
push ecx
push edx
call fcn.00487869
add esp, 8
mov eax, dword [esi + 4]
mov edi, dword [esi]
mov dword [ebp - 0x84], eax
mov eax, dword [esi + 8]
mov dword [ebp - 0x80], eax
mov eax, dword [esi + 0xc]
mov dword [ebp - 0x7c], eax
mov eax, dword [esi + 0x10]
mov dword [ebp - 0x78], eax
mov eax, dword [esi + 0x14]
mov dword [ebp - 0x74], eax
xor eax, eax
mov dword [ebp - 0xb0], edi
mov dword [ebp - 0x88], edi
mov dword [esi + 0x10], 0
mov dword [esi + 0x14], 7
mov word [esi], ax
jmp 0x408cfd
mov edi, dword [ebp - 0xb0]
mov edx, dword [ebp - 0x8c]
cmp edx, 8
jb 0x408d3d
mov ecx, dword [ebp - 0xa0]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x408d33
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40877f
push edx
push ecx
call fcn.00487869
add esp, 8
mov ebx, dword [ebp - 0xac]
xor eax, eax
mov edx, dword [ebp - 0x2c]
and ebx, 0xfffffff7
mov dword [ebp - 0x90], 0
mov dword [ebp - 0x8c], 7
mov word [ebp - 0xa0], ax
mov byte [ebp - 4], 3
cmp edx, 8
jb 0x408da1
mov ecx, dword [ebp - 0x40]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x408d97
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40877f
push edx
push ecx
call fcn.00487869
add esp, 8
mov esi, dword [ebp - 0x60]
lea ecx, [ebp - 0x40]
xor eax, eax
mov byte [ebp - 4], 5
mov word [ebp - 0x40], ax
or ebx, 0x10
mov eax, dword [ebp - 0x48]
add eax, esi
mov dword [ebp - 0x30], 0
push eax
mov dword [ebp - 0x2c], 7
mov dword [ebp - 0xbc], ebx
call fcn.00407ff0
cmp dword [ebp - 0x44], 8
lea eax, [ebp - 0x58]
push dword [ebp - 0x48]
cmovae eax, dword [ebp - 0x58]
lea ecx, [ebp - 0x40]
push eax
call fcn.00401cf0
cmp dword [ebp - 0x5c], 8
lea eax, [ebp - 0x70]
push esi
cmovae eax, dword [ebp - 0x70]
lea ecx, [ebp - 0x40]
push eax
call fcn.00401cf0
cmp dword [ebp - 0x2c], 8
lea eax, [ebp - 0x40]
push 0
cmovae eax, dword [ebp - 0x40]
push eax
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
mov edx, dword [ebp - 0x2c]
and ebx, 0xffffffef
mov dword [ebp - 0xac], ebx
mov byte [ebp - 4], 3
cmp edx, 8
jb 0x408e5a
mov ecx, dword [ebp - 0x40]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x408e50
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40877f
push edx
push ecx
call fcn.00487869
add esp, 8
cmp dword [ebp - 0x78], 0
jne 0x408e76
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0xa8], eax
test eax, eax
je 0x408fdc
jmp 0x40899e
mov ecx, dword [ebp - 0xa4]
xor eax, eax
mov dword [ecx + 0x10], 0
mov dword [ecx + 0x14], 7
mov word [ecx], ax
mov eax, dword [ebp - 0x60]
cmp eax, 2
jb 0x4090f9
mov edi, dword [ebp - 0x5c]
add eax, 0xfffffffe
mov ebx, dword [ebp - 0x70]
cmp eax, 0xffffffff
mov edx, 0xffffffff
cmovb edx, eax
cmp edi, 8
lea eax, [ebp - 0x70]
mov dword [ebp - 0xb4], edx
cmovae eax, ebx
add eax, 4
mov dword [ebp - 0xb8], eax
cmp edx, 7
ja 0x408eeb
lea esi, [edx + edx]
mov dword [ecx + 0x10], edx
push esi
push eax
push ecx
call sub.VCRUNTIME140.dll_memmove
mov eax, dword [ebp - 0xa4]
add esp, 0xc
xor ecx, ecx
mov word [esi + eax], cx
jmp 0x408f57
cmp edx, 0x7ffffffe
ja 0x4090f4
mov esi, edx
or esi, 7
cmp esi, 0x7ffffffe
jbe 0x408f0b
mov esi, 0x7ffffffe
jmp 0x408f16
cmp esi, 0xa
mov eax, 0xa
cmovb esi, eax
lea eax, [esi + 1]
push eax
call fcn.00401c90
mov ecx, dword [ebp - 0xb4]
mov edi, eax
mov eax, dword [ebp - 0xa4]
mov dword [eax + 0x14], esi
lea esi, [ecx + ecx]
push esi
push dword [ebp - 0xb8]
mov dword [eax + 0x10], ecx
push edi
call sub.VCRUNTIME140.dll_memcpy
add esp, 0xc
xor eax, eax
mov word [esi + edi], ax
mov eax, dword [ebp - 0xa4]
mov dword [eax], edi
mov edi, dword [ebp - 0x5c]
mov ecx, dword [ebp - 0x74]
cmp ecx, 8
jb 0x408f94
lea edx, [ecx*2 + 2]
mov ecx, dword [ebp - 0xb0]
mov eax, ecx
cmp edx, 0x1000
jb 0x408f8a
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4090ee
push edx
push ecx
call fcn.00487869
add esp, 8
cmp edi, 8
jb 0x4087b2
lea ecx, [edi*2 + 2]
mov eax, ebx
cmp ecx, 0x1000
jb 0x408fc2
mov ebx, dword [ebx - 4]
add ecx, 0x23
sub eax, ebx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4090ee
push ecx
push ebx
call fcn.00487869
add esp, 8
jmp 0x4087b2
mov edx, dword [ebp - 0x28]
jmp 0x408fe2
mov edi, dword [ebp - 0xb0]
mov edx, dword [ebp - 0x28]
mov ebx, dword [ebp - 0x5c]
mov eax, dword [ebp - 0xa4]
xor ecx, ecx
mov dword [eax + 0x10], 0
mov dword [eax + 0x14], 7
mov word [eax], cx
mov ecx, dword [ebp - 0x74]
cmp ecx, 8
jb 0x409035
lea ecx, [ecx*2 + 2]
mov eax, edi
cmp ecx, 0x1000
jb 0x409028
mov edi, dword [edi - 4]
add ecx, 0x23
sub eax, edi
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4090ee
push ecx
push edi
call fcn.00487869
mov edx, dword [ebp - 0x28]
add esp, 8
cmp ebx, 8
jb 0x40906f
mov ecx, dword [ebp - 0x70]
lea edx, [ebx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x409062
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4090ee
push edx
push ecx
call fcn.00487869
mov edx, dword [ebp - 0x28]
add esp, 8
mov eax, dword [ebp - 0x14]
cmp eax, 8
jb 0x4090a2
lea ecx, [eax*2 + 2]
mov eax, edx
cmp ecx, 0x1000
jb 0x409098
mov edx, dword [edx - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4090ee
push ecx
push edx
call fcn.00487869
add esp, 8
mov edx, dword [ebp - 0x44]
xor eax, eax
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 7
mov word [ebp - 0x28], ax
cmp edx, 8
jb 0x40883a
mov ecx, dword [ebp - 0x58]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x408830
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x408830
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
call fcn.00401c70
call fcn.004044e0
int3