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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14
cmp dword [ebp + 8], 0
push ebx
push esi
mov ebx, ecx
push edi
mov dword [ebp - 8], ebx
je 0x4186cf
mov ecx, dword [ebp + 0x10]
cmp ecx, 0x10
je 0x418304
cmp ecx, 0x18
je 0x418304
cmp ecx, 0x20
je 0x418304
push str.Incorrect_key_length
jmp 0x4186d4
mov eax, dword [ebp + 0x14]
cmp eax, 0x10
je 0x418320
cmp eax, 0x18
je 0x418320
cmp eax, 0x20
je 0x418320
push str.Incorrect_block_length
jmp 0x4186d4
mov esi, dword [ebp + 0xc]
push eax
mov dword [ebx + 0xac], eax
lea eax, [ebx + 4]
push esi
push eax
mov dword [ebx + 0xa8], ecx
call fcn.004f3ce0
add esp, 0xc
lea eax, [ebx + 0x24]
push dword [ebx + 0xac]
push esi
push eax
call fcn.004f3ce0
mov eax, dword [ebx + 0xa8]
add esp, 0xc
cmp eax, 0x10
je 0x418375
cmp eax, 0x18
je 0x418367
mov eax, 0xe
jmp 0x418394
xor eax, eax
cmp dword [ebx + 0xac], 0x20
sete al
jmp 0x41838d
mov ecx, dword [ebx + 0xac]
cmp ecx, 0x10
jne 0x418385
lea eax, [ecx - 6]
jmp 0x418394
xor eax, eax
cmp ecx, 0x18
setne al
lea eax, [eax*2 + 0xc]
mov dword [ebx + 0xb0], eax
xor esi, esi
mov eax, dword [ebx + 0xac]
cdq
and edx, 3
lea ecx, [edx + eax]
mov eax, dword [ebx + 0xb0]
sar ecx, 2
mov dword [ebp + 0x10], ecx
test eax, eax
js 0x4183db
lea edx, [ebx + 0xb4]
nop
test ecx, ecx
jle 0x4183cd
xor eax, eax
mov edi, edx
rep stosd dword es:[edi], eax
mov ecx, dword [ebp + 0x10]
mov eax, dword [ebx + 0xb0]
inc esi
add edx, 0x20
cmp esi, eax
jle 0x4183c0
xor edx, edx
test eax, eax
js 0x418402
lea esi, [ebx + 0x294]
test ecx, ecx
jle 0x4183f4
xor eax, eax
mov edi, esi
rep stosd dword es:[edi], eax
mov ecx, dword [ebp + 0x10]
mov eax, dword [ebx + 0xb0]
inc edx
add esi, 0x20
cmp edx, eax
jle 0x4183e7
inc eax
imul eax, ecx
mov dword [ebp + 0x14], eax
mov eax, dword [ebx + 0xa8]
cdq
and edx, 3
lea esi, [edx + eax]
sar esi, 2
lea eax, [ebx + 0x44]
mov dword [ebp - 4], esi
mov edi, eax
mov dword [ebp + 0xc], eax
test esi, esi
jle 0x418471
mov ebx, esi
mov esi, dword [ebp + 8]
nop dword [eax]
movzx eax, byte [esi]
lea esi, [esi + 4]
shl eax, 0x18
lea edi, [edi + 4]
mov dword [edi - 4], eax
movzx edx, byte [esi - 3]
shl edx, 0x10
or edx, eax
mov dword [edi - 4], edx
movzx ecx, byte [esi - 2]
shl ecx, 8
or ecx, edx
mov dword [edi - 4], ecx
movzx eax, byte [esi - 1]
or eax, ecx
mov dword [edi - 4], eax
sub ebx, 1
jne 0x418430
mov ebx, dword [ebp - 8]
mov ecx, dword [ebp + 0x10]
mov esi, dword [ebp - 4]
mov eax, dword [ebp + 0xc]
xor edi, edi
test esi, esi
jle 0x4184c5
mov dword [ebp + 8], eax
nop word [eax + eax]
cmp edi, dword [ebp + 0x14]
jge 0x418632
mov eax, edi
inc edi
cdq
idiv ecx
mov ecx, dword [ebp + 8]
mov ecx, dword [ecx]
lea esi, [edx + eax*8]
mov dword [ebx + esi*4 + 0xb4], ecx
mov ecx, dword [ebx + 0xb0]
mov esi, dword [ebp - 4]
sub ecx, eax
lea ecx, [edx + ecx*8]
mov edx, dword [ebp + 8]
mov eax, dword [edx]
add edx, 4
mov dword [ebx + ecx*4 + 0x294], eax
mov ecx, dword [ebp + 0x10]
mov dword [ebp + 8], edx
cmp edi, esi
jl 0x418480
cmp edi, dword [ebp + 0x14]
jge 0x418632
mov dword [ebp + 8], 0x50ecb0
mov edx, dword [ebx + esi*4 + 0x40]
mov eax, edx
sar eax, 0x10
movzx eax, al
movsx ecx, byte [eax + 0x511dd0]
mov eax, dword [ebp + 8]
inc dword [ebp + 8]
movsx eax, byte [eax]
xor ecx, eax
mov eax, edx
sar eax, 8
movzx eax, al
shl ecx, 8
movzx eax, byte [eax + 0x511dd0]
xor ecx, eax
movzx eax, dl
shl ecx, 8
sar edx, 0x18
movzx eax, byte [eax + 0x511dd0]
xor ecx, eax
movzx eax, dl
shl ecx, 8
movzx eax, byte [eax + 0x511dd0]
xor ecx, eax
lea eax, [ebx + 0x44]
xor dword [eax], ecx
cmp esi, 8
je 0x418554
cmp esi, 1
jle 0x4185d3
lea ecx, [ebx + 0x48]
lea edx, [esi - 1]
mov eax, dword [ecx - 4]
lea ecx, [ecx + 4]
xor dword [ecx - 4], eax
sub edx, 1
jne 0x418541
jmp 0x4185d0
lea eax, [ebx + 0x48]
mov edx, 3
nop dword [eax]
mov ecx, dword [eax - 4]
lea eax, [eax + 4]
xor dword [eax - 4], ecx
sub edx, 1
jne 0x418560
mov edx, dword [ebx + 0x50]
mov eax, edx
sar eax, 0x18
movzx eax, al
movsx ecx, byte [eax + 0x511dd0]
mov eax, edx
sar eax, 0x10
movzx eax, al
shl ecx, 8
movzx eax, byte [eax + 0x511dd0]
xor ecx, eax
mov eax, edx
sar eax, 8
movzx eax, al
shl ecx, 8
movzx eax, byte [eax + 0x511dd0]
xor ecx, eax
movzx eax, dl
shl ecx, 8
mov edx, 3
movzx eax, byte [eax + 0x511dd0]
xor ecx, eax
xor dword [ebx + 0x54], ecx
lea ecx, [ebx + 0x58]
mov eax, dword [ecx - 4]
lea ecx, [ecx + 4]
xor dword [ecx - 4], eax
sub edx, 1
jne 0x4185c2
lea eax, [ebx + 0x44]
mov dword [ebp - 8], 0
test esi, esi
jle 0x418629
mov ecx, eax
mov dword [ebp + 0xc], eax
cmp edi, dword [ebp + 0x14]
jge 0x418632
mov eax, edi
mov ecx, dword [ecx]
cdq
inc edi
idiv dword [ebp + 0x10]
lea esi, [edx + eax*8]
mov dword [ebx + esi*4 + 0xb4], ecx
mov ecx, dword [ebx + 0xb0]
mov esi, dword [ebp - 4]
sub ecx, eax
mov eax, dword [ebp + 0xc]
lea ecx, [edx + ecx*8]
mov eax, dword [eax]
mov dword [ebx + ecx*4 + 0x294], eax
mov eax, dword [ebp - 8]
mov ecx, dword [ebp + 0xc]
inc eax
add ecx, 4
mov dword [ebp - 8], eax
mov dword [ebp + 0xc], ecx
cmp eax, esi
jl 0x4185e3
cmp edi, dword [ebp + 0x14]
jl 0x4184d5
mov ecx, 1
mov dword [ebp + 8], ecx
cmp dword [ebx + 0xb0], ecx
jle 0x4186bf
mov eax, dword [ebp + 0x10]
lea edx, [ebx + 0x2b4]
mov dword [ebp + 0x14], edx
test eax, eax
jle 0x4186ad
mov esi, edx
mov edi, eax
nop word [eax + eax]
mov edx, dword [esi]
lea esi, [esi + 4]
mov eax, edx
sar eax, 0x18
movzx ecx, al
mov eax, edx
sar eax, 0x10
movzx eax, al
mov ecx, dword [ecx*4 + 0x50f8d0]
xor ecx, dword [eax*4 + 0x50f4d0]
mov eax, edx
sar eax, 8
movzx eax, al
xor ecx, dword [eax*4 + 0x50f0d0]
movzx eax, dl
xor ecx, dword [eax*4 + 0x50ecd0]
mov dword [esi - 4], ecx
sub edi, 1
jne 0x418660
mov eax, dword [ebp + 0x10]
mov ecx, dword [ebp + 8]
mov edx, dword [ebp + 0x14]
inc ecx
add edx, 0x20
mov dword [ebp + 8], ecx
mov dword [ebp + 0x14], edx
cmp ecx, dword [ebx + 0xb0]
jl 0x418652
pop edi
pop esi
mov byte [ebx + 0xa4], 1
pop ebx
mov esp, ebp
pop ebp
ret 0x10
push str.Empty_key
lea ecx, [ebp - 0x14]
call fcn.00419800
push 0x543388
lea eax, [ebp - 0x14]
push eax
call fcn.004f45c8
int3