Function at 0x405575
Capabilities:
Encode data using xor
Encrypt data using aes
Reference aes constants

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
push ebx
push esi
push edi
mov dword [ebp - 0xc], edx
mov esi, ecx
test edx, edx
jne 0x4055a8
mov dword [ebp + 8], str.Empty_key
lea eax, [ebp + 8]
push eax
lea ecx, [ebp - 0x1c]
call fcn.00413299
push 0x43ced4
lea eax, [ebp - 0x1c]
push eax
call fcn.00413452
mov ecx, dword [ebp + 0xc]
push 0x18
pop ebx
push 0x10
pop edi
cmp ecx, edi
je 0x4055c7
cmp ecx, ebx
je 0x4055c7
cmp ecx, 0x20
je 0x4055c7
mov dword [ebp + 8], str.Incorrect_key_length
jmp 0x40558e
mov eax, dword [ebp + 0x10]
cmp eax, edi
je 0x4055e0
cmp eax, ebx
je 0x4055e0
cmp eax, 0x20
je 0x4055e0
mov dword [ebp + 8], str.Incorrect_block_length
jmp 0x40558e
push eax
push dword [ebp + 8]
mov dword [esi + 0x3cc], eax
lea eax, [esi + 0x3d4]
push eax
mov dword [esi + 0x3c8], ecx
call fcn.00412b40
push dword [esi + 0x3cc]
lea eax, [esi + 0x3f4]
push dword [ebp + 8]
push eax
call fcn.00412b40
mov eax, dword [esi + 0x3c8]
add esp, 0x18
cmp eax, edi
je 0x405640
cmp eax, ebx
je 0x40562e
mov dword [esi + 0x3d0], 0xe
jmp 0x405660
xor eax, eax
cmp dword [esi + 0x3cc], 0x20
sete al
lea eax, [eax + eax + 0xc]
jmp 0x40565a
mov eax, dword [esi + 0x3cc]
cmp eax, edi
jne 0x40564f
push 0xa
pop eax
jmp 0x40565a
xor ecx, ecx
cmp eax, ebx
setne cl
lea eax, [ecx + ecx + 0xc]
mov dword [esi + 0x3d0], eax
mov eax, dword [esi + 0x3cc]
cdq
and edx, 3
lea ecx, [edx + eax]
sar ecx, 2
xor edx, edx
mov dword [ebp + 0xc], ecx
cmp dword [esi + 0x3d0], edx
jl 0x405699
lea ebx, [esi + 8]
test ecx, ecx
jle 0x40568d
xor eax, eax
mov edi, ebx
rep stosd dword es:[edi], eax
mov ecx, dword [ebp + 0xc]
inc edx
add ebx, 0x20
cmp edx, dword [esi + 0x3d0]
jle 0x405680
xor edx, edx
cmp dword [esi + 0x3d0], edx
jl 0x4056c2
lea ebx, [esi + 0x1e8]
test ecx, ecx
jle 0x4056b6
xor eax, eax
mov edi, ebx
rep stosd dword es:[edi], eax
mov ecx, dword [ebp + 0xc]
inc edx
add ebx, 0x20
cmp edx, dword [esi + 0x3d0]
jle 0x4056a9
mov ebx, dword [esi + 0x3d0]
mov eax, dword [esi + 0x3c8]
inc ebx
imul ebx, ecx
mov ecx, dword [ebp - 0xc]
cdq
and edx, 3
lea edi, [edx + eax]
sar edi, 2
mov dword [ebp - 0x10], ebx
lea eax, [esi + 0x414]
test edi, edi
jle 0x40571a
mov dword [ebp + 8], edi
movzx edx, byte [ecx]
shl edx, 0x18
mov dword [eax], edx
movzx edx, byte [ecx + 1]
shl edx, 0x10
or dword [eax], edx
movzx edx, byte [ecx + 2]
shl edx, 8
or dword [eax], edx
movzx edx, byte [ecx + 3]
or dword [eax], edx
add ecx, 4
add eax, 4
dec dword [ebp + 8]
jne 0x4056ef
and dword [ebp + 8], 0
test edi, edi
jle 0x405769
lea eax, [esi + 0x414]
mov dword [ebp + 0x10], eax
mov eax, dword [ebp + 8]
cmp eax, ebx
jge 0x405769
cdq
idiv dword [ebp + 0xc]
mov ecx, dword [ebp + 0x10]
mov ecx, dword [ecx]
mov dword [ebp - 8], eax
lea eax, [edx + eax*8]
mov dword [esi + eax*4 + 8], ecx
mov eax, dword [esi + 0x3d0]
sub eax, dword [ebp - 8]
mov ecx, dword [ebp + 0x10]
mov ecx, dword [ecx]
inc dword [ebp + 8]
add dword [ebp + 0x10], 4
lea eax, [edx + eax*8]
mov dword [esi + eax*4 + 0x1e8], ecx
cmp dword [ebp + 8], edi
jl 0x40572b
mov ecx, 0xff
cmp dword [ebp + 8], ebx
jge 0x4058d1
mov dword [ebp - 4], 0x437ba8
mov eax, dword [esi + edi*4 + 0x410]
mov ebx, dword [ebp - 4]
movsx ebx, byte [ebx]
mov edx, eax
sar edx, 0x10
and edx, ecx
movsx edx, byte [edx + str.cw]
xor edx, ebx
mov ebx, eax
sar ebx, 8
and ebx, ecx
movzx ebx, byte [ebx + str.cw]
shl edx, 8
xor edx, ebx
mov ebx, eax
and ebx, ecx
movzx ebx, byte [ebx + str.cw]
sar eax, 0x18
shl edx, 8
and eax, ecx
movzx eax, byte [eax + str.cw]
xor edx, ebx
shl edx, 8
xor edx, eax
xor dword [esi + 0x414], edx
inc dword [ebp - 4]
cmp edi, 8
je 0x4057fc
cmp edi, 1
jle 0x405872
lea eax, [esi + 0x418]
lea edx, [edi - 1]
mov ebx, dword [eax - 4]
xor dword [eax], ebx
add eax, 4
dec edx
jne 0x4057ef
jmp 0x405872
push 3
lea eax, [esi + 0x418]
pop edx
mov ebx, dword [eax - 4]
xor dword [eax], ebx
add eax, 4
dec edx
jne 0x405805
mov eax, dword [esi + 0x420]
mov edx, eax
sar edx, 0x18
and edx, ecx
movsx edx, byte [edx + str.cw]
mov ebx, eax
sar ebx, 0x10
and ebx, ecx
movzx ebx, byte [ebx + str.cw]
shl edx, 8
xor edx, ebx
mov ebx, eax
sar ebx, 8
and ebx, ecx
movzx ebx, byte [ebx + str.cw]
shl edx, 8
and eax, ecx
movzx eax, byte [eax + str.cw]
xor edx, ebx
shl edx, 8
xor edx, eax
xor dword [esi + 0x424], edx
push 3
lea eax, [esi + 0x428]
pop edx
mov ebx, dword [eax - 4]
xor dword [eax], ebx
add eax, 4
dec edx
jne 0x405867
and dword [ebp - 0xc], 0
test edi, edi
jle 0x4058c5
lea eax, [esi + 0x414]
mov dword [ebp + 0x10], eax
mov eax, dword [ebp + 8]
cmp eax, dword [ebp - 0x10]
jge 0x4058d1
cdq
idiv dword [ebp + 0xc]
mov ebx, dword [ebp + 0x10]
mov ebx, dword [ebx]
mov dword [ebp - 8], eax
lea eax, [edx + eax*8]
mov dword [esi + eax*4 + 8], ebx
mov eax, dword [esi + 0x3d0]
sub eax, dword [ebp - 8]
inc dword [ebp - 0xc]
lea eax, [edx + eax*8]
mov edx, dword [ebp + 0x10]
add dword [ebp + 0x10], 4
mov edx, dword [edx]
inc dword [ebp + 8]
mov dword [esi + eax*4 + 0x1e8], edx
cmp dword [ebp - 0xc], edi
jl 0x405883
mov eax, dword [ebp + 8]
cmp eax, dword [ebp - 0x10]
jl 0x40577e
xor eax, eax
inc eax
mov dword [ebp + 0x10], eax
cmp dword [esi + 0x3d0], eax
jle 0x405946
lea eax, [esi + 0x208]
mov dword [ebp + 8], eax
mov eax, dword [ebp + 0xc]
test eax, eax
jle 0x405934
mov edx, dword [ebp + 8]
mov dword [ebp - 0x10], eax
mov eax, dword [edx]
mov edi, eax
sar edi, 0x18
and edi, ecx
mov edi, dword [edi*4 + 0x436ba8]
mov ebx, eax
sar ebx, 0x10
and ebx, ecx
xor edi, dword [ebx*4 + 0x436fa8]
mov ebx, eax
sar ebx, 8
and ebx, ecx
xor edi, dword [ebx*4 + 0x4373a8]
and eax, ecx
xor edi, dword [eax*4 + 0x4377a8]
mov dword [edx], edi
add edx, 4
dec dword [ebp - 0x10]
jne 0x4058f5
inc dword [ebp + 0x10]
mov eax, dword [ebp + 0x10]
add dword [ebp + 8], 0x20
cmp eax, dword [esi + 0x3d0]
jl 0x4058e8
pop edi
mov byte [esi + 4], 1
pop esi
pop ebx
leave
ret 0xc