Function at 0x40d536
Capabilities:
Set environment variable

Disassembly:
push 0x234
mov eax, 0x416cbc
call fcn.00415da4
mov bl, cl
movzx eax, bl
push eax
push 0x402268
call fcn.0040c66c
xor esi, esi
or edi, 0xffffffff
pop ecx
inc esi
pop ecx
test bl, bl
je 0x40d60b
xor ebx, ebx
mov dword [ebp - 0x220], ebx
mov dword [ebp - 0x21c], ebx
mov dword [ebp - 0x218], ebx
mov dword [ebp - 0x214], ebx
lea eax, [ebp - 0x210]
mov dword [ebp - 0x21c], 0x200
mov dword [ebp - 0x214], eax
mov dword [ebp - 4], ebx
push 2
pop edx
mov dword [ebp - 0x220], edx
mov eax, dword [ebp - 0x214]
xor ecx, ecx
mov word [eax], cx
mov dword [ebp - 4], edx
lea ecx, [ebp - 0x220]
call fcn.0040ac21
lea ecx, [ebp - 0x220]
call fcn.00410e2d
push dword [ebp - 0x214]
push 0x4022b8
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
cmp eax, esi
je 0x40d5f8
push 0x4022e8
call fcn.0040c66c
pop ecx
or dword [ebp - 4], edi
lea ecx, [ebp - 0x220]
call fcn.0040a5fa
jmp 0x40d895
mov dword [ebp - 4], edi
lea ecx, [ebp - 0x220]
call fcn.0040a5fa
jmp 0x40d72f
call fcn.0040d0dd
test al, al
je 0x40d72d
push 0x402394
call fcn.0040c66c
xor ebx, ebx
pop ecx
mov dword [ebp - 0x240], ebx
call fcn.0040df04
test al, al
je 0x40d686
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov edi, eax
jmp 0x40d64f
cmp byte [0x41a56e], bl
jne 0x40d682
call fcn.0040df04
test al, al
je 0x40d682
mov esi, dword [0x41a564]
test esi, esi
je 0x40d63e
lea eax, [ebp - 0x240]
mov ecx, esi
push eax
push edi
call dword [0x41b25c]
call esi
test eax, eax
je 0x40d686
cmp dword [ebp - 0x240], ebx
je 0x40d686
mov byte [0x41a9a0], bl
jmp 0x40d723
mov eax, ebx
jmp 0x40d66b
mov byte [0x41a9a0], 1
push ebx
push ebx
push 1
push ebx
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov esi, eax
cmp dword [0x41a068], ebx
je 0x40d6b9
mov ecx, dword [0x41a064]
test ecx, ecx
je 0x40d6b3
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [0x41a068], ebx
or edi, 0xffffffff
mov dword [0x41a064], esi
cmp esi, edi
je 0x40d6d1
xor esi, esi
inc esi
mov dword [0x41a068], esi
jmp 0x40d6d4
xor esi, esi
inc esi
push ebx
push ebx
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov dword [ebp - 0x228], eax
cmp dword [0x41a078], ebx
je 0x40d709
mov ecx, dword [0x41a074]
test ecx, ecx
je 0x40d703
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x228]
mov dword [0x41a078], ebx
mov dword [0x41a074], eax
cmp eax, edi
je 0x40d718
mov dword [0x41a078], esi
push 0x4023c4
call fcn.0040c66c
pop ecx
call fcn.0040d016
jmp 0x40d895
xor ebx, ebx
push ebx
push esi
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov dword [ebp - 0x22c], eax
mov dword [ebp - 0x228], ebx
cmp eax, edi
je 0x40d74f
mov dword [ebp - 0x228], esi
mov dword [ebp - 4], 7
mov edx, 0x4026d4
mov dword [ebp - 0x224], ebx
mov dword [ebp - 0x23c], edx
mov dword [ebp - 0x238], edi
mov byte [ebp - 4], 8
mov ecx, 0x4025b0
mov dword [ebp - 0x23c], ecx
mov byte [ebp - 4], 9
mov dword [ebp - 0x234], edx
mov dword [ebp - 0x230], edi
mov byte [ebp - 4], 0xa
mov dword [ebp - 0x234], ecx
mov byte [ebp - 4], 0xb
lea ecx, [ebp - 0x224]
push ecx
push eax
push 0x4023f8
lea ecx, [ebp - 0x23c]
call fcn.0040ebc0
test eax, eax
js 0x40d817
cmp dword [ebp - 0x224], 0
jne 0x40d817
mov esi, dword [ebp - 0x22c]
lea eax, [ebp - 0x224]
push eax
push esi
push 0x401538
lea ecx, [ebp - 0x234]
call fcn.0040ebc0
test eax, eax
js 0x40d80b
cmp dword [ebp - 0x224], 0
jne 0x40d80b
call fcn.0040d1b0
test al, al
jne 0x40d828
push 0x40251c
call fcn.0040c66c
pop ecx
mov byte [0x41a9a0], bl
call fcn.0040d016
jmp 0x40d828
push 0x4024a0
call fcn.0040c66c
jmp 0x40d827
push 0x402420
call fcn.0040c66c
mov esi, dword [ebp - 0x22c]
pop ecx
mov byte [ebp - 4], 9
mov dword [ebp - fcn.0040eb30], 0x4026d4
cmp dword [ebp - 0x230], edi
je 0x40d850
push dword [ebp - 0x230]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 0x230], edi
mov byte [ebp - 4], 7
mov dword [ebp - fcn.0040eb30], 0x4026d4
cmp dword [ebp - 0x238], edi
je 0x40d878
push dword [ebp - 0x238]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 0x238], edi
mov dword [ebp - 4], edi
cmp dword [ebp - 0x228], 0
je 0x40d895
test esi, esi
je 0x40d88f
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 0x228], ebx
call fcn.00415d4e
ret