Function at 0x407080
Capabilities:
Set environment variable

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x410686
mov eax, dword fs:[0]
push eax
sub esp, 0x238
mov eax, dword [0x41400c]
xor eax, esp
mov dword [esp + 0x230], eax
push ebx
push esi
push edi
mov eax, dword [0x41400c]
xor eax, esp
push eax
lea eax, [esp + 0x248]
mov dword fs:[0], eax
mov bl, cl
movzx eax, bl
push eax
push 0x407440
call fcn.0040585e
xor esi, esi
pop ecx
inc esi
or edi, 0xffffffff
pop ecx
test bl, bl
je 0x407190
xor ebx, ebx
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x30], ebx
mov dword [esp + 0x34], ebx
mov dword [esp + 0x38], ebx
lea eax, [esp + 0x3c]
mov dword [esp + 0x38], eax
mov dword [esp + 0x30], 0x200
mov dword [esp + 0x250], ebx
push 2
pop edx
mov dword [esp + 0x2c], edx
mov eax, dword [esp + 0x38]
xor ecx, ecx
mov word [eax], cx
mov dword [esp + 0x250], edx
lea ecx, [esp + 0x2c]
call fcn.00404e9b
lea ecx, [esp + 0x2c]
call fcn.0040bb9a
push dword [esp + 0x38]
push 0x407490
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
cmp eax, esi
je 0x407170
push 0x4074c0
call fcn.0040585e
pop ecx
or dword [esp + 0x250], edi
test byte [esp + 0x34], 8
je 0x4073f0
mov ecx, dword [esp + 0x38]
call fcn.004010b8
jmp 0x4073f0
mov dword [esp + 0x250], edi
test byte [esp + 0x34], 8
je 0x4072a2
mov ecx, dword [esp + 0x38]
call fcn.004010b8
jmp 0x4072a2
call fcn.004069e8
test al, al
je 0x4072a0
push 0x40756c
call fcn.0040585e
xor ebx, ebx
pop ecx
mov dword [esp + 0x10], ebx
call fcn.00407a65
test al, al
je 0x4071fd
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov esi, eax
jmp 0x4071d2
cmp byte [0x4145ba], bl
jne 0x4071f9
call fcn.00407a65
test al, al
je 0x4071f9
mov ecx, dword [0x4145a0]
test ecx, ecx
je 0x4071c1
lea eax, [esp + 0x10]
push eax
push esi
call ecx
test eax, eax
je 0x4071fd
cmp dword [esp + 0x10], ebx
je 0x4071fd
mov byte [0x414988], bl
jmp 0x407296
mov eax, ebx
jmp 0x4071e4
mov byte [0x414988], 1
push ebx
push ebx
push 1
push ebx
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov esi, eax
cmp dword [0x41403c], ebx
je 0x407230
mov ecx, dword [0x414038]
test ecx, ecx
je 0x40722a
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [0x41403c], ebx
or edi, 0xffffffff
mov dword [0x414038], esi
cmp esi, edi
je 0x407248
xor esi, esi
inc esi
mov dword [0x41403c], esi
jmp 0x40724b
xor esi, esi
inc esi
push ebx
push ebx
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov dword [esp + 0x14], eax
cmp dword [0x414024], ebx
je 0x40727c
mov ecx, dword [0x414020]
test ecx, ecx
je 0x407276
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x14]
mov dword [0x414024], ebx
mov dword [0x414020], eax
cmp eax, edi
je 0x40728b
mov dword [0x414024], esi
push 0x40759c
call fcn.0040585e
pop ecx
call fcn.004067f2
jmp 0x4073f0
xor ebx, ebx
push ebx
push esi
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], ebx
cmp eax, edi
je 0x4072bc
mov dword [esp + 0x28], esi
mov dword [esp + 0x250], 9
mov edx, 0x404144
mov dword [esp + 0x10], ebx
mov dword [esp + 0x1c], edx
mov dword [esp + 0x20], edi
mov byte [esp + 0x250], 0xa
mov ecx, 0x407728
mov dword [esp + 0x1c], ecx
mov byte [esp + 0x250], 0xb
mov dword [esp + 0x14], edx
mov dword [esp + 0x18], edi
mov byte [esp + 0x250], 0xc
mov dword [esp + 0x14], ecx
mov byte [esp + 0x250], 0xd
lea ecx, [esp + 0x10]
push ecx
push eax
push 0x4075d0
lea ecx, [esp + 0x28]
call fcn.0040ccae
test eax, eax
js 0x40737c
cmp dword [esp + 0x10], 0
jne 0x40737c
mov esi, dword [esp + 0x24]
lea eax, [esp + 0x10]
push eax
push esi
push 0x407414
lea ecx, [esp + 0x20]
call fcn.0040ccae
test eax, eax
js 0x407370
cmp dword [esp + 0x10], 0
jne 0x407370
call fcn.00406b5a
test al, al
jne 0x40738b
push 0x4076f4
call fcn.0040585e
pop ecx
mov byte [0x414988], bl
call fcn.004067f2
jmp 0x40738b
push 0x407678
call fcn.0040585e
jmp 0x40738a
push 0x4075f8
call fcn.0040585e
mov esi, dword [esp + 0x28]
pop ecx
mov byte [esp + 0x250], 0xb
mov dword [esp + 0x14], 0x404144
cmp dword [esp + 0x18], edi
je 0x4073af
push dword [esp + 0x18]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esp + 0x18], edi
mov byte [esp + 0x250], 9
mov dword [esp + 0x1c], 0x404144
cmp dword [esp + 0x20], edi
je 0x4073d3
push dword [esp + 0x20]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esp + 0x20], edi
mov dword [esp + 0x250], edi
cmp dword [esp + 0x28], 0
je 0x4073f0
test esi, esi
je 0x4073ec
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esp + 0x28], ebx
mov ecx, dword [esp + 0x248]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x230]
xor ecx, esp
call fcn.004010aa
mov esp, ebp
pop ebp
ret