Function at 0x405260
Capabilities:
Encrypt data using speck

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x2c
mov edx, dword [ebp + 8]
mov byte [ebp - 0xd], 0
mov edi, dword [ebp + 0xc]
mov esi, dword [ebp + 0xc]
mov byte [ebp - 0xe], 0x20
mov ecx, dword [0x4a49e8]
mov ebx, dword [0x873700]
movsx eax, word [ecx + 0x1b6]
mov dword [ebp - 0x18], eax
lea eax, [edx + edx*4]
mov edx, eax
shl edx, 5
add eax, edx
mov edx, dword [0x8730e0]
add eax, edi
movsx edx, word [edx + eax*2]
mov dword [ebp - 0x14], edx
movzx eax, byte [eax + ebx]
mov byte [ebp - 0x19], 0
mov byte [ebp - 0x1a], 0
mov byte [ebp - 0xf], al
mov eax, dword [ebp + 8]
shl eax, 8
add eax, esi
mov esi, dword [0x4f3b70]
cmp byte [ecx + 0x3a6], 0
movzx edi, word [esi + eax*2]
jne 0x405300
cmp word [ecx + 0x1c0], 0
jne 0x4055e0
cmp byte [ecx + 0x3a6], 0
jne 0x405300
cmp word [ecx + 0x1c0], 0
je 0x405300
mov byte [ebp - 0x1a], 1
nop
lea esi, [esi]
mov eax, dword [ebp + 0xc]
or eax, dword [ebp + 8]
js 0x405413
movzx eax, byte [ecx + 0x46c]
cmp eax, dword [ebp + 8]
jle 0x405413
movzx eax, byte [ecx + 0x46d]
cmp eax, dword [ebp + 0xc]
jle 0x405413
cmp word [ebp - 0x18], 0
setne al
xor edx, edx
cmp byte [ebp - 0xf], 0x3e
setbe dl
test edx, eax
je 0x40535a
movzx edx, word [0x4f1690]
lea eax, [edx - 1]
test dx, dx
mov word [0x4f1690], ax
jle 0x405990
cmp byte [ebp - 0x19], 0
jne 0x405413
mov edx, dword [ebp + 8]
lea eax, [edx + edx*4]
mov edx, eax
shl edx, 5
add eax, edx
mov edx, dword [ebp + 0xc]
add eax, edx
mov dword [ebp - 0x20], eax
movzx eax, byte [eax + ebx]
cmp al, 1
je 0x4053a0
sub al, 0x10
cmp al, 0xc
ja 0x405790
mov eax, dword [ebp + 8]
mov edx, dword [ebp + 0xc]
shl eax, 8
add eax, edx
test byte [esi + eax*2], 0x20
je 0x405790
test edi, 1
jne 0x4053b0
test edi, 0x200
je 0x405413
mov edx, dword [0x4d8f10]
mov esi, dword [ebp - 0x20]
add edx, 0x10
movzx eax, byte [edx + 0xe]
and edi, 0x200
mov byte [ebp - 0xd], al
movzx ebx, byte [edx + 0xf]
mov byte [ebp - 0xe], bl
mov eax, dword [0x8733d0]
movsx edx, word [eax + esi*2]
jne 0x405427
cmp word [ecx + 0x1ae], 0
setne al
test edx, edx
setle dl
or eax, edx
test al, 1
je 0x4059f0
mov eax, dword [0x4f33b0]
cmp eax, 3
jg 0x405ae0
cmp eax, 2
jl 0x40577e
inc bl
mov byte [ebp - 0xe], bl
jmp 0x405427
mov edx, dword [0x4d8f10]
movzx eax, byte [edx + 0xe]
mov byte [ebp - 0xd], al
movzx eax, byte [edx + 0xf]
mov byte [ebp - 0xe], al
movzx eax, byte [ebp - 0xd]
mov edx, dword [ebp + 0x18]
mov byte [edx], al
mov eax, dword [ebp + 0x1c]
movzx ecx, byte [ebp - 0xe]
mov byte [eax], cl
cmp byte [ebp - 0xf], 1
je 0x405678
cmp word [ebp - 0x14], 0
setg dl
xor byte [ebp - 0x19], 1
movzx eax, byte [ebp - 0x19]
test eax, edx
je 0x405496
mov esi, dword [ebp - 0x14]
mov eax, dword [0x4f3b80]
mov ebx, dword [0x4f2a70]
shl esi, 6
add esi, eax
movsx eax, word [esi]
cmp byte [esi + 0x24], 0
lea edx, [eax + eax*4]
lea edx, [eax + edx*4]
lea ecx, [ebx + edx*4]
jne 0x4054d6
movzx ecx, byte [ebp - 0xe]
movzx eax, byte [ebp - 0xd]
mov edx, dword [ebp + 0x10]
mov byte [edx], al
mov eax, dword [ebp + 0x14]
mov byte [eax], cl
add esp, 0x2c
pop ebx
pop esi
pop edi
pop ebp
ret
cmp word [ebp - 0x14], 0
jns 0x40547c
cmp byte [0x873400], 0
mov ebx, dword [0x4f2a70]
je 0x405858
movzx eax, byte [ebx + 0x50]
mov byte [ebp - 0xd], al
mov edx, dword [ebp + 0x10]
movzx eax, byte [ebx + 0x51]
mov cl, al
mov byte [ebp - 0xe], al
movzx eax, byte [ebp - 0xd]
mov byte [edx], al
mov eax, dword [ebp + 0x14]
mov byte [eax], cl
add esp, 0x2c
pop ebx
pop esi
pop edi
pop ebp
ret
mov edi, dword [ebp - 0x18]
test edi, edi
jne 0x4055f5
movzx ebx, byte [ecx + 0x50]
movzx eax, byte [ecx + 0x51]
mov edx, ebx
shr edx, 7
mov byte [ebp - 0x21], al
movsx eax, al
shr eax, 0x1f
test edx, eax
jne 0x405620
mov eax, dword [ecx + 0x24]
test al, al
jns 0x40572c
movzx ecx, byte [ecx + 0x4e]
cmp cl, 1
je 0x4055ba
cmp cl, 4
sete al
cmp cl, 0xc
sete dl
or eax, edx
test al, 1
jne 0x405762
cmp cl, 6
sete al
cmp cl, 0xe
sete dl
or eax, edx
test al, 1
jne 0x405924
cmp cl, 9
je 0x405974
cmp cl, 5
sete al
cmp cl, 0xd
sete dl
or eax, edx
test al, 1
jne 0x4059d4
cmp cl, 7
sete al
cmp cl, 0xf
sete dl
or eax, edx
test al, 1
jne 0x405aa0
cmp cl, 3
sete al
cmp cl, 0xb
sete dl
or eax, edx
test al, 1
jne 0x405abc
cmp cl, 8
sete al
cmp cl, 2
sete dl
or eax, edx
test al, 1
jne 0x405ae8
cmp cl, 0xa
sete al
cmp cl, 0x1a
sete dl
or eax, edx
test al, 1
jne 0x405b04
mov dword [esp], 0xf
call fcn.00495580
inc al
movzx eax, al
mov byte [ebp - 0xd], al
movzx eax, byte [ebp - 0x21]
mov cl, al
mov byte [ebp - 0xe], al
jmp 0x40562c
test edi, 0x200
jne 0x4052e1
mov byte [ebp - 0x19], 1
jmp 0x4052e1
movsx eax, word [esi + 2]
lea edx, [eax + eax*4]
lea edx, [eax + edx*4]
lea ecx, [ebx + edx*4]
movzx ebx, byte [ecx + 0x50]
movzx eax, byte [ecx + 0x51]
mov edx, ebx
shr edx, 7
mov byte [ebp - 0x21], al
movsx eax, al
shr eax, 0x1f
test edx, eax
je 0x4054ff
mov byte [ebp - 0xd], bl
movzx edx, byte [ebp - 0x21]
mov cl, dl
mov byte [ebp - 0xe], dl
cmp byte [ebp - 0x1a], 0
je 0x405636
mov byte [ebp - 0xd], 4
cmp byte [0x4c5a89], 0
je 0x405480
mov eax, dword [0x4f33b0]
test eax, eax
je 0x405655
cmp eax, 4
jne 0x405480
mov eax, dword [0x4a49ec]
cmp byte [eax + 0x7d], 0
je 0x405480
cmp word [esi + 0xa], 0
jns 0x405480
add byte [ebp - 0xd], 0x40
jmp 0x405480
mov eax, dword [ebp + 0xc]
mov dword [esp + 4], eax
mov edx, dword [ebp + 8]
mov dword [esp], edx
call fcn.00467100
jmp 0x405698
mov dword [esp], ebx
call fcn.00467140
test eax, eax
mov ebx, eax
je 0x405443
cmp byte [eax + 0x20], 0
movzx edx, byte [ebp - 0x19]
setne al
xor dl, 1
movzx edx, dl
test edx, eax
je 0x405690
mov ecx, dword [0x4a49e8]
cmp word [ecx + 0x1b6], 0
je 0x40588d
movsx eax, word [ebx + 2]
mov esi, dword [0x4f33c0]
lea eax, [eax + eax*8]
lea edx, [eax*8]
movzx eax, word [edx + esi + 0x40]
test ax, ax
jne 0x405877
movzx eax, byte [edx + esi + 0x3d]
mov byte [ebp - 0xd], al
cmp word [ecx + 0x1b6], 0
je 0x4058f0
movsx eax, word [ebx + 2]
lea eax, [eax + eax*8]
lea edx, [eax*8]
movzx eax, word [edx + esi + 0x40]
test ax, ax
jne 0x405903
movzx eax, byte [edx + esi + 0x3e]
mov byte [ebp - 0xe], al
jmp 0x405443
test al, 0x50
je 0x405620
cmp byte [ebp - 0xd], 0
js 0x40591c
movzx ecx, byte [ebp - 0xe]
test cl, cl
js 0x40591c
test al, 0x10
je 0x405623
test al, 0x40
jne 0x40562c
mov byte [ebp - 0xd], bl
jmp 0x40562c
mov dword [esp], 2
call fcn.00495580
cmp eax, 1
sbb eax, eax
and eax, 0xfffffff8
add eax, 0xc
jmp 0x4055cb
test eax, eax
jne 0x405427
mov byte [ebp - 0xd], 0x10
jmp 0x405427
test edi, 1
je 0x405413
movzx eax, byte [ebp - 0xf]
mov edx, dword [0x4d8f10]
shl eax, 4
movzx eax, byte [eax + edx + 8]
movzx esi, al
mov byte [ebp - 0xf], al
mov eax, esi
shl eax, 4
lea edx, [eax + edx]
and edi, 0x200
movzx eax, byte [edx + 0xe]
mov byte [ebp - 0xd], al
movzx ebx, byte [edx + 0xf]
mov byte [ebp - 0xe], bl
jne 0x405808
cmp word [ecx + 0x1ae], 0
je 0x405a55
mov eax, dword [0x4f33b0]
cmp eax, 3
jg 0x405a24
cmp eax, 2
jl 0x405b20
mov dword [esp], esi
call fcn.004051a0
test al, al
je 0x405808
inc bl
mov byte [ebp - 0xe], bl
cmp byte [0x4c5a89], 0
je 0x405427
mov eax, dword [0x4f33b0]
test eax, eax
je 0x405827
cmp eax, 4
jne 0x405427
mov ecx, dword [0x4a49ec]
cmp byte [ecx + 0x7f], 0
je 0x405a75
movzx eax, byte [ebp - 0xe]
cmp al, 0x23
sete dl
cmp al, 0x25
sete al
or eax, edx
test al, 1
je 0x405a75
add byte [ebp - 0xd], 0x40
jmp 0x405427
mov edx, dword [0x4a49e8]
movsx eax, word [edx + 0x30]
mov dword [esp + 4], eax
movsx eax, word [edx + 0x32]
mov dword [esp], eax
call fcn.0048b390
jmp 0x4054b4
mov edx, dword [0x4f5a00]
movzx eax, ax
lea eax, [eax + eax*2]
movzx eax, byte [edx + eax*4 + 8]
jmp 0x4056f2
movsx eax, word [ebx]
mov esi, dword [0x4f33c0]
lea eax, [eax + eax*8]
movzx eax, word [esi + eax*8 + 0x40]
test ax, ax
jne 0x405877
mov dword [esp], ebx
call fcn.0048b9e0
test al, al
jne 0x405a42
movzx eax, byte [ebx + 0xe]
test al, al
je 0x4058d4
movzx eax, al
mov edx, dword [0x873500]
imul eax, eax, 0x5c
movzx eax, byte [eax + edx + 0x4e]
test al, al
jne 0x405a44
movsx eax, word [ebx]
mov esi, dword [0x4f33c0]
mov ecx, dword [0x4a49e8]
lea eax, [eax + eax*8]
movzx eax, byte [esi + eax*8 + 0x3d]
jmp 0x4056f2
movzx ecx, word [ebx]
movsx eax, cx
lea eax, [eax + eax*8]
movzx eax, word [esi + eax*8 + 0x40]
test ax, ax
je 0x405940
mov edx, dword [0x4f5a00]
movzx eax, ax
lea eax, [eax + eax*2]
movzx eax, byte [edx + eax*4 + 9]
mov byte [ebp - 0xe], al
jmp 0x405443
mov byte [ebp - 0xd], bl
jmp 0x4055ce
mov dword [esp], 2
call fcn.00495580
cmp eax, 1
sbb eax, eax
and eax, 0xfffffff8
add eax, 0xe
jmp 0x4055cb
movzx eax, byte [ebx + 0xe]
test al, al
je 0x405961
movzx eax, al
mov edx, dword [0x873500]
imul eax, eax, 0x5c
movzx eax, byte [eax + edx + 0x4f]
test al, al
jne 0x405724
movsx eax, cx
lea eax, [eax + eax*8]
movzx eax, byte [esi + eax*8 + 0x3e]
mov byte [ebp - 0xe], al
jmp 0x405443
mov dword [esp], 2
call fcn.00495580
cmp eax, 1
sbb eax, eax
and eax, 0xfffffff8
add eax, 9
jmp 0x4055cb
mov dword [esp], 0xc8
call fcn.00495580
inc eax
mov ecx, dword [ebp + 0xc]
mov edx, dword [0x4f3b70]
mov word [0x4f1690], ax
mov eax, dword [ebp + 8]
shl eax, 8
add eax, ecx
test byte [edx + eax*2 + 1], 2
je 0x405427
call fcn.00405170
movzx eax, ax
mov edx, eax
sar edx, 8
mov byte [ebp - 0xd], dl
jmp 0x405424
mov dword [esp], 2
call fcn.00495580
cmp eax, 1
sbb eax, eax
and eax, 0xfffffff8
add eax, 0xd
jmp 0x4055cb
mov eax, dword [0x4f33b0]
cmp eax, 3
jg 0x405ad8
cmp eax, 2
jge 0x40540c
test eax, eax
jne 0x405427
movzx eax, byte [ebp - 0xd]
movzx edx, byte [ebp - 0xe]
call fcn.00405200
mov byte [ebp - 0xd], al
jmp 0x405427
cmp eax, 4
jne 0x405808
movzx eax, byte [ebp - 0xd]
movzx edx, byte [ebp - 0xe]
call fcn.00405200
mov byte [ebp - 0xd], al
jmp 0x405808
mov al, 0xe
mov ecx, dword [0x4a49e8]
mov esi, dword [0x4f33c0]
jmp 0x4056f2
mov eax, dword [0x4f33b0]
cmp eax, 3
jg 0x405a24
cmp eax, 2
jl 0x405b20
mov dword [esp], esi
call fcn.004051a0
jmp 0x4057ff
cmp byte [ecx + 0x7e], 0
je 0x405427
movzx eax, byte [ebp - 0xe]
cmp al, 0x23
sete dl
cmp al, 0x25
sete al
or eax, edx
test al, 1
je 0x405427
add byte [ebp - 0xd], 0x20
jmp 0x405427
mov dword [esp], 2
call fcn.00495580
cmp eax, 1
sbb eax, eax
and eax, 0xfffffff8
add eax, 0xf
jmp 0x4055cb
mov dword [esp], 2
call fcn.00495580
cmp eax, 1
sbb eax, eax
and eax, 0xfffffff8
add eax, 0xb
jmp 0x4055cb
cmp eax, 4
jmp 0x405a09
cmp eax, 4
jmp 0x405780
mov dword [esp], 2
call fcn.00495580
cmp eax, 1
sbb eax, eax
and eax, 6
add eax, 2
jmp 0x4055cb
mov dword [esp], 2
call fcn.00495580
cmp eax, 1
sbb eax, eax
and eax, 0xfffffff0
add eax, 0x1a
jmp 0x4055cb
test eax, eax
jmp 0x405a27