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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4606d0
mov eax, dword fs:[0]
push eax
sub esp, 0xa8
mov eax, dword [0x4780bc]
xor eax, ebp
mov dword [ebp - 0x14], 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 - 0xb0], edi
mov dword [ebp - 0x74], 0
mov dword [ebp - 4], 0
mov dword [ebp - 0x64], 0
mov dword [ebp - 0x60], 0xf
mov byte [ebp - 0x74], 0
push 4
mov byte [ebp - 4], 2
call fcn.0045e3f0
add esp, 4
mov dword [ebp - 0xac], eax
mov byte [ebp - 4], 3
test eax, eax
je 0x40cccc
mov ecx, eax
call fcn.00411aa0
mov byte [ebp - 4], 2
xor ecx, ecx
mov dword [ebp - 0x20], 0xc0d4c3da
mov dword [ebp - 0x1c], 0xd3d8d5dd
mov word [ebp - 0x18], 0x100
mov al, cl
sub al, 0x51
xor byte [ebp + ecx - 0x20], al
inc ecx
cmp ecx, 8
jb 0x40cce6
lea eax, [ebp - 0x20]
mov byte [ebp - 0x17], 0
push eax
call dword [sym.imp.api_ms_win_crt_environment_l1_1_0.dll_getenv]
mov edx, eax
mov dword [ebp - 0x8c], 0
mov ecx, edx
mov dword [ebp - 0x7c], 0
add esp, 4
mov dword [ebp - 0x78], 0
lea esi, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40cd24
sub ecx, esi
push ecx
push edx
lea ecx, [ebp - 0x8c]
call fcn.004025b0
push 0x1024
mov byte [ebp - 4], 4
mov byte [0x478784], 0
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
push 0x1024
mov ebx, eax
push 0
push ebx
call sub.VCRUNTIME140.dll_memset
add esp, 0x10
mov dword [ebp - 0x2c], 0xd3eed3dc
mov dword [ebp - 0x28], 0xc0dcc0d0
xor ecx, ecx
mov word [ebp - 0x24], 0xd2
mov byte [ebp - 0x22], 1
nop dword [eax]
mov al, cl
sub al, 0x51
xor byte [ebp + ecx - 0x2c], al
inc ecx
cmp ecx, 9
jb 0x40cd80
lea eax, [ebp - 0xa6]
mov byte [ebp - 0x22], 0
push eax
lea eax, [ebp - 0x23]
push eax
lea eax, [ebp - 0x2c]
push eax
lea ecx, [ebp - 0x4c]
call fcn.004063e0
lea eax, [ebp - 0x4c]
mov byte [ebp - 4], 5
push eax
lea eax, [ebp - 0xa4]
push eax
call fcn.00412df0
add esp, 8
mov edx, eax
cmp dword [edx + 0x14], 0x10
mov byte [ebp - 4], 6
jb 0x40cdce
mov edx, dword [edx]
mov dword [ebp - 0x20], 0xdbc5d3ce
xor ecx, ecx
mov dword [ebp - 0x1c], 0x100dadc
nop
mov al, cl
sub al, 0x51
xor byte [ebp + ecx - 0x20], al
inc ecx
cmp ecx, 6
jb 0x40cde0
push edx
lea eax, [ebp - 0x20]
mov byte [ebp - 0x19], 0
push eax
lea ecx, [ebp - 0x74]
call fcn.00410c50
mov ecx, dword [ebp - 0x90]
mov byte [ebp - 4], 5
cmp ecx, 0x10
jb 0x40ce39
mov edx, dword [ebp - 0xa4]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40ce2f
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40ce7e
push ecx
push edx
call fcn.0045e420
add esp, 8
mov ecx, dword [ebp - 0x38]
mov dword [ebp - 0x94], 0
mov dword [ebp - 0x90], 0xf
mov byte [ebp - 0xa4], 0
mov byte [ebp - 4], 4
cmp ecx, 0x10
jb 0x40ce8e
mov edx, dword [ebp - 0x4c]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40ce84
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x40ce84
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
lea eax, [ebp - 0x4c]
push 0x47880c
push eax
call fcn.00412df0
add esp, 8
mov edx, eax
cmp dword [edx + 0x14], 0x10
mov byte [ebp - 4], 7
jb 0x40cead
mov edx, dword [edx]
mov dword [ebp - 0x20], 0xdac5c5ce
xor ecx, ecx
mov dword [ebp - 0x1c], 0xd1ddec
mov byte [ebp - 0x18], 1
mov al, cl
sub al, 0x51
xor byte [ebp + ecx - 0x20], al
inc ecx
cmp ecx, 7
jb 0x40cec1
push edx
lea eax, [ebp - 0x20]
mov byte [ebp - 0x18], 0
push eax
lea ecx, [ebp - 0x74]
call fcn.00410c50
mov ecx, dword [ebp - 0x38]
mov byte [ebp - 4], 4
cmp ecx, 0x10
jb 0x40cf1a
mov edx, dword [ebp - 0x4c]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40cf10
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x40cf10
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 0x4787f4
call fcn.00402850
lea eax, [ebp - 0x4c]
push eax
lea ecx, [ebp - 0xa5]
call fcn.00414a80
mov edx, eax
cmp dword [edx + 0x14], 0x10
mov byte [ebp - 4], 8
jb 0x40cf46
mov edx, dword [edx]
mov dword [ebp - 0x30], 0xdac5c5ce
xor ecx, ecx
mov dword [ebp - 0x2c], 0xdfc1dad6
mov dword [ebp - 0x28], 0xd3cdd9d4
mov dword [ebp - 0x24], 0x100d2d4
mov al, cl
sub al, 0x51
xor byte [ebp + ecx - 0x30], al
inc ecx
cmp ecx, 0xe
jb 0x40cf64
push edx
lea eax, [ebp - 0x30]
mov byte [ebp - 0x21], 0
push eax
lea ecx, [ebp - 0x74]
call fcn.00410c50
mov ecx, dword [ebp - 0x38]
mov byte [ebp - 4], 4
cmp ecx, 0x10
jb 0x40cfbd
mov edx, dword [ebp - 0x4c]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40cfb3
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x40cfb3
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 + 0x78]
mov ecx, esp
push eax
call fcn.00402850
lea eax, [ebp - 0x4c]
push eax
lea ecx, [ebp - 0xa5]
call fcn.00414a80
mov edx, eax
cmp dword [edx + 0x14], 0x10
mov byte [ebp - 4], 9
jb 0x40cfe8
mov edx, dword [edx]
mov dword [ebp - 0x2c], 0xdcd0d8cc
xor ecx, ecx
mov dword [ebp - 0x28], 0xe9d9d1dd
mov dword [ebp - 0x24], 0x100dcde
nop
mov al, cl
sub al, 0x51
xor byte [ebp + ecx - 0x2c], al
inc ecx
cmp ecx, 0xa
jb 0x40d000
push edx
lea eax, [ebp - 0x2c]
mov byte [ebp - 0x21], 0
push eax
lea ecx, [ebp - 0x74]
call fcn.00410c50
mov ecx, dword [ebp - 0x38]
mov byte [ebp - 4], 4
cmp ecx, 0x10
jb 0x40d059
mov edx, dword [ebp - 0x4c]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40d04f
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x40d04f
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, [ebp + 8]
mov ecx, esp
push eax
call fcn.00402850
lea eax, [ebp - 0x4c]
push eax
lea ecx, [ebp - 0xa5]
call fcn.00414a80
mov edx, eax
cmp dword [edx + 0x14], 0x10
mov byte [ebp - 4], 0xa
jb 0x40d084
mov edx, dword [edx]
mov dword [ebp - 0x20], 0xc1c2d5c2
xor ecx, ecx
mov dword [ebp - 0x1c], 0xd0d3d2
mov byte [ebp - 0x18], 1
mov al, cl
sub al, 0x51
xor byte [ebp + ecx - 0x20], al
inc ecx
cmp ecx, 7
jb 0x40d098
push edx
lea eax, [ebp - 0x20]
mov byte [ebp - 0x18], 0
push eax
lea ecx, [ebp - 0x74]
call fcn.00410c50
mov ecx, dword [ebp - 0x38]
mov byte [ebp - 4], 4
cmp ecx, 0x10
jb 0x40d0f1
mov edx, dword [ebp - 0x4c]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40d0e7
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x40d0e7
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, [ebp - 0x8c]
mov ecx, esp
push eax
call fcn.00402850
lea eax, [ebp - 0x4c]
push eax
lea ecx, [ebp - 0xa5]
call fcn.00414a80
mov edx, eax
cmp dword [edx + 0x14], 0x10
mov byte [ebp - 4], 0xb
jb 0x40d11f
mov edx, dword [edx]
mov dword [ebp - 0x1c], 0xc0d4c3c6
xor ecx, ecx
mov word [ebp - 0x18], 0x100
nop
mov al, cl
sub al, 0x51
xor byte [ebp + ecx - 0x1c], al
inc ecx
cmp ecx, 4
jb 0x40d130
push edx
lea eax, [ebp - 0x1c]
mov byte [ebp - 0x17], 0
push eax
lea ecx, [ebp - 0x74]
call fcn.00410c50
mov ecx, dword [ebp - 0x38]
mov byte [ebp - 4], 4
cmp ecx, 0x10
jb 0x40d189
mov edx, dword [ebp - 0x4c]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40d17f
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x40d17f
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 edi
call fcn.00402850
lea eax, [ebp - 0x4c]
push eax
lea ecx, [ebp - 0xa5]
call fcn.00414a80
mov edx, eax
cmp dword [edx + 0x14], 0x10
mov byte [ebp - 4], 0xc
jb 0x40d1b1
mov edx, dword [edx]
mov dword [ebp - 0x20], 0xc6d0c2ed
xor ecx, ecx
mov dword [ebp - 0x1c], 0x100d5c5
mov al, cl
sub al, 0x51
xor byte [ebp + ecx - 0x20], al
inc ecx
cmp ecx, 6
jb 0x40d1c1
push edx
lea eax, [ebp - 0x20]
mov byte [ebp - 0x19], 0
push eax
lea ecx, [ebp - 0x74]
call fcn.00410c50
mov ecx, dword [ebp - 0x38]
mov byte [ebp - 4], 4
cmp ecx, 0x10
jb 0x40d21a
mov edx, dword [ebp - 0x4c]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40d210
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x40d210
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 - 0x74]
movups xmmword [ebp - 0x58], xmm0
push 0
movaps xmm0, xmmword [0x462e40]
movups xmmword [ebp - 0x48], xmm0
mov word [ebp - 0x38], 0x100
call fcn.00410e10
sub esp, 0x18
mov esi, eax
mov edx, esp
mov dword [ebp - 0xac], 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 0x40d266
sub ecx, edi
push ecx
push esi
mov ecx, edx
call fcn.004025b0
push ebx
sub esp, 0x18
mov byte [ebp - 4], 0xd
mov edx, esp
mov dword [ebp - 0x1c], edx
cmp byte [ebp - 0x37], 0
je 0x40d2a2
xor ecx, ecx
nop dword [eax]
mov al, cl
sub al, 0x51
xor byte [ebp + ecx - 0x58], al
inc ecx
cmp ecx, 0x20
jb 0x40d290
mov byte [ebp - 0x37], 0
lea eax, [ebp - 0xa6]
mov ecx, edx
push eax
lea eax, [ebp - 0x38]
push eax
lea eax, [ebp - 0x58]
push eax
call fcn.004063e0
mov byte [ebp - 4], 4
call fcn.0040d760
movzx ecx, byte [0x478785]
test al, al
push 0x1024
mov edx, 1
push 0
push dword [0x478858]
cmove ecx, edx
mov byte [0x478785], cl
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 0x40d2f5
push ebx
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov ecx, dword [ebp - 0xb0]
add esp, 4
call fcn.00409210
mov ecx, dword [ebp - 0x78]
cmp ecx, 0x10
jb 0x40d34b
mov edx, dword [ebp - 0x8c]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40d341
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40d371
push ecx
push edx
call fcn.0045e420
add esp, 8
mov ecx, dword [ebp - 0x60]
cmp ecx, 0x10
jb 0x40d381
mov edx, dword [ebp - 0x74]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40d377
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x40d377
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 + 0x1c]
cmp ecx, 0x10
jb 0x40d3ff
mov edx, dword [ebp + 8]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40d3f5
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x40d3f5
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
movaps xmm0, xmmword [0x462e30]
lea ecx, [ebp - 0x5c]
movups xmmword [ebp - 0x5c], xmm0
push 5
movaps xmm0, xmmword [0x462d90]
movups xmmword [ebp - 0x4c], xmm0
mov dword [ebp - 0x3c], 0xfca39eef
mov dword [ebp - 0x38], 0xe6bef3
mov byte [ebp - 0x34], 1
call fcn.0040b650
push eax
call fcn.00411f80
add esp, 8
mov byte [0x478785], 1
mov eax, 0x40d381
ret
push ecx
push edx
call fcn.0045e420
add esp, 8
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.0045e42e
mov esp, ebp
pop ebp
ret 0x18