Function at 0x407590
Capabilities:
Set environment variable

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x4113c0
mov eax, dword fs:[0]
push eax
sub esp, 0x240
mov eax, dword [0x415008]
xor eax, esp
mov dword [esp + 0x238], eax
push ebx
push esi
push edi
mov eax, dword [0x415008]
xor eax, esp
push eax
lea eax, [esp + 0x250]
mov dword fs:[0], eax
mov bl, cl
movzx eax, bl
push eax
push 0x407948
call fcn.00405d26
xor esi, esi
or edi, 0xffffffff
pop ecx
inc esi
pop ecx
test bl, bl
je 0x40768a
xor ebx, ebx
mov dword [esp + 0x34], ebx
mov dword [esp + 0x38], ebx
mov dword [esp + 0x3c], ebx
mov dword [esp + 0x40], ebx
lea eax, [esp + 0x44]
mov dword [esp + 0x38], 0x200
mov dword [esp + 0x40], eax
mov dword [esp + 0x258], ebx
push 2
pop edx
mov dword [esp + 0x34], edx
mov eax, dword [esp + 0x40]
xor ecx, ecx
mov word [eax], cx
mov dword [esp + 0x258], edx
lea ecx, [esp + 0x34]
call fcn.00405312
lea ecx, [esp + 0x34]
call fcn.0040c698
push dword [esp + 0x40]
push 0x407998
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
cmp eax, esi
je 0x407675
push 0x4079c8
call fcn.00405d26
pop ecx
or dword [esp + 0x258], edi
lea ecx, [esp + 0x34]
call fcn.00402e57
jmp 0x4078f2
mov dword [esp + 0x258], edi
lea ecx, [esp + 0x34]
call fcn.00402e57
jmp 0x4077a4
call fcn.00406ef0
test al, al
je 0x4077a2
push 0x407a74
call fcn.00405d26
xor ebx, ebx
pop ecx
mov dword [esp + 0x30], ebx
call fcn.00407f49
test al, al
je 0x4076ff
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov edi, eax
jmp 0x4076cc
cmp byte [0x415592], bl
jne 0x4076fb
call fcn.00407f49
test al, al
je 0x4076fb
mov esi, dword [0x415578]
test esi, esi
je 0x4076bb
lea eax, [esp + 0x30]
mov ecx, esi
push eax
push edi
call dword [0x416268]
call esi
test eax, eax
je 0x4076ff
cmp dword [esp + 0x30], ebx
je 0x4076ff
mov byte [0x415970], bl
jmp 0x407798
mov eax, ebx
jmp 0x4076e6
mov byte [0x415970], 1
push ebx
push ebx
push 1
push ebx
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov esi, eax
cmp dword [0x415054], ebx
je 0x407732
mov ecx, dword [0x415050]
test ecx, ecx
je 0x40772c
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [0x415054], ebx
or edi, 0xffffffff
mov dword [0x415050], esi
cmp esi, edi
je 0x40774a
xor esi, esi
inc esi
mov dword [0x415054], esi
jmp 0x40774d
xor esi, esi
inc esi
push ebx
push ebx
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov dword [esp + 0x18], eax
cmp dword [0x41503c], ebx
je 0x40777e
mov ecx, dword [0x415038]
test ecx, ecx
je 0x407778
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x18]
mov dword [0x41503c], ebx
mov dword [0x415038], eax
cmp eax, edi
je 0x40778d
mov dword [0x41503c], esi
push 0x407aa4
call fcn.00405d26
pop ecx
call fcn.00406ce6
jmp 0x4078f2
xor ebx, ebx
push ebx
push esi
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], ebx
cmp eax, edi
je 0x4077be
mov dword [esp + 0x1c], esi
mov dword [esp + 0x258], 7
mov edx, 0x404638
mov dword [esp + 0x14], ebx
mov dword [esp + 0x28], edx
mov dword [esp + 0x2c], edi
mov byte [esp + 0x258], 8
mov ecx, 0x407c30
mov dword [esp + 0x28], ecx
mov byte [esp + 0x258], 9
mov dword [esp + 0x20], edx
mov dword [esp + 0x24], edi
mov byte [esp + 0x258], 0xa
mov dword [esp + 0x20], ecx
mov byte [esp + 0x258], 0xb
lea ecx, [esp + 0x14]
push ecx
push eax
push 0x407ad8
lea ecx, [esp + 0x34]
call fcn.0040d710
test eax, eax
js 0x40787e
cmp dword [esp + 0x14], 0
jne 0x40787e
mov esi, dword [esp + 0x18]
lea eax, [esp + 0x14]
push eax
push esi
push 0x407918
lea ecx, [esp + 0x2c]
call fcn.0040d710
test eax, eax
js 0x407872
cmp dword [esp + 0x14], 0
jne 0x407872
call fcn.0040705a
test al, al
jne 0x40788d
push 0x407bfc
call fcn.00405d26
pop ecx
mov byte [0x415970], bl
call fcn.00406ce6
jmp 0x40788d
push 0x407b80
call fcn.00405d26
jmp 0x40788c
push 0x407b00
call fcn.00405d26
mov esi, dword [esp + 0x1c]
pop ecx
mov byte [esp + 0x258], 9
mov dword [esp + 0x20], 0x404638
cmp dword [esp + 0x24], edi
je 0x4078b1
push dword [esp + 0x24]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esp + 0x24], edi
mov byte [esp + 0x258], 7
mov dword [esp + 0x28], 0x404638
cmp dword [esp + 0x2c], edi
je 0x4078d5
push dword [esp + 0x2c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esp + 0x2c], edi
mov dword [esp + 0x258], edi
cmp dword [esp + 0x1c], 0
je 0x4078f2
test esi, esi
je 0x4078ee
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esp + 0x1c], ebx
mov ecx, dword [esp + 0x250]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x238]
xor ecx, esp
call fcn.00401f60
mov esp, ebp
pop ebp
ret