Function at 0x40ae40
Capabilities:
Encode data using xor
Query environment variable

Disassembly:
push ebp
lea ebp, [esp - 0x78]
sub esp, 0x78
push 0xffffffffffffffff
push 0x460504
mov eax, dword fs:[0]
push eax
sub esp, 0x10
mov eax, dword [0x4780bc]
xor eax, ebp
mov dword [ebp + 0x74], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov edi, ecx
mov dword [ebp - 0x18], edi
lea eax, [edi + 0x18]
cmp eax, 0x478890
je 0x40ae99
cmp dword [eax + 0x14], 0x10
mov ecx, dword [eax + 0x10]
jb 0x40ae8d
mov eax, dword [eax]
push ecx
push eax
mov ecx, 0x478890
call fcn.004038d0
cmp dword [0x478874], 0
mov dword [ebp - 4], 0
jne 0x40b570
mov dword [ebp], 0
mov dword [ebp + 0x10], 0
mov dword [ebp + 0x14], 0xf
mov byte [ebp], 0
push 4
mov byte [ebp - 4], 1
call fcn.0045e3f0
add esp, 4
mov dword [ebp + 0x60], eax
mov byte [ebp - 4], 2
test eax, eax
je 0x40aee6
mov ecx, eax
call fcn.00411aa0
mov byte [ebp - 4], 1
call fcn.004083e0
push 0
push 0x462c8f
mov ecx, 0x478788
mov byte [0x478784], 0
call fcn.004038d0
mov esi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
push 0x1024
call esi
push 0x1024
push 0
push eax
mov dword [0x478854], eax
call sub.VCRUNTIME140.dll_memset
add esp, 0x10
lea eax, [ebp + 0x40]
lea ecx, [ebp - 0x11]
push 0x20
push eax
call fcn.00414e10
mov ecx, eax
cmp dword [ecx + 0x14], 0x10
jb 0x40af41
mov ecx, dword [ecx]
mov edx, dword [0x478854]
mov al, byte [ecx]
lea ecx, [ecx + 1]
mov byte [edx], al
lea edx, [edx + 1]
test al, al
jne 0x40af47
mov ecx, dword [ebp + 0x54]
cmp ecx, 0x10
jb 0x40af8b
mov edx, dword [ebp + 0x40]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40af81
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x40af81
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push ecx
push edx
call fcn.0045e420
add esp, 8
push 0x1024
call esi
push 0x1024
mov ebx, eax
push 0
push ebx
call sub.VCRUNTIME140.dll_memset
add esp, 0x10
mov dword [ebp + 0x6c], 0xdbc5d3ce
mov dword [ebp + 0x70], 0x100d1c5
xor ecx, ecx
mov al, cl
sub al, 0x51
xor byte [ebp + ecx + 0x6c], al
inc ecx
cmp ecx, 6
jb 0x40afb4
lea eax, [ebp - 0x12]
mov byte [ebp + 0x73], 0
push eax
lea eax, [ebp + 0x72]
push eax
lea eax, [ebp + 0x6c]
push eax
lea ecx, [ebp + 0x40]
call fcn.004063e0
lea eax, [ebp + 0x40]
mov byte [ebp - 4], 3
push eax
lea eax, [ebp + 0x18]
push eax
call fcn.00412df0
add esp, 8
mov edx, eax
cmp dword [edx + 0x14], 0x10
mov byte [ebp - 4], 4
jb 0x40affc
mov edx, dword [edx]
mov dword [ebp + 0x5c], 0xdbc5d3ce
xor ecx, ecx
mov dword [ebp + 0x60], 0x100dadc
nop dword [eax]
mov al, cl
sub al, 0x51
xor byte [ebp + ecx + 0x5c], al
inc ecx
cmp ecx, 6
jb 0x40b010
push edx
lea eax, [ebp + 0x5c]
mov byte [ebp + 0x63], 0
push eax
lea ecx, [ebp]
call fcn.00410c50
mov ecx, dword [ebp + 0x2c]
mov byte [ebp - 4], 3
cmp ecx, 0x10
jb 0x40b063
mov edx, dword [ebp + 0x18]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40b059
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40b09f
push ecx
push edx
call fcn.0045e420
add esp, 8
mov ecx, dword [ebp + 0x54]
mov dword [ebp + 0x28], 0
mov dword [ebp + 0x2c], 0xf
mov byte [ebp + 0x18], 0
mov byte [ebp - 4], 1
cmp ecx, 0x10
jb 0x40b0af
mov edx, dword [ebp + 0x40]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40b0a5
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x40b0a5
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push ecx
push edx
call fcn.0045e420
add esp, 8
sub esp, 0x18
lea eax, [edi + 0x48]
mov ecx, esp
push eax
call fcn.00402850
lea eax, [ebp + 0x40]
push eax
lea ecx, [ebp - 0x11]
call fcn.00414a80
mov edx, eax
cmp dword [edx + 0x14], 0x10
mov byte [ebp - 4], 5
jb 0x40b0d7
mov edx, dword [edx]
mov dword [ebp + 0x64], 0xdec1c0ce
xor ecx, ecx
mov dword [ebp + 0x68], 0xc2d4d7da
mov dword [ebp + 0x6c], 0xe5d7d7de
mov dword [ebp + 0x70], 0x100d8d2
mov al, cl
sub al, 0x51
xor byte [ebp + ecx + 0x64], al
inc ecx
cmp ecx, 0xe
jb 0x40b0f5
push edx
lea eax, [ebp + 0x64]
mov byte [ebp + 0x73], 0
push eax
lea ecx, [ebp]
call fcn.00410c50
mov ecx, dword [ebp + 0x54]
mov byte [ebp - 4], 1
cmp ecx, 0x10
jb 0x40b14e
mov edx, dword [ebp + 0x40]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40b144
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x40b144
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push ecx
push edx
call fcn.0045e420
add esp, 8
sub esp, 0x18
mov ecx, esp
push 0x4787c4
call fcn.00402850
lea eax, [ebp + 0x40]
push eax
lea ecx, [ebp - 0x11]
call fcn.00414a80
mov edx, eax
cmp dword [edx + 0x14], 0x10
mov byte [ebp - 4], 6
jb 0x40b177
mov edx, dword [edx]
mov dword [ebp + 0x6c], 0xc2c6d8c2
xor ecx, ecx
mov word [ebp + 0x70], 0xd7
mov byte [ebp + 0x72], 1
nop word [eax + eax]
mov al, cl
sub al, 0x51
xor byte [ebp + ecx + 0x6c], al
inc ecx
cmp ecx, 5
jb 0x40b190
push edx
lea eax, [ebp + 0x6c]
mov byte [ebp + 0x72], 0
push eax
lea ecx, [ebp]
call fcn.00410c50
mov ecx, dword [ebp + 0x54]
mov byte [ebp - 4], 1
cmp ecx, 0x10
jb 0x40b1e9
mov edx, dword [ebp + 0x40]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40b1df
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x40b1df
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push ecx
push edx
call fcn.0045e420
add esp, 8
mov dword [ebp + 0x68], 0xc0d4c3da
xor ecx, ecx
mov dword [ebp + 0x6c], 0xd3d8d5dd
mov word [ebp + 0x70], 0x100
nop
mov al, cl
sub al, 0x51
xor byte [ebp + ecx + 0x68], al
inc ecx
cmp ecx, 8
jb 0x40b200
lea eax, [ebp + 0x68]
mov byte [ebp + 0x71], 0
push eax
call dword [sym.imp.api_ms_win_crt_environment_l1_1_0.dll_getenv]
mov edx, eax
mov dword [ebp + 0x18], 0
mov ecx, edx
mov dword [ebp + 0x28], 0
add esp, 4
mov dword [ebp + 0x2c], 0
lea esi, [ecx + 1]
nop dword [eax + eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40b240
sub ecx, esi
push ecx
push edx
lea ecx, [ebp + 0x18]
call fcn.004025b0
sub esp, 0x18
mov byte [ebp - 4], 7
lea eax, [ebp + 0x18]
mov ecx, esp
push eax
call fcn.00402850
lea eax, [ebp + 0x40]
push eax
lea ecx, [ebp - 0x11]
call fcn.00414a80
mov edx, eax
cmp dword [edx + 0x14], 0x10
mov byte [ebp - 4], 8
jb 0x40b27f
mov edx, dword [edx]
mov dword [ebp + 0x68], 0xd3c8dfdd
xor ecx, ecx
mov dword [ebp + 0x6c], 0xc5c0ebdf
mov dword [ebp + 0x70], 0x100cad2
mov al, cl
sub al, 0x51
xor byte [ebp + ecx + 0x68], al
inc ecx
cmp ecx, 0xa
jb 0x40b296
push edx
lea eax, [ebp + 0x68]
mov byte [ebp + 0x73], 0
push eax
lea ecx, [ebp]
call fcn.00410c50
mov ecx, dword [ebp + 0x54]
mov byte [ebp - 4], 7
cmp ecx, 0x10
jb 0x40b2ef
mov edx, dword [ebp + 0x40]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40b2e5
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x40b2e5
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push ecx
push edx
call fcn.0045e420
add esp, 8
mov ecx, dword [ebp + 0x2c]
mov byte [ebp - 4], 1
cmp ecx, 0x10
jb 0x40b329
mov edx, dword [ebp + 0x18]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40b31f
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x40b31f
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push ecx
push edx
call fcn.0045e420
add esp, 8
mov edx, dword [0x478854]
mov ecx, edx
mov dword [ebp + 0x18], 0
mov dword [ebp + 0x28], 0
mov dword [ebp + 0x2c], 0
lea esi, [ecx + 1]
nop dword [eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40b350
sub ecx, esi
push ecx
push edx
lea ecx, [ebp + 0x18]
call fcn.004025b0
lea eax, [ebp + 0x18]
mov byte [ebp - 4], 9
push eax
lea eax, [ebp + 0x40]
push eax
call fcn.00412df0
add esp, 8
mov edx, eax
cmp dword [edx + 0x14], 0x10
mov byte [ebp - 4], 0xa
jb 0x40b385
mov edx, dword [edx]
mov dword [ebp + 0x6c], 0xd3c8dfdd
xor ecx, ecx
mov word [ebp + 0x70], 0xdf
mov byte [ebp + 0x72], 1
mov al, cl
sub al, 0x51
xor byte [ebp + ecx + 0x6c], al
inc ecx
cmp ecx, 5
jb 0x40b398
push edx
lea eax, [ebp + 0x6c]
mov byte [ebp + 0x72], 0
push eax
lea ecx, [ebp]
call fcn.00410c50
mov ecx, dword [ebp + 0x54]
mov byte [ebp - 4], 9
cmp ecx, 0x10
jb 0x40b3eb
mov edx, dword [ebp + 0x40]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40b3e1
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40b427
push ecx
push edx
call fcn.0045e420
add esp, 8
mov ecx, dword [ebp + 0x2c]
mov dword [ebp + 0x50], 0
mov dword [ebp + 0x54], 0xf
mov byte [ebp + 0x40], 0
mov byte [ebp - 4], 1
cmp ecx, 0x10
jb 0x40b437
mov edx, dword [ebp + 0x18]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40b42d
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x40b42d
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push ecx
push edx
call fcn.0045e420
add esp, 8
movaps xmm0, xmmword [0x462e00]
lea ecx, [ebp]
movups xmmword [ebp + 0x34], xmm0
push 0
movaps xmm0, xmmword [0x462e40]
movups xmmword [ebp + 0x44], xmm0
mov word [ebp + 0x54], 0x100
call fcn.00410e10
sub esp, 0x18
mov esi, eax
mov edx, esp
mov dword [ebp + 0x60], esp
mov ecx, esi
mov dword [edx], 0
mov dword [edx + 0x10], 0
lea edi, [ecx + 1]
mov dword [edx + 0x14], 0
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40b480
sub ecx, edi
push ecx
push esi
mov ecx, edx
call fcn.004025b0
push ebx
sub esp, 0x18
mov byte [ebp - 4], 0xb
mov edx, esp
mov dword [ebp + 0x70], edx
cmp byte [ebp + 0x55], 0
je 0x40b4b9
xor ecx, ecx
mov al, cl
sub al, 0x51
xor byte [ebp + ecx + 0x34], al
inc ecx
cmp ecx, 0x20
jb 0x40b4a7
mov byte [ebp + 0x55], 0
lea eax, [ebp - 0x12]
mov ecx, edx
push eax
lea eax, [ebp + 0x54]
push eax
lea eax, [ebp + 0x34]
push eax
call fcn.004063e0
mov byte [ebp - 4], 1
call fcn.0040d760
movzx ecx, byte [0x478785]
test al, al
mov edx, 1
cmove ecx, edx
cmp ebx, 0x462cec
push 0x1024
movzx eax, cl
push 0
push dword [0x478858]
cmove eax, edx
mov byte [0x478785], al
call sub.VCRUNTIME140.dll_memset
mov esi, dword [0x478858]
add esp, 0x44
mov edx, ebx
mov al, byte [edx]
lea edx, [edx + 1]
mov byte [esi], al
lea esi, [esi + 1]
test al, al
jne 0x40b514
push ebx
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov ecx, dword [ebp - 0x18]
add esp, 4
call fcn.00409210
inc dword [0x478874]
mov ecx, dword [ebp + 0x14]
cmp ecx, 0x10
jb 0x40b570
mov edx, dword [ebp]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40b566
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x40b566
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push ecx
push edx
call fcn.0045e420
add esp, 8
mov al, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x74]
xor ecx, ebp
call fcn.0045e42e
lea esp, [ebp + 0x78]
pop ebp
ret