Function at 0x4082e0
Capabilities:
Set environment variable

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x49bc63
mov eax, dword fs:[0]
push eax
sub esp, 0xa8
mov eax, dword [0x4ce4bc]
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 - 0xa8], eax
xor eax, eax
mov dword [ebp - 0x58], 0
mov dword [ebp - 0x48], 0
mov dword [ebp - 0x44], 7
mov word [ebp - 0x58], ax
mov dword [ebp - 0x28], eax
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 - 0x70], eax
mov dword [ebp - 0x60], eax
mov dword [ebp - 0x5c], ebx
mov word [ebp - 0x70], ax
mov dword [ebp - 0x88], eax
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.00404580
lea eax, [ebp - 0x58]
push eax
lea eax, [ebp - 0xa0]
push eax
call fcn.0040cbc0
mov esi, eax
add esp, 8
lea eax, [ebp - 0x28]
cmp eax, esi
je 0x408428
mov edx, dword [ebp - 0x14]
cmp edx, 8
jb 0x4083de
mov ecx, dword [ebp - 0x28]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x4083d4
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40845a
push edx
push ecx
call fcn.0049927f
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 0x40846a
mov ecx, dword [ebp - 0xa0]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x408460
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x408460
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push edx
push ecx
call fcn.0049927f
add esp, 8
cmp dword [ebp - 0x18], 0
jne 0x408524
mov eax, dword [ebp - 0xa8]
xor ecx, ecx
mov edx, dword [ebp - 0x14]
mov dword [eax], 0
mov dword [eax + 0x10], 0
mov dword [eax + 0x14], 7
mov word [eax], cx
cmp edx, 8
jb 0x4084cd
mov ecx, dword [ebp - 0x28]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x4084c3
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x408cbf
push edx
push ecx
call fcn.0049927f
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 0x408d55
mov ecx, dword [ebp - 0x58]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x408515
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x408cbf
push edx
push ecx
call fcn.0049927f
add esp, 8
jmp 0x408d55
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.00401cd0
lea eax, [ebp - 0x58]
push eax
lea eax, [ebp - 0xa0]
push eax
call fcn.0040cbc0
mov esi, eax
add esp, 8
lea eax, [ebp - 0x28]
cmp eax, esi
je 0x4085f5
mov edx, dword [ebp - 0x14]
cmp edx, 8
jb 0x4085ab
mov ecx, dword [ebp - 0x28]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x4085a1
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x408627
push edx
push ecx
call fcn.0049927f
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 0x408637
mov ecx, dword [ebp - 0xa0]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40862d
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x40862d
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push edx
push ecx
call fcn.0049927f
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 - 0xb0], eax
test eax, eax
je 0x408cce
mov dword [ebp - 0xac], edi
or ecx, 0xffffffff
lea ebx, [ebp - 0x28]
cmp dword [ebp - 0x14], 8
cmovae ebx, dword [ebp - 0x28]
mov dword [ebp - 0xa4], ebx
cmp eax, 2
jb 0x408ccb
add eax, 0xfffffffe
cmp eax, ecx
cmovb ecx, eax
mov eax, dword [ebp - 0xa4]
lea ebx, [ebx + ecx*2]
mov edi, ebx
sub edi, 0x4a9a2c
lea ebx, [ebx]
cmp word [ebx], 0x26
jne 0x4086d8
mov ecx, 0x26
mov esi, 2
mov edx, ecx
mov eax, 0x4a9a2c
cmp cx, dx
ja 0x4086d2
cmp esi, 1
je 0x4086e8
movzx ecx, word [edi + eax + 2]
add eax, 2
dec esi
movzx edx, word [eax]
cmp cx, dx
jae 0x4086ba
mov eax, dword [ebp - 0xa4]
cmp ebx, eax
je 0x408cc5
sub ebx, 2
sub edi, 2
jmp 0x4086a0
sub ebx, dword [ebp - 0xa4]
sar ebx, 1
cmp ebx, 0xffffffff
je 0x408cc5
mov eax, dword [ebp - 0xb0]
mov dword [ebp - 0x40], 0
mov dword [ebp - 0x2c], 7
cmp eax, ebx
jb 0x408d7e
sub eax, ebx
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 + ebx*2]
mov dword [ebp - 0xb0], eax
cmp esi, 7
ja 0x40876b
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 edi, dword [ebp - 0x2c]
mov esi, dword [ebp - 0x30]
mov dword [ebp - 0xa4], eax
jmp 0x4087cc
cmp esi, 0x7ffffffe
ja 0x408d79
mov edi, esi
or edi, 7
cmp edi, 0x7ffffffe
jbe 0x40878b
mov edi, 0x7ffffffe
jmp 0x408796
cmp edi, 0xa
mov eax, 0xa
cmovb edi, eax
lea eax, [edi + 1]
push eax
lea ecx, [ebp - 0x40]
call fcn.00401c70
add esi, esi
mov dword [ebp - 0xa4], eax
push esi
push dword [ebp - 0xb0]
push eax
call sub.VCRUNTIME140.dll_memcpy
mov eax, dword [ebp - 0xa4]
add esp, 0xc
xor ecx, ecx
mov word [eax + esi], cx
mov esi, dword [ebp - 0xb4]
mov eax, dword [ebp - 0x5c]
cmp eax, 8
jb 0x408806
mov ecx, dword [ebp - 0x70]
lea edx, [eax*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x4087fc
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x408cbf
push edx
push ecx
call fcn.0049927f
add esp, 8
mov eax, dword [ebp - 0xa4]
lea ecx, [ebp - 0x40]
cmp dword [ebp - 0x18], ebx
mov dword [ebp - 0x70], eax
mov eax, dword [ebp - 0x3c]
cmovb ebx, dword [ebp - 0x18]
cmp dword [ebp - 0x14], 8
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
lea eax, [ebp - 0x28]
cmovae eax, dword [ebp - 0x28]
push ebx
push eax
mov dword [ebp - 0x60], esi
mov dword [ebp - 0x5c], edi
mov dword [ebp - 0x40], 0
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x2c], 7
call fcn.00404580
mov edx, dword [ebp - 0x14]
cmp edx, 8
jb 0x408892
mov ecx, dword [ebp - 0x28]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x408888
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x408cbf
push edx
push ecx
call fcn.0049927f
add esp, 8
mov eax, dword [ebp - 0x40]
mov edx, dword [ebp - 0x48]
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
mov eax, 0x7ffffffe
sub eax, edx
cmp eax, esi
jb 0x408d79
cmp dword [ebp - 0x44], 8
lea ecx, [ebp - 0x58]
push esi
cmovae ecx, dword [ebp - 0x58]
lea eax, [ebp - 0x70]
cmp edi, 8
cmovae eax, dword [ebp - 0xa4]
push eax
push edx
push ecx
lea eax, [ebp - 0x58]
push eax
push dword [ebp - 0xb4]
lea ecx, [ebp - 0xa0]
call fcn.004080e0
lea eax, [ebp - 0xa0]
mov byte [ebp - 4], 4
push eax
lea eax, [ebp - 0x40]
push eax
call fcn.0040cbc0
mov esi, eax
add esp, 8
lea eax, [ebp - 0x88]
cmp eax, esi
je 0x4089a1
mov eax, dword [ebp - 0x74]
cmp eax, 8
jb 0x40895d
mov edx, dword [ebp - 0xac]
lea ecx, [eax*2 + 2]
mov eax, edx
cmp ecx, 0x1000
jb 0x408953
mov edx, dword [edx - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40845a
push ecx
push edx
call fcn.0049927f
add esp, 8
mov eax, dword [esi + 4]
mov edi, dword [esi]
mov ebx, dword [esi + 0x10]
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 + 0x14]
mov dword [ebp - 0x74], eax
xor eax, eax
mov dword [ebp - 0xac], edi
mov dword [ebp - 0x88], edi
mov dword [ebp - 0x78], ebx
mov dword [esi + 0x10], 0
mov dword [esi + 0x14], 7
mov word [esi], ax
jmp 0x4089aa
mov edi, dword [ebp - 0xac]
mov ebx, dword [ebp - 0x78]
mov edx, dword [ebp - 0x2c]
cmp edx, 8
jb 0x4089e4
mov ecx, dword [ebp - 0x40]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x4089da
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40845a
push edx
push ecx
call fcn.0049927f
add esp, 8
mov edx, dword [ebp - 0x8c]
xor eax, eax
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x2c], 7
mov word [ebp - 0x40], ax
mov byte [ebp - 4], 3
cmp edx, 8
jb 0x408a3c
mov ecx, dword [ebp - 0xa0]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x408a32
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40845a
push edx
push ecx
call fcn.0049927f
add esp, 8
mov edx, dword [ebp - 0x48]
mov eax, 0x7ffffffe
mov esi, dword [ebp - 0x60]
sub eax, edx
cmp eax, esi
jb 0x408d79
cmp dword [ebp - 0x44], 8
lea ecx, [ebp - 0x58]
push esi
cmovae ecx, dword [ebp - 0x58]
lea eax, [ebp - 0x70]
cmp dword [ebp - 0x5c], 8
cmovae eax, dword [ebp - 0x70]
push eax
push edx
push ecx
lea eax, [ebp - 0x58]
push eax
push dword [ebp - 0xb4]
lea ecx, [ebp - 0x40]
call fcn.004080e0
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]
cmp edx, 8
jb 0x408acb
mov ecx, dword [ebp - 0x40]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x408ac1
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40845a
push edx
push ecx
call fcn.0049927f
add esp, 8
test ebx, ebx
jne 0x408ae5
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0xb0], eax
test eax, eax
je 0x408ccb
jmp 0x408664
mov ecx, dword [ebp - 0xa8]
xor eax, eax
mov dword [ecx], 0
mov dword [ecx + 0x10], 0
mov dword [ecx + 0x14], 7
mov word [ecx], ax
mov eax, dword [ebp - 0x60]
cmp eax, 2
jb 0x408d7e
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 - 0xb0], eax
cmp edx, 7
ja 0x408b60
lea esi, [edx + edx]
mov dword [ecx + 0x10], edx
push esi
push eax
push ecx
call sub.VCRUNTIME140.dll_memmove
mov eax, dword [ebp - 0xa8]
add esp, 0xc
xor ecx, ecx
mov word [esi + eax], cx
jmp 0x408bcc
cmp edx, 0x7ffffffe
ja 0x408d79
mov esi, edx
or esi, 7
cmp esi, 0x7ffffffe
jbe 0x408b80
mov esi, 0x7ffffffe
jmp 0x408b8b
cmp esi, 0xa
mov eax, 0xa
cmovb esi, eax
lea eax, [esi + 1]
push eax
call fcn.00401c70
mov ecx, dword [ebp - 0xb4]
mov edi, eax
mov eax, dword [ebp - 0xa8]
mov dword [eax + 0x14], esi
lea esi, [ecx + ecx]
push esi
push dword [ebp - 0xb0]
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 - 0xa8]
mov dword [eax], edi
mov edi, dword [ebp - 0x5c]
mov eax, dword [ebp - 0x74]
cmp eax, 8
jb 0x408c09
mov edx, dword [ebp - 0xac]
lea ecx, [eax*2 + 2]
mov eax, edx
cmp ecx, 0x1000
jb 0x408bff
mov edx, dword [edx - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x408cbf
push ecx
push edx
call fcn.0049927f
add esp, 8
cmp edi, 8
jb 0x408c3d
lea ecx, [edi*2 + 2]
mov eax, ebx
cmp ecx, 0x1000
jb 0x408c33
mov ebx, dword [ebx - 4]
add ecx, 0x23
sub eax, ebx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x408cbf
push ecx
push ebx
call fcn.0049927f
add esp, 8
mov edx, dword [ebp - 0x14]
cmp edx, 8
jb 0x408c73
mov ecx, dword [ebp - 0x28]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x408c69
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x408cbf
push edx
push ecx
call fcn.0049927f
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 0x408d55
mov ecx, dword [ebp - 0x58]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x408515
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x408515
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
mov edi, dword [ebp - 0xac]
mov ebx, dword [ebp - 0x5c]
mov eax, dword [ebp - 0xa8]
xor ecx, ecx
mov dword [eax], 0
mov dword [eax + 0x10], 0
mov dword [eax + 0x14], 7
mov word [eax], cx
mov eax, dword [ebp - 0x74]
cmp eax, 8
jb 0x408d03
inc eax
lea ecx, [ebp - 0x88]
push eax
push edi
call fcn.004046f0
cmp ebx, 8
jb 0x408d17
lea eax, [ebx + 1]
push eax
push dword [ebp - 0x70]
lea ecx, [ebp - 0x70]
call fcn.004046f0
mov eax, dword [ebp - 0x14]
cmp eax, 8
jb 0x408d2c
inc eax
lea ecx, [ebp - 0x28]
push eax
push dword [ebp - 0x28]
call fcn.004046f0
mov ecx, dword [ebp - 0x44]
xor eax, eax
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 7
mov word [ebp - 0x28], ax
cmp ecx, 8
jb 0x408d55
inc ecx
push ecx
push dword [ebp - 0x58]
lea ecx, [ebp - 0x58]
call fcn.004046f0
mov eax, dword [ebp - 0xa8]
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.0049928d
mov esp, ebp
pop ebp
ret 4
call fcn.00401c50
call fcn.00404510
int3