Function at 0x408e70
Capabilities:
Encrypt data using chaskey

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff0
push edi
push esi
push ebx
sub esp, 0x664
cmp dword [0x56e71c], 0
mov dword [esp + 0x658], 0xffffffff
jne 0x408f3b
xor esi, esi
xor ebx, ebx
mov eax, 0x77f2655b
shl esi, 0xc
add esi, 0x24d69
mul esi
mov eax, 0x77f2655b
mov edi, esi
sub edi, edx
shr edi, 1
add edi, edx
shr edi, 0x13
imul ecx, edi, 0xae529
sub esi, ecx
mov ecx, esi
shr ecx, 2
shl esi, 0xc
add esi, 0x24d69
mul esi
mov eax, esi
sub eax, edx
shr eax, 1
add eax, edx
shr eax, 0x13
imul edi, eax, 0xae529
mov eax, 0x77f2655b
sub esi, edi
mov edx, esi
shl edx, 8
add ecx, edx
shl esi, 0xc
add esi, 0x24d69
mul esi
mov eax, esi
sub eax, edx
shr eax, 1
add eax, edx
shr eax, 0x13
imul edi, eax, 0xae529
sub esi, edi
mov eax, esi
shl eax, 0x12
add ecx, eax
mov dword [ebx*4 + 0x56d000], ecx
inc ebx
cmp ebx, 0x100
jl 0x408e9b
mov dword [0x56e71c], 1
mov dword [0x55b698], esi
movsx edx, byte [0x56d400]
xor eax, eax
mov dword [0x56e710], eax
test edx, edx
mov dword [0x56e718], eax
mov dword [0x56e6d4], eax
jne 0x408f75
call sym.genarts_frontend_tmp.exe_get_license_dir
push str.sys0.dll
push eax
push str._s__s
push 0x56d400
call dword [sym.imp.MSVCR80.dll_sprintf]
add esp, 0x10
push 0x54280c
push 0x56d400
call dword [sym.imp.MSVCR80.dll_fopen]
add esp, 8
mov ebx, eax
test ebx, ebx
jne 0x408f9d
xor eax, eax
add esp, 0x664
pop ebx
pop esi
pop edi
mov esp, ebp
pop ebp
ret
inc dword [0x56e720]
mov eax, 0x56d400
call fcn.00409c70
movsx eax, byte [0x56d400]
mov dword [0x56e728], 1
test eax, eax
jne 0x408fe0
call sym.genarts_frontend_tmp.exe_get_license_dir
push str.sys0.dll
push eax
push str._s__s
push 0x56d400
call dword [sym.imp.MSVCR80.dll_sprintf]
add esp, 0x10
lea esi, [esp + 0x590]
xor edi, edi
push ebx
push 0x78
push esi
call dword [sym.imp.MSVCR80.dll_fgets]
add esp, 0xc
test eax, eax
je 0x409991
inc edi
cmp edi, 2
jl 0x408fe9
xor esi, esi
lea edx, [esp + 0x650]
lea eax, [esp + 0x654]
push eax
push edx
push str._d__d
lea ecx, [esp + 0x59c]
push ecx
call dword [sym.imp.MSVCR80.dll_sscanf]
add esp, 0x10
cmp eax, 2
jge 0x40903d
xor edi, edi
mov esi, 0xc
jmp 0x4097e1
cmp dword [esp + 0x650], 1
jle 0x409053
xor edi, edi
mov esi, 0xd
jmp 0x4097e1
mov eax, dword [esp + 0x654]
test eax, eax
jl 0x409031
cmp eax, 0x96
jg 0x409031
test esi, esi
jne 0x4097df
test eax, eax
jle 0x4097df
mov dword [0x56e710], eax
imul eax, eax, 0x4c
xor edx, edx
xor ecx, ecx
call fcn.004085e0
mov edx, dword [0x56e710]
imul ecx, edx, 0x4c
mov dword [0x56e714], eax
mov dword [esp + 0x10], edx
push ecx
push 0
push eax
call fcn.004256d0
add esp, 0xc
xor edi, edi
cmp dword [esp + 0x10], 0
jle 0x4097e1
mov dword [esp + 0x630], esi
mov dword [esp + 0x62c], edi
mov dword [esp + 0x64c], ebx
xor edx, edx
mov dword [esp + 0x634], edx
mov ebx, edx
push dword [esp + 0x64c]
push 0x78
mov esi, ebx
add esi, dword [0x56e714]
lea edx, [esp + 0x598]
push edx
call dword [sym.imp.MSVCR80.dll_fgets]
add esp, 0xc
test eax, eax
je 0x40995a
lea eax, [esp + 0x4d9]
lea edi, [esp + 0x644]
lea ecx, [esp + 0x648]
lea edx, [esp + 0x658]
push edx
push ecx
push edi
lea edx, [esp + 0x660]
push edx
push eax
lea ecx, [esp + 0x664]
push ecx
lea edi, [esp + 0x478]
push edi
lea edx, [esp + 0x65c]
push edx
lea edx, [esp + 0x65c]
push edx
lea edx, [esp + 0x65c]
push edx
push str._d__d__d__s__x__s__x__d__d__d
lea edx, [esp + 0x5bc]
push edx
call dword [sym.imp.MSVCR80.dll_sscanf]
add esp, 0x30
cmp eax, 9
jl 0x40995a
lea eax, [esp + 0x460]
mov edx, esi
call fcn.004099a0
movsx edx, byte [esi + 0x34]
test edx, edx
jne 0x40993e
mov edx, dword [esp + 0x650]
mov ecx, dword [esp + 0x654]
mov edi, dword [esp + 0x644]
mov eax, dword [esp + 0x658]
mov dword [esi + 0x38], edx
mov dword [esi + 0x3c], ecx
mov dword [esi + 0x40], edi
mov edi, dword [esp + 0x648]
mov dword [esi + 0x44], edi
mov dword [esi + 0x48], eax
lea eax, [edi + 0xd05]
lea ecx, [ecx + edi + 0xd05]
mov edi, eax
shr edi, 0x13
shl eax, 0x13
add edi, eax
add ecx, edi
add edx, ecx
mov edi, ecx
shr edi, 0xd
shl ecx, 0xd
add edi, ecx
add edx, edi
mov eax, edx
shr eax, 0xb
add eax, edx
shl edx, 0xb
add eax, edx
mov edx, eax
mov ecx, eax
and edx, 0x3fffffff
and ecx, 0xfffff
xor edx, dword [esi + 0x10]
xor ecx, dword [esi + 8]
mov dword [esp + 0x61c], edx
mov dword [esi + 0x10], edx
movzx edx, byte [esi + 0xe]
mov dword [esi + 8], ecx
mov edi, eax
shr edi, 3
and edi, 0x1f
xor edx, edi
mov dword [esp + 0x624], edx
mov byte [esi + 0xe], dl
movzx edx, byte [esi + 0xf]
mov edi, eax
shr edi, 8
and edi, 0x1f
xor edx, edi
mov byte [esi + 0xf], dl
mov dword [esp + 0x628], edx
mov edx, eax
shr edx, 0xc
and edx, 0x3ff
shr eax, 0x12
and eax, 0x3ff
xor edx, dword [esi + 0x18]
xor eax, dword [esi + 0x14]
mov dword [esi + 0x18], edx
mov dword [esi + 0x14], eax
mov dword [esp + 0x620], edx
movsx edx, byte [esi + 0xd]
test edx, edx
je 0x4092b0
cmp ecx, dword [esp + 0x638]
jne 0x409824
mov edx, dword [esp + 0x624]
cmp edx, dword [esp + 0x63c]
jne 0x409824
mov edx, dword [esp + 0x628]
cmp edx, dword [esp + 0x640]
jne 0x409824
mov edx, 1
xor edi, edi
cmp dword [esi + 4], 0xa
cmovne edx, edi
mov byte [esi + 0xd], dl
test edx, edx
je 0x4092c9
mov edx, 1
xor edi, edi
cmp dword [esp + 0x628], 6
cmovl edx, edi
mov byte [esi + 0xd], dl
movzx edi, byte [esi + 0x30]
mov dword [esp + 0x618], edi
test edi, 4
je 0x4092e2
mov byte [esi + 0xd], 0
xor edx, edx
mov edi, edx
test edi, edi
je 0x409789
movsx edx, word [esi + 0x24]
test edx, edx
jne 0x4092f9
mov edx, 5
mov edi, 1
test edx, edx
mov edx, 0
cmovge edx, edi
mov byte [esi + 0xd], dl
mov edi, edx
test edi, edi
je 0x409789
mov edx, dword [esi]
mov dword [esp + 0x60c], ebx
mov edi, edx
xor edi, 0x3e7
mov ebx, 0x3e7
cmp edx, 0x73
mov edx, dword [esi + 0x28]
mov dword [esp + 0x610], edx
cmove edi, ebx
xor edi, dword [esi + 4]
mov ebx, dword [esi + 0x2c]
mov dword [esp + 0x614], ebx
mov ebx, dword [esi + 0x1c]
mov edx, ecx
sar edx, 0xa
xor ecx, edx
mov edx, dword [esp + 0x624]
xor edi, ecx
shl edx, 3
xor edi, edx
mov edx, dword [esp + 0x628]
mov ecx, dword [esp + 0x61c]
shl edx, 4
xor edi, edx
mov edx, ecx
sar edx, 0xa
xor edx, ecx
sar ecx, 0x14
xor edx, ecx
movzx ecx, word [esi + 0x22]
xor edi, edx
movsx edx, word [esi + 0x20]
xor edi, eax
mov eax, ebx
sar eax, 0xa
xor eax, ebx
sar ebx, 0x14
xor eax, ebx
xor edi, eax
movzx eax, word [esi + 0x24]
add edx, edx
xor edi, edx
shl ecx, 2
xor edi, ecx
mov ecx, dword [esp + 0x618]
xor edi, eax
mov ebx, ecx
and ebx, 1
shl ebx, 5
xor edi, ebx
mov edx, ecx
and edx, 2
shr edx, 1
shl edx, 6
xor edi, edx
mov eax, ecx
and eax, 4
shr eax, 2
shl eax, 7
xor edi, eax
and ecx, 8
shr ecx, 3
mov eax, dword [esp + 0x610]
shl ecx, 8
xor edi, ecx
mov edx, eax
shr edx, 0xa
xor eax, edx
mov edx, dword [esp + 0x614]
xor edi, eax
mov ebx, edx
shr ebx, 0xa
xor edx, ebx
xor edi, edx
mov ebx, dword [esp + 0x60c]
and edi, 0x3ff
xor edx, edx
cmp edi, dword [esp + 0x620]
mov edi, 1
cmove edx, edi
mov byte [esi + 0xd], dl
mov edi, edx
test edi, edi
je 0x409789
cmp dword [esi + 0x1c], 0
je 0x409546
push 0
call dword [sym.imp.MSVCR80.dll__time64]
mov dword [esp + 0x45c], eax
mov dword [esp + 0x460], edx
lea edx, [esp + 0x45c]
push edx
call dword [sym.imp.MSVCR80.dll__localtime64]
mov dword [esp + 0x55c], esi
mov esi, eax
mov edi, dword [esi + 0x14]
mov ecx, dword [esi + 0x10]
mov dword [esp + 0x614], ebx
mov eax, 0x2aaaaaab
add esp, 8
mov dword [esp + 0x558], ecx
neg ecx
add ecx, 0xd
imul ecx
mov eax, 0x51eb851f
sar ecx, 0x1f
mov ebx, edx
sar ebx, 1
sub ebx, ecx
sub edi, ebx
imul ecx, edi, 0x5b5
add edi, 0x1a90
imul edi
sar edi, 0x1f
sar edx, 5
lea eax, [ecx + 0x955d1c]
sub edx, edi
lea edi, [edx + edx*2]
sar eax, 1
shr eax, 0x1e
lea ecx, [eax + ecx + 0x955d1c]
mov eax, dword [esp + 0x558]
sar ecx, 2
add ecx, dword [esi + 0xc]
lea esi, [ebx*8]
lea ebx, [esi + ebx*4]
add eax, ebx
imul esi, eax, 0x16f
mov ebx, dword [esp + 0x60c]
mov eax, 0x2aaaaaab
add esi, 0xfffffe91
imul esi
sar esi, 0x1f
mov eax, edi
sar edx, 1
sub edx, esi
mov esi, dword [esp + 0x554]
add ecx, edx
mov edx, dword [esi + 0x1c]
sar eax, 1
shr eax, 0x1e
add eax, edi
sar eax, 2
sub ecx, eax
add ecx, 0xffff82b5
test edx, edx
je 0x409534
test ecx, ecx
je 0x409530
cmp edx, ecx
mov edx, 0
mov ecx, 1
cmovge edx, ecx
jmp 0x409539
xor edx, edx
jmp 0x409539
mov edx, 1
mov byte [esi + 0xd], dl
mov edi, edx
test edi, edi
je 0x409789
lea eax, [esp + 0x448]
call fcn.00409d90
lea eax, [esp + 0x448]
lea edx, [esp + 0x588]
call fcn.00409e00
mov edx, dword [esi + 0x38]
cmp edx, dword [esp + 0x588]
jne 0x4095ba
mov edx, dword [esi + 0x3c]
cmp edx, dword [esp + 0x58c]
jne 0x4095ba
mov edi, dword [esi + 0x2c]
test edi, edi
je 0x4095b2
lea eax, [esp + 0x414]
call fcn.00409d90
lea eax, [esp + 0x414]
lea edx, [esp + 0x424]
call fcn.00409e00
movzx edx, word [esp + 0x428]
movzx ecx, di
cmp edx, ecx
jne 0x4095ba
movsx edx, byte [esi + 0xd]
mov edi, edx
jmp 0x4095cd
mov byte [esi + 0xd], 0
xor edx, edx
xor edi, edi
mov dword [esp + 0x630], 9
test edi, edi
je 0x409789
mov edx, dword [esi + 0x28]
mov dword [esp + 0x55c], edx
test edx, edx
je 0x4096fd
lea edx, [esp + 0x430]
push edx
call dword [sym.imp.MSVCR80.dll__ftime64]
pop ecx
fild qword [esp + 0x430]
fld qword [0x53f000]
fsubp st(1)
movzx edx, word [esp + 0x438]
fld qword [0x53f008]
mov dword [esp + 0x440], edx
fild dword [esp + 0x440]
fmulp st(1)
faddp st(1)
mov edx, dword [0x55b688]
test edx, edx
jle 0x40968c
fld qword [0x56e690]
fsubr st(1)
fld qword [0x53f010]
fcompp
fnstsw ax
sahf
jbe 0x40968c
fstp st(0)
cmp edx, 4
jl 0x40983d
mov eax, edx
and eax, 3
neg eax
add eax, edx
xor ecx, ecx
movdqa xmm0, xmmword [ecx*4 + 0x56cfc0]
movdqa xmmword [esp + ecx*4 + 0x560], xmm0
add ecx, 4
cmp ecx, eax
jb 0x40965a
cmp eax, edx
jae 0x4096bd
mov ecx, dword [eax*4 + 0x56cfc0]
mov dword [esp + eax*4 + 0x560], ecx
inc eax
cmp eax, edx
jb 0x409677
jmp 0x4096bd
cmp dword [0x55b68c], 0
fstp qword [0x56e690]
je 0x4096b5
lea edx, [esp + 0x10]
push 0x404
push edx
call fcn.0042e1d0
movzx edx, ax
test edx, edx
je 0x40984f
xor edx, edx
mov dword [0x55b688], edx
test edx, edx
jle 0x4096df
mov edi, dword [esp + 0x55c]
xor eax, eax
movzx ecx, word [esp + eax*4 + 0x560]
cmp ecx, edi
je 0x409844
inc eax
cmp eax, edx
jl 0x4096ca
movsx edx, byte [esi + 0xd]
mov ecx, dword [esi + 0x28]
inc dword [esp + 0x62c]
mov edi, edx
mov dword [0x56e70c], ecx
test edi, edi
je 0x409789
mov edx, dword [esi + 0x40]
mov ecx, 1
cmp edx, dword [0x56e724]
mov edx, 0
cmovg edx, ecx
mov byte [esi + 0xd], dl
mov edi, edx
test edi, edi
je 0x409789
mov edx, dword [esi + 0x44]
mov ecx, edx
shr ecx, 8
xor ecx, 0x55
movzx edx, dl
xor ecx, dword [esi + 0x40]
xor ecx, dword [esi + 0x38]
xor ecx, dword [esi + 0x3c]
mov eax, ecx
shr eax, 8
mov edi, ecx
shr edi, 0x10
xor eax, edi
mov edi, ecx
shr edi, 0x18
xor eax, edi
xor ecx, eax
movzx ecx, cl
cmp edx, ecx
mov edx, 0
mov ecx, 1
cmove edx, ecx
mov byte [esi + 0xd], dl
mov edi, edx
test edi, edi
je 0x409789
cmp dword [esi + 8], 0
je 0x40977b
cmp dword [esi + 0x10], 0
je 0x40977b
cmp dword [esi + 0x38], 0
jne 0x40977f
cmp dword [esi + 0x3c], 0
jne 0x40977f
xor edx, edx
jmp 0x409784
mov edx, 1
mov byte [esi + 0xd], dl
mov edi, edx
mov byte [esi + 0x35], dl
test edi, edi
je 0x4097aa
mov ecx, dword [0x56e6d4]
mov edx, dword [esi + 0x40]
inc dword [0x56e718]
cmp edx, ecx
cmovge ecx, edx
mov dword [0x56e6d4], ecx
mov edx, dword [esp + 0x634]
add ebx, 0x4c
inc edx
cmp edx, dword [0x56e710]
mov dword [esp + 0x634], edx
jl 0x4090d1
mov esi, dword [esp + 0x630]
mov edi, dword [esp + 0x62c]
mov ebx, dword [esp + 0x64c]
jmp 0x4097e1
xor edi, edi
push ebx
call dword [sym.imp.MSVCR80.dll_fclose]
pop ecx
cmp eax, 0xffffffff
je 0x409972
dec dword [0x56e720]
cmp dword [0x56e718], 0
jne 0x40980b
mov eax, 0x14
test edi, edi
cmovg esi, eax
mov dword [0x56e72c], 1
mov eax, esi
add esp, 0x664
pop ebx
pop esi
pop edi
mov esp, ebp
pop ebp
ret
mov edi, dword [esp + 0x62c]
mov ebx, dword [esp + 0x64c]
mov byte [esi + 0xd], 0
mov esi, 0xf
jmp 0x4097e1
xor eax, eax
jmp 0x409673
movsx edx, byte [esi + 0xd]
mov edi, edx
jmp 0x4096f5
lea edx, [esp + 0x10]
push edx
call fcn.0042e230
movzx edx, ax
test edx, edx
jne 0x4096b5
mov dword [esp + 0x554], esi
mov dword [esp + 0x60c], ebx
lea esi, [esp + 0x10]
xor edx, edx
xor edi, edi
mov ebx, edx
movzx eax, word [edi*2 + 0x55b710]
push eax
push esi
call fcn.0042e410
movzx eax, ax
test eax, eax
jne 0x4098d3
lea eax, [esp + 0x42c]
push eax
push 0
push esi
call fcn.0042e5e0
movzx eax, ax
test eax, eax
jne 0x4098cb
movzx ecx, word [edi*2 + 0x55b710]
movzx eax, word [esp + 0x42c]
shl ecx, 0x10
or ecx, eax
mov dword [esp + ebx*4 + 0x560], ecx
inc ebx
cmp ebx, 0xa
jge 0x4098d9
push esi
call fcn.0042e500
jmp 0x40988b
inc edi
cmp edi, 5
jb 0x40987c
mov esi, dword [esp + 0x554]
mov edx, ebx
mov ebx, dword [esp + 0x60c]
test edx, edx
jle 0x4096b7
cmp edx, 4
jl 0x40993a
mov eax, edx
and eax, 3
neg eax
add eax, edx
xor ecx, ecx
movdqa xmm0, xmmword [esp + ecx*4 + 0x560]
movdqa xmmword [ecx*4 + 0x56cfc0], xmm0
add ecx, 4
cmp ecx, eax
jb 0x409901
cmp eax, edx
jae 0x4096b7
mov ecx, dword [esp + eax*4 + 0x560]
mov dword [eax*4 + 0x56cfc0], ecx
inc eax
cmp eax, edx
jb 0x409922
jmp 0x4096b7
xor eax, eax
jmp 0x40991a
mov edi, dword [esp + 0x62c]
mov ebx, dword [esp + 0x64c]
mov byte [esi + 0xd], 0
mov esi, 0xc
jmp 0x4097e1
mov edi, dword [esp + 0x62c]
mov ebx, dword [esp + 0x64c]
mov esi, 0xc
jmp 0x4097e1
push str.Close_file_failed.
push 9
call fcn.00423350
push str.Reason
call dword [sym.imp.MSVCR80.dll_perror]
add esp, 0xc
jmp 0x4097f2
mov esi, 0xc
jmp 0x409006