Function at 0x40a64f
Capabilities:
Encrypt data using speck

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x28
push ebx
push esi
xor ebx, ebx
test byte [ebp + 0x10], 0x80
push edi
push 0x10
mov esi, eax
mov dword [ebp - 0x14], ebx
mov dword [ebp - 0x18], ebx
mov byte [ebp - 2], bl
mov dword [ebp - 0x28], 0xc
mov dword [ebp - 0x24], ebx
pop edi
je 0x40a681
mov dword [ebp - 0x20], ebx
mov byte [ebp - 1], 0x10
jmp 0x40a68b
mov dword [ebp - 0x20], 1
mov byte [ebp - 1], bl
lea eax, [ebp - 0x14]
push eax
call fcn.0040d1c5
test eax, eax
pop ecx
je 0x40a6a6
push ebx
push ebx
push ebx
push ebx
push ebx
call fcn.00404d6d
sub esp, 0xffffffec
lea eax, [ebp - 0x18]
push eax
call fcn.004048b5
test eax, eax
pop ecx
je 0x40a6c1
push ebx
push ebx
push ebx
push ebx
push ebx
call fcn.00404d6d
add esp, 0x14
mov edx, 0x8000
test dword [ebp + 0x10], edx
jne 0x40a6dd
test dword [ebp + 0x10], 0x74000
jne 0x40a6d9
cmp dword [ebp - 0x14], edx
je 0x40a6dd
or byte [ebp - 1], 0x80
mov eax, dword [ebp + 0x10]
push 3
pop edx
and eax, edx
sub eax, ebx
mov ecx, 0x80000000
je 0x40a72c
dec eax
je 0x40a723
dec eax
je 0x40a71a
call fcn.00404edb
mov dword [eax], ebx
or dword [esi], 0xffffffff
call fcn.00404ec8
push 0x16
pop edi
push ebx
push ebx
push ebx
push ebx
push ebx
mov dword [eax], edi
call fcn.00404e69
sub esp, 0xffffffec
jmp 0x40aba9
mov dword [ebp - 0xc], 0xc0000000
jmp 0x40a72f
mov dword [ebp - 0xc], 0x40000000
jmp 0x40a72f
mov dword [ebp - 0xc], ecx
mov eax, dword [ebp + 0x14]
sub eax, edi
je 0x40a76b
sub eax, edi
je 0x40a762
sub eax, edi
je 0x40a759
sub eax, edi
je 0x40a754
sub eax, 0x40
jne 0x40a6f4
xor eax, eax
cmp dword [ebp - 0xc], ecx
sete al
mov dword [ebp - 8], eax
jmp 0x40a76e
mov dword [ebp - 8], edx
jmp 0x40a76e
mov dword [ebp - 8], 2
jmp 0x40a76e
mov dword [ebp - 8], 1
jmp 0x40a76e
mov dword [ebp - 8], ebx
mov eax, dword [ebp + 0x10]
mov edx, 0x700
and eax, edx
mov ecx, 0x400
cmp eax, ecx
jg 0x40a7bf
je 0x40a7b6
cmp eax, ebx
je 0x40a7b6
cmp eax, 0x100
je 0x40a7ad
cmp eax, 0x200
je 0x40a831
cmp eax, 0x300
jne 0x40a6f4
mov dword [ebp - 0x10], 2
jmp 0x40a7dc
mov dword [ebp - 0x10], 4
jmp 0x40a7dc
mov dword [ebp - 0x10], 3
jmp 0x40a7dc
cmp eax, 0x500
je 0x40a7d5
cmp eax, 0x600
je 0x40a831
cmp eax, edx
jne 0x40a6f4
mov dword [ebp - 0x10], 1
mov ecx, dword [ebp + 0x10]
mov eax, 0x100
test eax, ecx
mov edi, 0x80
je 0x40a7ff
mov edx, dword [0x413dd4]
not edx
and edx, dword [ebp + 0x18]
or dl, dl
js 0x40a7ff
xor edi, edi
inc edi
test cl, 0x40
je 0x40a81b
or dword [ebp - 0xc], 0x10000
or edi, 0x4000000
cmp dword [ebp - 0x18], 2
jne 0x40a81b
or dword [ebp - 8], 4
test cx, 0x1000
je 0x40a824
or edi, eax
test cl, 0x20
je 0x40a83a
or edi, 0x8000000
jmp 0x40a845
mov dword [ebp - 0x10], 5
jmp 0x40a7dc
test cl, 0x10
je 0x40a845
or edi, 0x10000000
call fcn.0040a330
cmp eax, 0xffffffff
mov dword [esi], eax
jne 0x40a868
call fcn.00404edb
mov dword [eax], ebx
or dword [esi], 0xffffffff
call fcn.00404ec8
mov dword [eax], 0x18
jmp 0x40a8b8
mov eax, dword [ebp + 8]
push ebx
push edi
push dword [ebp - 0x10]
mov dword [eax], 1
lea eax, [ebp - 0x28]
push eax
push dword [ebp - 8]
push dword [ebp - 0xc]
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
jne 0x40a8c4
mov esi, dword [esi]
mov eax, esi
and esi, 0x1f
imul esi, esi, 0x28
sar eax, 5
mov eax, dword [eax*4 + 0x414860]
lea eax, [eax + esi + 4]
and byte [eax], 0xfe
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.00404eee
pop ecx
call fcn.00404ec8
mov eax, dword [eax]
jmp 0x40ac88
push edi
call dword [sym.imp.KERNEL32.dll_GetFileType]
cmp eax, ebx
jne 0x40a8f3
mov esi, dword [esi]
mov eax, esi
and esi, 0x1f
imul esi, esi, 0x28
sar eax, 5
mov eax, dword [eax*4 + 0x414860]
lea eax, [eax + esi + 4]
and byte [eax], 0xfe
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40a8ab
cmp eax, 2
jne 0x40a8fe
or byte [ebp - 1], 0x40
jmp 0x40a907
cmp eax, 3
jne 0x40a907
or byte [ebp - 1], 8
push edi
push dword [esi]
call fcn.0040a0ff
mov eax, dword [esi]
mov edx, eax
and eax, 0x1f
imul eax, eax, 0x28
sar edx, 5
mov edx, dword [edx*4 + 0x414860]
pop ecx
pop ecx
mov cl, byte [ebp - 1]
or cl, 1
mov byte [edx + eax + 4], cl
mov eax, dword [esi]
mov edx, eax
and eax, 0x1f
imul eax, eax, 0x28
sar edx, 5
mov edx, dword [edx*4 + 0x414860]
lea eax, [edx + eax + 0x24]
and byte [eax], 0x80
mov byte [ebp - 3], cl
and byte [ebp - 3], 0x48
mov byte [ebp - 1], cl
jne 0x40a9da
test cl, 0x80
je 0x40ac14
test byte [ebp + 0x10], 2
je 0x40a9da
push 2
or edi, 0xffffffff
push edi
push dword [esi]
call fcn.00408457
add esp, 0xc
cmp eax, edi
mov dword [ebp - 8], eax
jne 0x40a999
call fcn.00404edb
cmp dword [eax], 0x83
je 0x40a9da
push dword [esi]
call fcn.004052b6
jmp 0x40a8b7
push 1
lea eax, [ebp - 4]
push eax
push dword [esi]
mov byte [ebp - 4], bl
call fcn.00406bbe
sub esp, 0xfffffff4
test eax, eax
jne 0x40a9ca
cmp byte [ebp - 4], 0x1a
jne 0x40a9ca
mov eax, dword [ebp - 8]
cdq
push edx
push eax
push dword [esi]
call fcn.0040cf55
sub esp, 0xfffffff4
cmp eax, edi
je 0x40a98d
push ebx
push ebx
push dword [esi]
call fcn.00408457
sub esp, 0xfffffff4
cmp eax, edi
je 0x40a98d
test byte [ebp - 1], 0x80
je 0x40ac14
mov ecx, 0x74000
test dword [ebp + 0x10], ecx
mov edi, 0x4000
jne 0x40aa02
mov eax, dword [ebp - 0x14]
and eax, ecx
jne 0x40a9ff
or dword [ebp + 0x10], edi
jmp 0x40aa02
or dword [ebp + 0x10], eax
mov eax, dword [ebp + 0x10]
and eax, ecx
cmp eax, edi
je 0x40aa4f
cmp eax, 0x10000
je 0x40aa3b
cmp eax, 0x14000
je 0x40aa3b
cmp eax, 0x20000
je 0x40aa49
cmp eax, 0x24000
je 0x40aa49
cmp eax, 0x40000
je 0x40aa35
cmp eax, 0x44000
jne 0x40aa52
mov byte [ebp - 2], 1
jmp 0x40aa52
mov eax, dword [ebp + 0x10]
mov edi, 0x301
and eax, edi
cmp eax, edi
jne 0x40aa52
mov byte [ebp - 2], 2
jmp 0x40aa52
mov byte [ebp - 2], bl
test dword [ebp + 0x10], 0x70000
je 0x40ac14
test byte [ebp - 1], 0x40
mov dword [ebp - 8], ebx
jne 0x40ac14
mov eax, dword [ebp - 0xc]
mov ecx, 0xc0000000
and eax, ecx
cmp eax, 0x40000000
je 0x40ab38
cmp eax, 0x80000000
je 0x40aaff
cmp eax, ecx
jne 0x40ac14
mov eax, dword [ebp - 0x10]
cmp eax, ebx
jbe 0x40ac14
cmp eax, 2
jbe 0x40aaae
cmp eax, 4
jbe 0x40aad5
cmp eax, 5
jne 0x40ac14
movsx eax, byte [ebp - 2]
xor edi, edi
dec eax
je 0x40abe1
dec eax
jne 0x40ac14
mov dword [ebp - 8], 0xfeff
mov dword [ebp - 0x10], 2
jmp 0x40abef
push 2
push ebx
push ebx
push dword [esi]
call fcn.0040b25b
sub esp, 0xfffffff0
or eax, edx
je 0x40aaae
push ebx
push ebx
push ebx
push dword [esi]
call fcn.0040b25b
and eax, edx
sub esp, 0xfffffff0
cmp eax, 0xffffffff
je 0x40a98d
push 3
lea eax, [ebp - 8]
push eax
push dword [esi]
call fcn.00406bbe
add esp, 0xc
cmp eax, 0xffffffff
je 0x40a98d
cmp eax, 2
je 0x40ab88
cmp eax, 3
jne 0x40abd3
cmp dword [ebp - 8], 0xbfbbef
jne 0x40ab88
mov byte [ebp - 2], 1
jmp 0x40ac14
mov eax, dword [ebp - 0x10]
cmp eax, ebx
jbe 0x40ac14
cmp eax, 2
jbe 0x40aaae
cmp eax, 4
ja 0x40aaa5
push 2
push ebx
push ebx
push dword [esi]
call fcn.0040b25b
sub esp, 0xfffffff0
or eax, edx
je 0x40aaae
push ebx
push ebx
push ebx
push dword [esi]
call fcn.0040b25b
sub esp, 0xfffffff0
and eax, edx
cmp eax, 0xffffffff
jne 0x40ac14
jmp 0x40a98d
mov eax, dword [ebp - 8]
and eax, 0xffff
cmp eax, 0xfffe
jne 0x40abb0
push dword [esi]
call fcn.004052b6
pop ecx
call fcn.00404ec8
push 0x16
pop edi
mov dword [eax], edi
mov eax, edi
jmp 0x40ac88
cmp eax, 0xfeff
jne 0x40abd3
push ebx
push 2
push dword [esi]
call fcn.00408457
sub esp, 0xfffffff4
cmp eax, 0xffffffff
je 0x40a98d
mov byte [ebp - 2], 2
jmp 0x40ac14
push ebx
push ebx
push dword [esi]
call fcn.00408457
add esp, 0xc
jmp 0x40ab7a
mov dword [ebp - 8], 0xbfbbef
mov dword [ebp - 0x10], 3
mov eax, dword [ebp - 0x10]
sub eax, edi
push eax
lea eax, [ebp + edi - 8]
push eax
push dword [esi]
call fcn.00408cd5
add esp, 0xc
cmp eax, 0xffffffff
je 0x40a98d
add edi, eax
cmp dword [ebp - 0x10], edi
jg 0x40abef
mov edi, dword [esi]
mov eax, edi
and edi, 0x1f
imul edi, edi, 0x28
sar eax, 5
mov eax, dword [eax*4 + 0x414860]
lea edi, [eax + edi + 0x24]
mov al, byte [edi]
xor al, byte [ebp - 2]
and al, 0x7f
xor byte [edi], al
mov edi, dword [esi]
mov eax, edi
and edi, 0x1f
imul edi, edi, 0x28
sar eax, 5
mov eax, dword [eax*4 + 0x414860]
lea edi, [eax + edi + 0x24]
mov ecx, dword [ebp + 0x10]
mov dl, byte [edi]
shr ecx, 0x10
shl cl, 7
and dl, 0x7f
or cl, dl
cmp byte [ebp - 3], bl
mov byte [edi], cl
jne 0x40ac86
test byte [ebp + 0x10], 8
je 0x40ac86
mov esi, dword [esi]
mov edi, esi
and esi, 0x1f
imul esi, esi, 0x28
sar edi, 5
mov edi, dword [edi*4 + 0x414860]
lea edi, [edi + esi + 4]
or byte [edi], 0x20
mov eax, ebx
pop edi
pop esi
pop ebx
leave
ret