Function at 0x408500
Capabilities:
Encode data using xor
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x27dc
call fcn.00476a90
mov eax, dword [0x4ca510]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [ebp + 8]
push esi
push edi
push 0x215f
lea eax, [ebp - 0x27bf]
mov esi, ecx
push 0
push eax
mov dword [ebp - 0x27c4], esi
mov byte [ebp - 0x27c0], 0
call fcn.00476ac0
lea ecx, [esi + 0x14]
add esp, 0xc
shl ecx, 7
lea edx, [ecx + ebx]
mov edi, 0x4bd58c
mov eax, edx
mov cl, byte [eax]
cmp cl, byte [edi]
jne 0x408572
test cl, cl
je 0x40856e
mov cl, byte [eax + 1]
cmp cl, byte [edi + 1]
jne 0x408572
add eax, 2
add edi, 2
test cl, cl
jne 0x408552
xor eax, eax
jmp 0x408577
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x4087ed
push 0x40
push eax
lea edx, [ebp - 0x48]
push edx
call fcn.00476ac0
mov eax, dword [ebp + 0xc]
add esp, 0xc
cmp eax, 0x34
jne 0x4085c6
mov eax, dword [str.cadence]
mov ecx, dword [0x497604]
push 0x497628
mov edx, 0x14
lea edi, [ebp - 0x660]
mov dword [ebp - 0x48], eax
mov dword [ebp - 0x44], ecx
call fcn.004128f0
add esp, 4
push 0x497620
jmp 0x4085e5
cmp eax, 0x38
jne 0x4087d9
mov edx, dword [str.cadence]
mov eax, dword [0x497604]
mov dword [ebp - 0x48], edx
mov dword [ebp - 0x44], eax
push 0x497630
mov edx, 0x14
lea edi, [ebp - 0x4d0]
call fcn.004128f0
mov ecx, dword [ebp - 0x48]
mov edi, dword [ebx + esi*4 + 0x1ef0]
mov eax, dword [ebx + esi*4 + 0x1e00]
mov edx, dword [ebp - 0x44]
add esp, 4
push edi
mov dword [ebp - 0x27d0], ecx
push eax
lea ecx, [ebp - 0x248]
push ecx
mov dword [ebp - 0x27cc], edx
call fcn.00478340
add esp, 0xc
test edi, 0xfffffff8
jbe 0x4086a0
mov eax, dword [ebx + esi*4 + 0x1ef0]
shr eax, 3
lea edi, [ebp - 0x248]
mov dword [ebp - 0x27c4], eax
jmp 0x408650
mov eax, dword [edi + 4]
mov edx, dword [edi]
mov dword [ebp - 0x27d4], eax
lea eax, [ebp - 0x4d0]
mov dword [ebp - 0x27d8], edx
call fcn.00411980
mov ecx, dword [ebp - 0x27d0]
mov edx, dword [ebp - 0x27cc]
xor dword [edi], ecx
xor dword [edi + 4], edx
mov eax, dword [ebp - 0x27d8]
mov ecx, dword [ebp - 0x27d4]
add edi, 8
dec dword [ebp - 0x27c4]
mov dword [ebp - 0x27d0], eax
mov dword [ebp - 0x27cc], ecx
jne 0x408650
mov eax, dword [ebx + esi*4 + 0x1ef0]
push str.pragma_protect
lea ecx, [ebp - 0x248]
call fcn.004051f0
add esp, 4
test eax, eax
jne 0x4087b8
test dword [ebx + esi*4 + 0x1ef0], 0xfffffff8
mov edx, dword [ebp - 0x48]
mov eax, dword [ebp - 0x44]
mov dword [ebp - 0x27d0], edx
mov dword [ebp - 0x27cc], eax
mov dword [ebp - 0x27c4], 0
jbe 0x40875c
mov ecx, dword [ebx + esi*4 + 0x1e00]
mov edx, dword [ebp - 0x27c4]
mov eax, dword [ecx + edx*8]
lea edi, [ecx + edx*8]
mov ecx, dword [edi + 4]
mov dword [ebp - 0x27d8], eax
lea eax, [ebp - 0x660]
mov dword [ebp - 0x27d4], ecx
call fcn.00411980
mov edx, dword [ebp - 0x27d0]
mov eax, dword [ebp - 0x27cc]
xor dword [edi + 4], eax
mov ecx, dword [ebp - 0x27d8]
xor dword [edi], edx
mov eax, dword [ebp - 0x27c4]
mov edx, dword [ebp - 0x27d4]
mov dword [ebp - 0x27d0], ecx
mov ecx, dword [ebx + esi*4 + 0x1ef0]
inc eax
shr ecx, 3
mov dword [ebp - 0x27cc], edx
mov dword [ebp - 0x27c4], eax
cmp eax, ecx
jb 0x4086eb
mov eax, dword [ebx + esi*4 + 0x1ef0]
mov ecx, dword [ebx + esi*4 + 0x1e00]
movsx edx, byte [eax + ecx - 1]
sub eax, edx
mov dword [ebx + esi*4 + 0x1ef0], eax
mov eax, dword [ebp + 0xc]
cmp eax, 0x34
je 0x408789
cmp eax, 0x38
jne 0x408a81
push 0x4bd5cc
push str.tmp.txt
call fcn.0046fe45
mov edi, eax
add esp, 8
test edi, edi
jne 0x4088e0
push str.File_tmpfile_can_not_be_overwrited__n
call fcn.0046e24e
add esp, 4
push edi
call fcn.00470ab0
mov edx, dword [ebx + esi*4 + 0x1ef0]
mov ecx, dword [ebx + esi*4 + 0x1e00]
push edx
lea eax, [ebp - 0x248]
push eax
push ecx
call fcn.00478340
add esp, 0xc
jmp 0x40875c
push str.Unknow_RC5_key__n
call fcn.0046e24e
add esp, 4
push 0
call fcn.00470ab0
mov edi, 0x4bd5b4
mov eax, edx
mov cl, byte [eax]
cmp cl, byte [edi]
jne 0x408814
test cl, cl
je 0x408810
mov cl, byte [eax + 1]
cmp cl, byte [edi + 1]
jne 0x408814
add eax, 2
add edi, 2
test cl, cl
jne 0x4087f4
xor eax, eax
jmp 0x408819
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x40875c
cmp dword [ebp + 0xc], 0x38
jne 0x4088cc
mov eax, dword [0x4db3f4]
test eax, 0x2000000
je 0x40884f
lea edx, [ebp - 0x340]
push edx
push 0x80
push 0x497630
call fcn.0045baa0
jmp 0x408884
test eax, 0x200
je 0x40886e
lea eax, [ebp - 0x340]
push eax
push 0x80
push 0x497630
call fcn.00458830
jmp 0x408884
lea ecx, [ebp - 0x340]
push ecx
push 0x80
push 0x497630
call fcn.00457b20
mov eax, dword [ebp - 0x27c4]
mov edx, dword [ebx + eax*4 + 0x1ef0]
mov ecx, 5
mov esi, str.cadence_design_systema
lea edi, [ebp - 0x48]
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
movsb byte es:[edi], byte [esi]
mov esi, dword [ebx + eax*4 + 0x1e00]
add esp, 0xc
push edx
lea eax, [ebp - 0x48]
lea ecx, [ebp - 0x340]
mov edi, esi
call fcn.00407400
mov esi, dword [ebp - 0x27c4]
add esp, 4
jmp 0x40875c
push str.Unknow_aes_key__n
call fcn.0046e24e
add esp, 4
push 0
call fcn.00470ab0
mov eax, dword [ebx + esi*4 + 0x1ef0]
mov ecx, dword [ebx + esi*4 + 0x1e00]
push edi
push eax
push 1
push ecx
call fcn.00470326
push 0
push 0
push edi
call fcn.004706d0
mov edx, dword [ebx + esi*4 + 0x1ef0]
add esp, 0x1c
push edi
push edx
lea eax, [ebp - 0x148]
push eax
mov dword [ebp - 0x880], 0
call fcn.0046fc51
mov ecx, dword [ebx + esi*4 + 0x1ef0]
add esp, 0xc
push edi
push ecx
lea edx, [ebp - 0x148]
push edx
call fcn.0046fc51
add esp, 0xc
nop
push 0
lea ecx, [ebp - 0x27c0]
push ecx
push eax
call fcn.00405d60
add esp, 0xc
test al, 1
je 0x4089de
mov eax, dword [ebx + esi*4 + 0x1ef0]
push 1
lea edx, [ebp - 0x27c0]
push edx
push edi
lea ecx, [ebp - 0x148]
call fcn.00406240
mov cx, word [0x4bcb3c]
mov dl, byte [0x4bcb3e]
mov dword [ebp - 0x27c4], eax
mov eax, dword [str.base64]
add esp, 0xc
cmp dword [ebp - 0x9c0], 0
mov dword [ebp - 0x13c0], eax
mov word [ebp - 0x13bc], cx
mov byte [ebp - 0x13ba], dl
je 0x408a10
lea eax, [ebp - 0x27c0]
push eax
mov dword [ebp - 0x880], 1
call fcn.00406770
add esp, 4
test eax, eax
jne 0x4089fc
push str.Error_base64_decoding_session_CDS_KEY_key__n
call fcn.0046e24e
add esp, 4
push 0
call fcn.00470ab0
mov ecx, dword [ebx + esi*4 + 0x1ef0]
push edi
push ecx
lea edx, [ebp - 0x148]
push edx
call fcn.0046fc51
add esp, 0xc
mov dword [ebp - 0x27c4], eax
cmp dword [ebp - 0x27c4], 0
je 0x408a24
mov eax, dword [ebp - 0x27c4]
jmp 0x408940
push str.Error_parsing_session_CDS_KEY_key__n
call fcn.0046e24e
add esp, 4
push 0
call fcn.00470ab0
push edi
call fcn.004707b9
add esp, 4
push str.tmp.txt
call fcn.0046fc21
mov eax, dword [ebp - 0x8d0]
mov ecx, dword [ebp - 0x9c0]
mov edx, dword [ebx + esi*4 + 0x1e00]
add esp, 4
push eax
push ecx
push edx
call fcn.00478340
mov eax, dword [ebp - 0x8d0]
mov dword [ebx + esi*4 + 0x1ef0], eax
lea eax, [ebp - 0x7fc]
mov edx, eax
mov ecx, ebx
add esp, 0xc
sub ecx, edx
lea edx, [ecx + 0x1fc4]
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x408a77
mov eax, dword [ebx + esi*4 + 0x1ef0]
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0046c8b9
mov esp, ebp
pop ebp
ret