Function at 0x401ec0
Capabilities:
Encrypt data using speck

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14
push ebx
push esi
push edi
mov dword [ebp - 0xc], 0xc6
mov eax, dword [ebp - 0xc]
and eax, 0xffff
mov ecx, dword [ebp - 0xc]
and ecx, 0xffff
xor edx, edx
div ecx
mov ecx, eax
mov esi, dword [ebp - 0xc]
and esi, 0xffff
mov eax, 0x3a
xor edx, edx
div esi
or ecx, edx
mov dword [ebp - 4], ecx
mov eax, dword [ebp - 0xc]
and eax, 0xffff
mov ecx, dword [ebp - 0xc]
and ecx, 0xffff
xor edx, edx
div ecx
mov eax, 0x29a
sub eax, edx
mov ecx, dword [ebp - 0xc]
and eax, ecx
xor eax, 0x26
mov dword [ebp - 8], eax
mov eax, 0x3f
mov esi, 0x3b
cmp word [ebp - 4], ax
jbe 0x401fbe
mov eax, dword [ebp - 4]
and eax, 0xffff
xor edx, edx
mov ecx, 9
div ecx
lea eax, [edx + edx*2]
shl eax, 7
sub eax, edx
shl eax, 1
mov ecx, dword [ebp - 4]
and ecx, 0xffff
xor eax, ecx
mov edx, dword [ebp - 8]
and edx, 0xffff
mov ecx, dword [ebp - 0xc]
and ecx, 0xffff
add edx, ecx
or eax, edx
push eax
mov eax, dword [ebp - 4]
and eax, 0xffff
xor edx, edx
mov ecx, 9
div ecx
lea eax, [edx + edx*2]
shl eax, 7
sub eax, edx
shl eax, 1
mov ecx, dword [ebp - 4]
and ecx, 0xffff
xor eax, ecx
mov edx, dword [ebp - 8]
and edx, 0xffff
mov ecx, dword [ebp - 0xc]
and ecx, 0xffff
add edx, ecx
or eax, edx
push eax
call dword [sym.imp.KERNEL32.dll_SetCommState]
jmp 0x402055
cmp word [ebp - 4], 0x49
jne 0x401fdd
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 4]
imul edx, eax
mov ecx, dword [ebp - 0xc]
or edx, ecx
mov eax, dword [ebp - 0xc]
or edx, eax
mov dword [ebp - 8], edx
jmp 0x402055
cmp word [ebp - 4], 0x11
jne 0x402000
mov eax, dword [ebp - 4]
lea ecx, [eax + eax*2]
lea ecx, [ecx + ecx*4]
lea ecx, [ecx + ecx*4]
lea ecx, [ecx + ecx*4]
lea edx, [eax + ecx*2]
mov eax, dword [ebp - 0xc]
sub eax, edx
mov dword [ebp - 0xc], eax
jmp 0x402055
cmp word [ebp - 4], 0xe
jae 0x40201f
mov ecx, dword [ebp - 8]
and ecx, 0xffff
mov eax, 0xa6c21df7
mul ecx
shr edx, 8
mov dword [ebp - 8], edx
jmp 0x402055
cmp word [ebp - 4], ax
jb 0x402047
mov ecx, dword [ebp - 8]
and ecx, 0xffff
mov eax, 0x2a6
xor edx, edx
div ecx
mov edx, dword [ebp - 8]
imul eax, edx
mov ecx, dword [ebp - 0xc]
sub eax, ecx
mov dword [ebp - 8], eax
jmp 0x402055
cmp word [ebp - 4], si
jne 0x402055
mov eax, 0x4266f7
mov dword [ebp - 0x10], eax
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 8]
imul edx, eax
mov ecx, dword [ebp - 4]
xor edx, ecx
xor edx, 0x97c08
mov dword [ebp - 0xc], edx
cmp word [ebp - 4], si
jne 0x402223
cmp word [ebp - 4], 0x16
jne 0x4020bc
mov ecx, dword [ebp - 8]
and ecx, 0xffff
mov eax, 0x3a
xor edx, edx
div ecx
mov edx, 0x4fc
sub edx, eax
push edx
mov ecx, dword [ebp - 8]
and ecx, 0xffff
mov eax, 0x3a
xor edx, edx
div ecx
mov edx, 0x4fc
sub edx, eax
push edx
call dword [sym.imp.KERNEL32.dll_GetCompressedFileSizeW]
jmp 0x40223d
cmp word [ebp - 4], si
jne 0x4021e3
cmp word [ebp - 8], 0x1a
jae 0x4020f6
mov eax, dword [ebp - 4]
and eax, 0xffff
mov ecx, dword [ebp - 0xc]
and ecx, 0xffff
sub ecx, eax
add ecx, 0x63
mov edx, dword [ebp - 8]
and edx, 0xffff
or ecx, edx
mov dword [ebp - 0x14], ecx
jmp 0x40223d
cmp word [ebp - 8], 0xa4
jne 0x402127
mov eax, dword [ebp - 4]
and eax, 0xffff
xor edx, edx
mov ecx, 0x76
div ecx
mov eax, dword [ebp - 0x10]
and edx, 0x307
lea ecx, [eax + edx + 0x17a9]
mov dword [ebp - 0x10], ecx
jmp 0x40223d
cmp word [ebp - 8], 0x55
jae 0x402164
mov ecx, dword [ebp - 8]
and ecx, 0xffff
mov edx, dword [ebp - 4]
and edx, 0xffff
and ecx, edx
mov esi, dword [ebp - 0xc]
and esi, 0xffff
mov eax, 0x225
xor edx, edx
div esi
xor ecx, edx
xor ecx, 0x3a2
mov dword [ebp - 0x14], ecx
jmp 0x40223d
cmp word [ebp - 8], 0x2f
ja 0x40218c
mov eax, dword [ebp - 8]
mov ecx, dword [ebp - 0xc]
imul eax, ecx
mov edx, dword [ebp - 0xc]
imul eax, edx
add eax, 0xe0
mov ecx, dword [ebp - 4]
or eax, ecx
mov dword [ebp - 4], eax
jmp 0x40223d
cmp word [ebp - 8], 0x1f
jne 0x4021ac
mov eax, dword [ebp - 0xc]
and eax, 0xffff
xor edx, edx
mov ecx, 0x2ad
div ecx
mov dword [ebp - 8], edx
jmp 0x40223d
cmp word [ebp - 8], 0x64
jne 0x40223d
mov ecx, dword [ebp - 0xc]
mov eax, ecx
shl eax, 5
sub eax, ecx
shl eax, 3
sub eax, ecx
lea eax, [eax + eax*8]
lea edx, [eax + eax*8]
shl edx, 1
mov eax, dword [ebp - 4]
xor edx, eax
mov ecx, dword [ebp - 4]
xor ecx, 0x3ba
or edx, ecx
mov dword [ebp - 4], edx
jmp 0x40223d
cmp word [ebp - 4], 4
jne 0x40223d
mov dl, byte [ebp - 8]
mov al, 0x29
sub al, dl
mov cl, byte [ebp - 4]
xor al, cl
mov dl, byte [ebp - 4]
xor al, dl
push eax
mov eax, dword [ebp - 4]
and eax, 0xffff
mov ecx, dword [ebp - 4]
and ecx, 0xffff
xor eax, ecx
mov edx, dword [ebp - 8]
and edx, 0xffff
mov ecx, 0x129
sub ecx, edx
xor eax, ecx
jmp 0x402236
cmp word [ebp - 4], 0x23
ja 0x40223d
mov dl, byte [ebp - 0xc]
push edx
mov eax, dword [ebp - 0xc]
and eax, 0xffff
push eax
call dword [sym.imp.KERNEL32.dll_TransmitCommChar]
mov ecx, dword [ebp - 0xc]
add ecx, 0x3be
xor ecx, 0x35c
mov edx, dword [ebp - 4]
or ecx, edx
mov dword [ebp - 4], ecx
xor ecx, ecx
mov eax, dword [ebp - 8]
and eax, 0xffff
sub eax, 0x94
je 0x4022c0
mov bl, byte [ebp + 8]
mov edi, dword [ebp - 0x10]
mov esi, 0x67
mov dword [ebp + 8], esi
mov eax, 0x94
xor edx, edx
div dword [ebp + 8]
mov edx, dword [ebp + 8]
add eax, edx
mov edx, dword [ebp + 8]
xor eax, edx
mov dword [ebp + 8], eax
mov eax, dword [ebp + 8]
and eax, 0x100
mov edx, dword [ebp + 8]
or eax, edx
mov dword [ebp + 8], eax
mov al, byte [ecx + edi]
cmp al, bl
je 0x4022da
mov eax, dword [ebp + 8]
add eax, 0x4b5c
mov byte [ebp + 0xb], al
inc ecx
mov edx, dword [ebp - 8]
and edx, 0xffff
sub edx, 0x94
cmp ecx, edx
jb 0x402270
mov eax, dword [ebp - 4]
mov ecx, dword [ebp - 0xc]
imul eax, ecx
xor eax, 0x8523b
mov dword [ebp - 4], eax
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret
pop edi
pop esi
mov al, cl
pop ebx
mov esp, ebp
pop ebp
ret