Function at 0x411b50
Capabilities:
Encrypt data using speck

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x30
mov ecx, dword [ebp + 0x14]
push ebx
xor ebx, ebx
mov dword [ebp - 0x30], 0xc
push esi
and ecx, 0x80
mov dword [ebp - 0x20], ebx
push ebx
pop eax
sete al
mov byte [ebp - 2], bl
mov dword [ebp - 0x28], eax
test ecx, ecx
mov dword [ebp - 0x2c], ebx
sete al
dec al
and al, 0x10
mov byte [ebp - 1], al
lea eax, [ebp - 0x20]
push eax
call fcn.00415527
pop ecx
test eax, eax
je 0x411ba4
push ebx
push ebx
push ebx
push ebx
push ebx
call fcn.0040aab8
add esp, 0x14
mov al, byte [ebp - 1]
mov esi, 0x8000
mov ecx, dword [ebp + 0x14]
mov byte [ebp - 1], al
test esi, ecx
jne 0x411bce
test ecx, 0x74000
jne 0x411bc6
mov byte [ebp - 1], al
cmp dword [ebp - 0x20], esi
je 0x411bce
mov dl, al
or dl, 0x80
mov byte [ebp - 1], dl
mov eax, ecx
and eax, 3
sub eax, ebx
je 0x411c37
sub eax, 1
je 0x411c13
sub eax, 1
je 0x411c0c
call fcn.0040aa27
mov dword [eax], ebx
mov eax, dword [ebp + 0xc]
or dword [eax], 0xffffffff
call fcn.0040aa5d
push 0x16
pop esi
push ebx
push ebx
push ebx
push ebx
push ebx
mov dword [eax], esi
call fcn.0040aab3
add esp, 0x14
mov eax, esi
jmp 0x4122b8
mov esi, 0xc0000000
jmp 0x411c3c
mov esi, ecx
and esi, 0x70000
neg esi
sbb esi, esi
neg esi
test cl, 8
setne al
movzx eax, al
and esi, eax
shl esi, 0x1f
add esi, 0x40000000
jmp 0x411c3c
mov esi, 0x80000000
mov eax, dword [ebp + 0x18]
push edi
push 0x10
pop edi
mov dword [ebp - 0x14], esi
push 2
pop edx
mov dword [ebp - 0x24], edx
sub eax, edi
je 0x411c7f
sub eax, edi
je 0x411c7a
sub eax, edi
je 0x411c76
sub eax, edi
je 0x411c71
sub eax, 0x40
jne 0x411cd9
cmp esi, 0x80000000
sete al
mov dword [ebp - 0xc], eax
mov edi, eax
jmp 0x411c84
push 3
pop edi
jmp 0x411c81
mov edi, edx
jmp 0x411c81
xor edi, edi
inc edi
jmp 0x411c81
mov edi, ebx
mov dword [ebp - 0xc], edi
mov eax, ecx
and eax, 0x700
cmp eax, 0x400
ja 0x411cc4
je 0x411cbb
test eax, eax
je 0x411cbb
cmp eax, 0x100
je 0x411cb2
cmp eax, 0x200
je 0x411d04
cmp eax, 0x300
jne 0x411cd9
mov dword [ebp - 0x10], edx
jmp 0x411d14
mov dword [ebp - 0x10], 4
jmp 0x411d14
mov dword [ebp - 0x10], 3
jmp 0x411d14
cmp eax, 0x500
je 0x411d0d
cmp eax, 0x600
je 0x411d04
cmp eax, 0x700
je 0x411d0d
call fcn.0040aa27
mov dword [eax], ebx
mov eax, dword [ebp + 0xc]
or dword [eax], 0xffffffff
call fcn.0040aa5d
push 0x16
pop esi
push ebx
push ebx
push ebx
push ebx
push ebx
mov dword [eax], esi
call fcn.0040aab3
add esp, 0x14
mov eax, esi
jmp 0x4122b7
mov dword [ebp - 0x10], 5
jmp 0x411d14
mov dword [ebp - 0x10], 1
mov edx, 0x100
mov eax, 0x80
mov dword [ebp - 8], eax
test edx, ecx
je 0x411d3e
mov eax, dword [0x41bf10]
not eax
and eax, dword [ebp + 0x1c]
test al, al
js 0x411d3b
xor eax, eax
inc eax
mov dword [ebp - 8], eax
jmp 0x411d3e
mov eax, dword [ebp - 8]
test cl, 0x40
je 0x411d5a
or eax, 0x4000000
or esi, 0x10000
or edi, 4
mov dword [ebp - 8], eax
mov dword [ebp - 0x14], esi
mov dword [ebp - 0xc], edi
test ecx, 0x1000
je 0x411d67
or eax, edx
mov dword [ebp - 8], eax
test cl, 0x20
je 0x411d73
or eax, 0x8000000
jmp 0x411d7d
test cl, 0x10
je 0x411d80
or eax, 0x10000000
mov dword [ebp - 8], eax
call fcn.004129cc
mov edi, dword [ebp + 0xc]
mov dword [edi], eax
cmp eax, 0xffffffff
jne 0x411db0
call fcn.0040aa27
mov dword [eax], ebx
or dword [edi], 0xffffffff
call fcn.0040aa5d
mov dword [eax], 0x18
call fcn.0040aa5d
mov eax, dword [eax]
jmp 0x4122b7
mov eax, dword [ebp + 8]
push ebx
push dword [ebp - 8]
push dword [ebp - 0x10]
mov dword [eax], 1
lea eax, [ebp - 0x30]
push eax
push dword [ebp - 0xc]
push esi
push dword [ebp + 0x10]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x18], eax
cmp eax, 0xffffffff
jne 0x411e47
mov ecx, 0xc0000000
mov eax, esi
and eax, ecx
cmp eax, ecx
jne 0x411e15
test byte [ebp + 0x14], 1
je 0x411e15
push ebx
push dword [ebp - 8]
lea eax, [ebp - 0x30]
and esi, 0x7fffffff
push dword [ebp - 0x10]
mov dword [ebp - 0x14], esi
push eax
push dword [ebp - 0xc]
push esi
push dword [ebp + 0x10]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x18], eax
cmp eax, 0xffffffff
jne 0x411e47
mov ecx, dword [edi]
mov eax, ecx
and ecx, 0x1f
sar eax, 5
imul ecx, ecx, 0x24
mov eax, dword [eax*4 + 0x41d980]
and byte [eax + ecx + 4], 0xfe
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.0040aa3a
pop ecx
call fcn.0040aa5d
mov ebx, dword [eax]
jmp 0x4122b5
push eax
call dword [sym.imp.KERNEL32.dll_GetFileType]
test eax, eax
jne 0x411e94
mov ecx, dword [edi]
mov eax, ecx
and ecx, 0x1f
sar eax, 5
imul ecx, ecx, 0x24
mov eax, dword [eax*4 + 0x41d980]
and byte [eax + ecx + 4], 0xfe
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
push esi
call fcn.0040aa3a
pop ecx
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test esi, esi
jne 0x411e3b
call fcn.0040aa5d
mov dword [eax], 0xd
jmp 0x411e3b
cmp eax, 2
jne 0x411e9f
or byte [ebp - 1], 0x40
jmp 0x411ea8
cmp eax, 3
jne 0x411ea8
or byte [ebp - 1], 8
push dword [ebp - 0x18]
push dword [edi]
call fcn.00412c9e
pop ecx
pop ecx
cmp eax, 0xffffffff
jne 0x411eca
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or eax, 0xffffffff
jmp 0x4122b7
mov ecx, dword [edi]
mov eax, ecx
mov dl, byte [ebp - 1]
and ecx, 0x1f
sar eax, 5
or dl, 1
imul ecx, ecx, 0x24
mov byte [ebp - 1], dl
mov eax, dword [eax*4 + 0x41d980]
mov byte [eax + ecx + 4], dl
mov ecx, dword [edi]
mov eax, ecx
sar eax, 5
and ecx, 0x1f
imul ecx, ecx, 0x24
mov eax, dword [eax*4 + 0x41d980]
and dword [eax + ecx + 8], 0xfffffffc
mov al, dl
mov ecx, dword [ebp + 0x14]
and al, 0xc8
cmp al, 0x80
jne 0x411f8c
test cl, 2
je 0x411f8c
push 2
push 0xffffffffffffffff
push dword [edi]
call fcn.0041531e
add esp, 0xc
mov dword [ebp - 0x1c], eax
cmp eax, 0xffffffff
jne 0x411f43
call fcn.0040aa27
cmp dword [eax], 0x83
je 0x411f86
push dword [edi]
call fcn.0040bf69
jmp 0x411e3a
push 1
lea eax, [ebp - 3]
mov byte [ebp - 3], bl
push eax
push dword [edi]
call fcn.00413c50
add esp, 0xc
test eax, eax
jne 0x411f75
cmp byte [ebp - 3], 0x1a
jne 0x411f75
mov eax, dword [ebp - 0x1c]
cdq
push edx
push eax
push dword [edi]
call fcn.00415168
add esp, 0xc
cmp eax, 0xffffffff
je 0x411f37
push ebx
push ebx
push dword [edi]
call fcn.0041531e
add esp, 0xc
cmp eax, 0xffffffff
je 0x411f37
mov dl, byte [ebp - 1]
mov ecx, dword [ebp + 0x14]
test dl, dl
jns 0x4121b8
test ecx, 0x74000
jne 0x411fb3
mov eax, dword [ebp - 0x20]
and eax, 0x74000
jne 0x411fae
or ecx, 0x4000
jmp 0x411fb0
or ecx, eax
mov dword [ebp + 0x14], ecx
mov eax, ecx
and eax, 0x74000
cmp eax, 0x4000
je 0x41200f
cmp eax, 0x10000
je 0x411ff7
cmp eax, 0x14000
je 0x411ff7
cmp eax, 0x20000
je 0x411ff1
cmp eax, 0x24000
je 0x411ff1
cmp eax, 0x40000
je 0x411feb
cmp eax, 0x44000
jne 0x412012
mov byte [ebp - 2], 1
jmp 0x412012
mov byte [ebp - 2], 2
jmp 0x412012
mov eax, ecx
and eax, 0x301
cmp eax, 0x301
setne al
dec al
and al, 2
mov byte [ebp - 2], al
jmp 0x412012
mov byte [ebp - 2], bl
test ecx, 0x70000
je 0x4121b8
mov dword [ebp - 0x1c], ebx
test dl, 0x40
jne 0x4121b8
mov eax, 0xc0000000
and esi, eax
cmp esi, 0x40000000
je 0x41212e
cmp esi, 0x80000000
je 0x41209b
cmp esi, eax
jne 0x4121b8
mov eax, dword [ebp - 0x10]
push 2
pop ecx
cmp eax, ecx
jbe 0x41216e
cmp eax, 4
jbe 0x41206e
cmp eax, 5
je 0x41216e
jmp 0x4121b8
push ecx
push ebx
push ebx
push dword [edi]
call fcn.004154a4
add esp, 0x10
or eax, edx
je 0x41216b
push ebx
push ebx
push ebx
push dword [edi]
call fcn.004154a4
and eax, edx
add esp, 0x10
cmp eax, 0xffffffff
je 0x411f37
push 3
lea eax, [ebp - 0x1c]
push eax
push dword [edi]
call fcn.00413c50
mov ecx, eax
add esp, 0xc
cmp ecx, 0xffffffff
je 0x411f37
mov edx, dword [ebp - 0x1c]
push 2
pop eax
cmp ecx, eax
je 0x4120d6
cmp ecx, 3
jne 0x412120
cmp edx, 0xbfbbef
jne 0x4120d6
mov byte [ebp - 2], 1
jmp 0x4121b8
movzx ecx, dx
cmp ecx, 0xfffe
jne 0x4120fa
push dword [edi]
call fcn.0040bf69
pop ecx
call fcn.0040aa5d
push 0x16
pop esi
mov ebx, esi
mov dword [eax], esi
jmp 0x4122b5
cmp ecx, 0xfeff
jne 0x412120
push ebx
push eax
push dword [edi]
call fcn.0041531e
add esp, 0xc
cmp eax, 0xffffffff
je 0x411f37
mov byte [ebp - 2], 2
jmp 0x4121b8
push ebx
push ebx
push dword [edi]
call fcn.0041531e
add esp, 0xc
jmp 0x412161
mov eax, dword [ebp - 0x10]
push 2
pop ecx
cmp eax, ecx
jbe 0x41216e
cmp eax, 4
ja 0x412060
push ecx
push ebx
push ebx
push dword [edi]
call fcn.004154a4
add esp, 0x10
or eax, edx
je 0x41216b
push ebx
push ebx
push ebx
push dword [edi]
call fcn.004154a4
add esp, 0x10
and eax, edx
cmp eax, 0xffffffff
jne 0x4121b8
jmp 0x411f37
push 2
pop ecx
movzx eax, byte [ebp - 2]
mov esi, ebx
sub eax, 1
je 0x412185
sub eax, 1
jne 0x4121b8
mov eax, 0xfeff
jmp 0x412190
push 3
pop ecx
mov dword [ebp - 0x24], ecx
mov eax, 0xbfbbef
mov dword [ebp - 0x1c], eax
sub ecx, esi
lea eax, [ebp - 0x1c]
push ecx
add eax, esi
push eax
push dword [edi]
call fcn.00412e45
add esp, 0xc
cmp eax, 0xffffffff
je 0x411f37
mov ecx, dword [ebp - 0x24]
add esi, eax
cmp ecx, esi
jg 0x412193
mov ecx, dword [edi]
mov eax, ecx
and ecx, 0x1f
sar eax, 5
imul esi, ecx, 0x24
mov edx, dword [eax*4 + 0x41d980]
movzx eax, byte [ebp - 2]
mov ecx, dword [edx + esi + 8]
and ecx, 0xfffffffc
or ecx, eax
mov dword [edx + esi + 8], ecx
mov ecx, dword [edi]
mov eax, ecx
sar eax, 5
and ecx, 0x1f
imul edx, ecx, 0x24
mov ecx, dword [eax*4 + 0x41d980]
mov eax, dword [ebp + 0x14]
shr eax, 0xd
xor eax, dword [ecx + edx + 8]
and eax, 8
xor dword [ecx + edx + 8], eax
test byte [ebp - 1], 0x48
mov ecx, dword [ebp + 0x14]
jne 0x41222c
test cl, 8
je 0x41222c
mov ecx, dword [edi]
mov eax, ecx
and ecx, 0x1f
sar eax, 5
imul ecx, ecx, 0x24
mov eax, dword [eax*4 + 0x41d980]
or byte [eax + ecx + 4], 0x20
mov ecx, dword [ebp + 0x14]
mov esi, dword [ebp - 0x14]
mov edx, 0xc0000000
mov eax, esi
and eax, edx
cmp eax, edx
jne 0x4122b5
test cl, 1
je 0x4122b5
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
push dword [ebp - 8]
lea eax, [ebp - 0x30]
and esi, 0x7fffffff
push 3
push eax
push dword [ebp - 0xc]
push esi
push dword [ebp + 0x10]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
jne 0x41229e
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.0040aa3a
mov ecx, dword [edi]
mov eax, ecx
and ecx, 0x1f
sar eax, 5
imul ecx, ecx, 0x24
mov eax, dword [eax*4 + 0x41d980]
and byte [eax + ecx + 4], 0xfe
push dword [edi]
call fcn.00412b96
pop ecx
jmp 0x411e3a
mov edx, dword [edi]
mov ecx, edx
sar ecx, 5
and edx, 0x1f
imul edx, edx, 0x24
mov ecx, dword [ecx*4 + 0x41d980]
mov dword [edx + ecx], eax
mov eax, ebx
pop edi
pop esi
pop ebx
leave
ret