Function at 0x4be680
Capabilities:
Encode data using xor
Get thread local storage value
Resolve function by parsing pe exports
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xffffffc0
sub esp, 0x180
mov esi, esp
mov dword [esi + 0x158], ebp
mov dword [esi + 0x15c], esp
mov dword [esi + 0x168], 0xffffffff
mov dword [esi + 0x164], 0x578cd0
mov edi, ecx
lea eax, [esi + 0x160]
mov edx, 0x2f8
mov ecx, dword fs:[0]
mov dword [esi + 0x160], ecx
mov dword fs:[0], eax
mov eax, dword [edi + 0x14]
movsd xmm0, qword [edi + 0x1c]
movsd xmm1, qword [edi + 0x24]
movzx ecx, byte [edi + 0x18]
mov dword [esi + 0x78], eax
movsd qword [esi + 0x58], xmm1
movsd qword [esi + 0x50], xmm0
mov dword [esi + 0x48], eax
mov byte [esi + 0x4c], cl
mov byte [esi + 0x7c], cl
xor ecx, ecx
movzx eax, byte [0x5fd2ec]
call fcn.0056a9f0
test eax, eax
mov dword [esi + 0x40], edi
je 0x4becff
lea ecx, [edi + 0x1c]
mov dword [esi + 0x6c], ecx
push 0x2f8
push 0
mov dword [esi + 0x74], eax
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
mov edx, 0xe414a674
mov ecx, 0xf0de7325
mov eax, dword [edi + 0x30]
movd xmm1, edx
movd xmm0, ecx
punpckldq xmm0, xmm1
movapd xmm1, xmmword [0x5898e0]
mov dword [esi + 0x70], eax
nop
mov edx, 1
mov ecx, 0
mov ebx, 0x70656462
lock xadd dword [0x5fd228], edx
mov dword [esi + 0x44], edx
xor edx, 0x79746573
mov eax, edx
mov edi, edx
add eax, 0x6e657261
adc ecx, 0xdcdecbc7
shld edi, ebx, 0x10
shld ebx, edx, 0x10
xor edi, eax
xor ebx, ecx
mov eax, edi
mov ecx, ebx
add eax, 0xd7dedfc6
mov dword [esi + 0x3c], eax
mov eax, edi
adc ecx, 0xded7d4e2
shld eax, ebx, 0x15
shld ebx, edi, 0x15
add edx, 0xc19fead0
mov edi, 0
adc edi, 0x1671bdd1
movd xmm6, eax
movd xmm3, ebx
mov eax, dword [esi + 0x44]
movd xmm5, edi
xor edi, 0xff
punpckldq xmm6, xmm3
movd xmm3, ecx
xor ecx, 0x4000000
movd xmm4, edi
mov edi, dword [esi + 0x3c]
punpcklqdq xmm6, xmm0
movd xmm2, edi
xor eax, edi
punpckldq xmm2, xmm3
movd xmm3, edx
movdqa xmm7, xmm3
punpcklqdq xmm3, xmm4
punpckldq xmm7, xmm5
movd xmm5, ecx
punpcklqdq xmm2, xmm7
pxor xmm2, xmm6
movd xmm6, eax
punpcklqdq xmm5, xmm6
movdqa xmm6, xmm2
shufps xmm3, xmm2, 0xe2
shufps xmm6, xmm5, 0x24
paddq xmm3, xmm6
movdqa xmm6, xmm2
pshufd xmm4, xmm3, 0xff
psllq xmm6, 0xd
movd eax, xmm4
movdqa xmm4, xmm2
psrlq xmm2, 0x30
psllq xmm4, 0x10
shufpd xmm2, xmm1, 2
movd xmm5, eax
movsd xmm6, xmm4
movdqa xmm4, xmm3
orpd xmm2, xmm6
shufps xmm4, xmm5, 0x4e
xorpd xmm2, xmm3
shufps xmm4, xmm3, 0x42
movapd xmm3, xmm2
movapd xmm5, xmm2
paddq xmm4, xmm2
psrlq xmm3, 0x2b
psrlq xmm5, 0x2f
movsd xmm5, xmm3
movdqa xmm3, xmm2
psllq xmm2, 0x11
psllq xmm3, 0x15
movsd xmm2, xmm3
pshufd xmm3, xmm4, 0xff
movd eax, xmm3
orpd xmm2, xmm5
movdqa xmm3, xmm4
movd xmm5, eax
xorpd xmm2, xmm4
shufps xmm3, xmm5, 0x4e
movapd xmm6, xmm2
shufps xmm3, xmm4, 0x42
psrlq xmm6, 0x33
paddq xmm3, xmm2
pshufd xmm4, xmm3, 0xff
movd eax, xmm4
movdqa xmm4, xmm2
psrlq xmm4, 0x30
movd xmm5, eax
movsd xmm6, xmm4
movdqa xmm4, xmm2
psllq xmm2, 0xd
psllq xmm4, 0x10
movsd xmm2, xmm4
movdqa xmm4, xmm3
orpd xmm2, xmm6
shufps xmm4, xmm5, 0x4e
xorpd xmm2, xmm3
shufps xmm4, xmm3, 0x42
movapd xmm3, xmm2
movapd xmm5, xmm2
paddq xmm4, xmm2
psrlq xmm3, 0x2b
psrlq xmm5, 0x2f
movsd xmm5, xmm3
movdqa xmm3, xmm2
psllq xmm2, 0x11
psllq xmm3, 0x15
movsd xmm2, xmm3
pshufd xmm3, xmm4, 0xff
movd eax, xmm3
orpd xmm2, xmm5
movdqa xmm3, xmm4
movd xmm5, eax
xorpd xmm2, xmm4
shufps xmm3, xmm5, 0x4e
movapd xmm5, xmm2
shufps xmm3, xmm4, 0x42
movapd xmm4, xmm2
psrlq xmm5, 0x33
psrlq xmm4, 0x30
paddq xmm3, xmm2
movsd xmm5, xmm4
movdqa xmm4, xmm2
psllq xmm2, 0xd
psllq xmm4, 0x10
movsd xmm2, xmm4
orpd xmm2, xmm5
xorpd xmm2, xmm3
pshufd xmm4, xmm2, 0xee
paddq xmm4, xmm3
pshufd xmm3, xmm4, 0x55
movd eax, xmm4
movdqa xmm4, xmm2
movd ecx, xmm3
movdqa xmm3, xmm2
psrlq xmm4, 0x2f
psrlq xmm3, 0x2b
xor eax, ecx
movsd xmm4, xmm3
movdqa xmm3, xmm2
psllq xmm2, 0x11
psllq xmm3, 0x15
movsd xmm2, xmm3
orpd xmm2, xmm4
pshufd xmm3, xmm2, 0xee
pxor xmm3, xmm2
movd edx, xmm3
pshufd xmm2, xmm3, 0x55
movd edi, xmm2
xor edx, eax
xor edi, eax
mov ecx, edx
or ecx, edi
je 0x4be750
mov eax, dword [esi + 0x6c]
mov ebx, dword [esi + 0x74]
mov ecx, dword [esi + 0x70]
movsd xmm0, qword [eax]
movsd xmm1, qword [eax + 8]
mov eax, dword [esi + 0x48]
movsd qword [esi + 0x118], xmm1
movsd qword [esi + 0x110], xmm0
mov dword [esi + 0x120], eax
movzx eax, byte [esi + 0x4c]
mov byte [esi + 0x124], al
mov dword [esi + 0x80], 0
mov dword [esi + 0x84], ebx
mov dword [esi + 0xc0], 0
mov dword [esi + 0xc4], ebx
mov dword [esi + 0x108], ecx
mov ecx, dword [esi + 0x40]
mov dword [esi + 0x100], edx
mov dword [esi + 0x104], edi
mov edx, dword [ecx + 0x2c]
test dword [ecx + 8], 0x7fffffff
mov dword [esi + 0x10c], edx
jne 0x4bea7a
mov eax, dword [0x5fd0f4]
test eax, eax
je 0x4bea94
dec eax
mov dword [esi + 0x168], 1
jmp 0x4beaa8
push dword [ecx + 0xc]
push 0
push dword [0x5fd290]
call dword [sym.imp.kernel32.dll_HeapFree]
mov eax, dword [0x5fd0f4]
test eax, eax
jne 0x4bea6d
mov ecx, 0x5fd0f4
mov dword [esi + 0x168], 1
call fcn.005878a0
push eax
call dword [sym.imp.kernel32.dll_TlsGetValue]
cmp eax, 2
jb 0x4beacc
cmp dword [eax + 4], 0
je 0x4beacc
cmp dword [eax + 8], 0
jne 0x4bed2b
add eax, 8
jmp 0x4beb7b
mov eax, dword [0x5fd0f4]
test eax, eax
je 0x4bead8
dec eax
jmp 0x4beae2
mov ecx, 0x5fd0f4
call fcn.005878a0
push eax
call dword [sym.imp.kernel32.dll_TlsGetValue]
mov ecx, eax
test eax, eax
je 0x4beb19
cmp ecx, 1
jne 0x4beb6a
lea eax, [esi + 0x50]
mov ecx, str.cannot_access_a_Thread_Local_Storage_value_during_or_after_destruction_rustc_aedd173a2c086e558c2b66d3743b344f977621a7library_std_src_threadlocal.rs
mov edx, 0x46
push 0x5ec568
push 0x599d9c
push eax
call fcn.0057fa90
add esp, 0xc
jmp 0x4bed42
movzx eax, byte [0x5fd2ec]
xor ecx, ecx
mov edx, 0xc
call fcn.0056a9f0
test eax, eax
je 0x4bed1a
mov dword [eax], 0x5fd0f4
mov dword [eax + 4], 0
mov ecx, eax
mov eax, dword [0x5fd0f4]
mov dword [esi + 0x44], ecx
test eax, eax
je 0x4beb52
dec eax
jmp 0x4beb5f
mov ecx, 0x5fd0f4
call fcn.005878a0
mov ecx, dword [esi + 0x44]
push ecx
push eax
call dword [sym.imp.kernel32.dll_TlsSetValue]
mov ecx, dword [esi + 0x44]
lea eax, [ecx + 8]
mov dword [ecx + 4], 1
mov dword [ecx + 8], 0
lea ecx, [esi + 0x80]
mov dword [eax], ecx
mov eax, dword [esi + 0x10c]
mov ecx, dword [esi + 0x108]
mov edx, dword [eax + 0x108]
cmp ecx, edx
jae 0x4becbc
mov dword [esi + 0x40], ecx
lea ecx, [ecx + ecx*8]
mov dword [esi + 0x44], eax
shl ecx, 2
add ecx, dword [eax + 0x104]
call fcn.004bd7b0
mov ecx, dword [esi + 0x44]
mov eax, dword [ecx + 0xc8]
test eax, eax
je 0x4bebdf
mov ecx, dword [ecx + 0xcc]
mov byte [esi + 0x3b], 1
mov dword [esi + 0x168], 9
push dword [esi + 0x40]
push eax
call dword [ecx + 0x14]
add esp, 8
mov ebx, dword [esi + 0x10c]
mov edi, dword [esi + 0x108]
mov edx, dword [ebx + 0x108]
cmp edi, edx
jae 0x4beccb
mov eax, dword [ebx + 0x104]
lea ecx, [edi + edi*8]
mov dword [esi + 0x3c], ecx
mov ecx, dword [eax + ecx*4 + 0x18]
cmp ecx, 3
je 0x4bec3a
mov ecx, dword [esi + 0x3c]
mov byte [esi + 0x3b], 1
mov dword [esi + 0x168], 2
mov dword [esi + 0x48], edi
mov dword [esi + 0x4c], ebx
lea edx, [eax + ecx*4 + 0x18]
lea ecx, [esi + 0x80]
call fcn.00580f00
mov ebx, dword [esi + 0x4c]
mov edi, dword [esi + 0x48]
mov edx, dword [ebx + 0x108]
mov dword [esi + 0x168], 2
cmp edi, edx
jae 0x4becea
mov eax, dword [ebx + 0x104]
mov ecx, dword [esi + 0x3c]
mov byte [esi + 0x3b], 1
lea ecx, [eax + ecx*4 + 0xc]
call fcn.004bd7b0
mov ecx, dword [esi + 0x44]
mov eax, dword [ecx + 0xd0]
test eax, eax
je 0x4bec93
mov ecx, dword [ecx + 0xd4]
mov byte [esi + 0x3b], 0
mov dword [esi + 0x168], 4
push dword [esi + 0x40]
push eax
call dword [ecx + 0x14]
add esp, 8
lea ecx, [esi + 0x80]
mov dword [esi + 0x168], 0xffffffff
call fcn.004bd600
mov eax, dword [esi + 0x160]
mov dword fs:[0], eax
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret
push 0x59a040
call fcn.0057f710
add esp, 4
jmp 0x4bed42
mov byte [esi + 0x3b], 1
mov dword [esi + 0x168], 2
mov ecx, edi
push 0x59a010
call fcn.0057f710
add esp, 4
jmp 0x4bed42
mov byte [esi + 0x3b], 1
mov ecx, edi
push 0x59a020
call fcn.0057f710
add esp, 4
jmp 0x4bed42
mov ecx, 4
mov edx, 0x2f8
mov dword [esi + 0x168], 0
call fcn.0057f230
jmp 0x4bed42
mov ecx, 4
mov edx, 0xc
call fcn.0057f230
jmp 0x4bed42
mov ecx, str.assertion_failed:_t.get__.is_null__
mov edx, 0x23
push 0x59a000
call fcn.0057f7d0
add esp, 4
ud2