Function at 0x40224e
Capabilities:
Encode data using xor
Encrypt data using aes
Encrypt data using rc4 ksa
Reference aes constants

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14
cmp dword [ebp + 8], 0
push ebx
push esi
push edi
mov esi, ecx
jne 0x402281
lea eax, [ebp + 0xc]
lea ecx, [ebp - 0x14]
push eax
mov dword [ebp + 0xc], 0x40f360
call dword [sym.imp.MSVCRT.dll_public:_void___thiscall_exception::constructor_char_const__const_const__]
lea eax, [ebp - 0x14]
push 0x40d508
push eax
call sub.MSVCRT.dll__CxxThrowException
mov ecx, dword [ebp + 0x10]
push 0x18
pop ebx
push 0x10
pop edi
cmp ecx, edi
je 0x4022b9
cmp ecx, ebx
je 0x4022b9
cmp ecx, 0x20
je 0x4022b9
lea eax, [ebp + 0xc]
lea ecx, [ebp - 0x14]
push eax
mov dword [ebp + 0xc], 0x40f360
call dword [sym.imp.MSVCRT.dll_public:_void___thiscall_exception::constructor_char_const__const_const__]
lea eax, [ebp - 0x14]
push 0x40d508
push eax
call sub.MSVCRT.dll__CxxThrowException
mov eax, dword [ebp + 0x14]
cmp eax, edi
je 0x4022eb
cmp eax, ebx
je 0x4022eb
cmp eax, 0x20
je 0x4022eb
lea eax, [ebp + 0xc]
lea ecx, [ebp - 0x14]
push eax
mov dword [ebp + 0xc], 0x40f360
call dword [sym.imp.MSVCRT.dll_public:_void___thiscall_exception::constructor_char_const__const_const__]
lea eax, [ebp - 0x14]
push 0x40d508
push eax
call sub.MSVCRT.dll__CxxThrowException
push eax
mov dword [esi + 0x3cc], eax
push dword [ebp + 0xc]
lea eax, [esi + 0x3d0]
mov dword [esi + 0x3c8], ecx
push eax
call sub.MSVCRT.dll_memcpy
push dword [esi + 0x3cc]
lea eax, [esi + 0x3f0]
push dword [ebp + 0xc]
push eax
call sub.MSVCRT.dll_memcpy
mov eax, dword [esi + 0x3c8]
add esp, 0x18
cmp eax, edi
je 0x40234d
cmp eax, ebx
je 0x402339
mov dword [esi + 0x410], 0xe
jmp 0x402372
xor eax, eax
cmp dword [esi + 0x3cc], 0x20
sete al
dec eax
and al, 0xfe
add eax, 0xe
jmp 0x40236c
mov eax, dword [esi + 0x3cc]
cmp eax, edi
jne 0x40235c
push 0xa
pop eax
jmp 0x40236c
xor ecx, ecx
cmp eax, ebx
setne cl
dec ecx
and ecx, 0xfffffffe
add ecx, 0xe
mov eax, ecx
mov dword [esi + 0x410], eax
mov eax, dword [esi + 0x3cc]
push 4
cdq
pop ecx
idiv ecx
xor edx, edx
cmp dword [esi + 0x410], edx
mov dword [ebp + 0x10], eax
jl 0x4023a7
lea ebx, [esi + 8]
mov ecx, dword [ebp + 0x10]
test ecx, ecx
jle 0x40239b
xor eax, eax
mov edi, ebx
rep stosd dword es:[edi], eax
inc edx
add ebx, 0x20
cmp edx, dword [esi + 0x410]
jle 0x40238e
xor edx, edx
cmp dword [esi + 0x410], edx
jl 0x4023d0
lea ebx, [esi + 0x1e8]
mov ecx, dword [ebp + 0x10]
test ecx, ecx
jle 0x4023c4
xor eax, eax
mov edi, ebx
rep stosd dword es:[edi], eax
inc edx
add ebx, 0x20
cmp edx, dword [esi + 0x410]
jle 0x4023b7
mov eax, dword [esi + 0x3c8]
push 4
cdq
pop ecx
mov edi, dword [esi + 0x410]
idiv ecx
inc edi
mov ecx, dword [ebp + 8]
imul edi, dword [ebp + 0x10]
mov dword [ebp - 8], edi
mov edx, eax
lea eax, [esi + 0x414]
test edx, edx
mov dword [ebp - 4], edx
jle 0x402426
mov dword [ebp + 0xc], edx
movzx ebx, byte [ecx]
shl ebx, 0x18
inc ecx
mov dword [eax], ebx
movzx ebx, byte [ecx]
shl ebx, 0x10
or dword [eax], ebx
inc ecx
xor ebx, ebx
mov bh, byte [ecx]
or dword [eax], ebx
inc ecx
movzx ebx, byte [ecx]
or dword [eax], ebx
inc ecx
add eax, 4
dec dword [ebp + 0xc]
jne 0x4023ff
and dword [ebp + 0xc], 0
test edx, edx
jle 0x40247d
lea ecx, [esi + 0x414]
cmp dword [ebp + 0xc], edi
jge 0x4025dc
mov eax, dword [ebp + 0xc]
mov ebx, dword [ecx]
cdq
idiv dword [ebp + 0x10]
mov dword [ebp + 8], eax
mov eax, dword [ebp + 0xc]
cdq
idiv dword [ebp + 0x10]
mov eax, dword [ebp + 8]
lea eax, [edx + eax*8]
mov dword [esi + eax*4 + 8], ebx
mov eax, dword [esi + 0x410]
sub eax, dword [ebp + 8]
inc dword [ebp + 0xc]
lea eax, [edx + eax*8]
mov edx, dword [ecx]
add ecx, 4
mov dword [esi + eax*4 + 0x1e8], edx
mov edx, dword [ebp - 4]
cmp dword [ebp + 0xc], edx
jl 0x402434
cmp dword [ebp + 0xc], edi
jge 0x4025dc
mov dword [ebp + 0x14], 0x40bb94
mov eax, dword [esi + edx*4 + 0x410]
mov ebx, dword [ebp + 0x14]
mov dword [ebp + 8], eax
xor ecx, ecx
mov cl, byte [ebp + 0xa]
movsx ebx, byte [ebx]
movsx ecx, byte [ecx + str.cw]
xor ecx, ebx
xor ebx, ebx
mov bl, ah
and eax, 0xff
shl ecx, 8
movzx ebx, byte [ebx + str.cw]
movzx eax, byte [eax + str.cw]
xor ecx, ebx
shl ecx, 8
xor ecx, eax
xor eax, eax
mov al, byte [ebp + 0xb]
shl ecx, 8
movzx eax, byte [eax + str.cw]
xor ecx, eax
xor dword [esi + 0x414], ecx
inc dword [ebp + 0x14]
cmp edx, 8
je 0x40250a
cmp edx, 1
jle 0x40257f
lea eax, [esi + 0x418]
lea ecx, [edx - 1]
mov ebx, dword [eax - 4]
xor dword [eax], ebx
add eax, 4
dec ecx
jne 0x4024fd
jmp 0x40257f
push 3
lea eax, [esi + 0x418]
pop ecx
mov ebx, dword [eax - 4]
xor dword [eax], ebx
add eax, 4
dec ecx
jne 0x402513
mov eax, dword [esi + 0x420]
xor ecx, ecx
mov dword [ebp + 8], eax
xor ebx, ebx
mov cl, byte [ebp + 0xb]
mov bl, byte [ebp + 0xa]
push 3
movsx ecx, byte [ecx + str.cw]
movzx ebx, byte [ebx + str.cw]
shl ecx, 8
xor ecx, ebx
xor ebx, ebx
mov bl, ah
and eax, 0xff
shl ecx, 8
movzx ebx, byte [ebx + str.cw]
movzx eax, byte [eax + str.cw]
xor ecx, ebx
shl ecx, 8
xor ecx, eax
lea eax, [esi + 0x428]
xor dword [esi + 0x424], ecx
pop ecx
mov ebx, dword [eax - 4]
xor dword [eax], ebx
add eax, 4
dec ecx
jne 0x402574
and dword [ebp + 8], 0
test edx, edx
jle 0x4025d3
lea ecx, [esi + 0x414]
cmp dword [ebp + 0xc], edi
jge 0x4025dc
mov eax, dword [ebp + 0xc]
mov ebx, dword [ecx]
cdq
idiv dword [ebp + 0x10]
mov edi, eax
mov eax, dword [ebp + 0xc]
cdq
idiv dword [ebp + 0x10]
lea eax, [edx + edi*8]
mov dword [esi + eax*4 + 8], ebx
mov eax, dword [esi + 0x410]
sub eax, edi
inc dword [ebp + 8]
mov edi, dword [ebp - 8]
lea eax, [edx + eax*8]
mov edx, dword [ecx]
add ecx, 4
inc dword [ebp + 0xc]
mov dword [esi + eax*4 + 0x1e8], edx
mov edx, dword [ebp - 4]
cmp dword [ebp + 8], edx
jl 0x40258d
cmp dword [ebp + 0xc], edi
jl 0x40248d
push 1
pop eax
cmp dword [esi + 0x410], eax
mov dword [ebp + 0x14], eax
jle 0x40264b
lea eax, [esi + 0x208]
mov dword [ebp + 0xc], eax
mov ecx, dword [ebp + 0x10]
test ecx, ecx
jle 0x402639
mov edi, dword [ebp + 0xc]
mov eax, dword [edi]
xor edx, edx
mov dword [ebp + 8], eax
xor ebx, ebx
mov dl, byte [ebp + 0xb]
mov bl, byte [ebp + 0xa]
mov edx, dword [edx*4 + 0x40ab94]
xor edx, dword [ebx*4 + 0x40af94]
xor ebx, ebx
mov bl, ah
and eax, 0xff
xor edx, dword [ebx*4 + 0x40b394]
xor edx, dword [eax*4 + 0x40b794]
mov dword [edi], edx
add edi, 4
dec ecx
jne 0x4025fd
inc dword [ebp + 0x14]
add dword [ebp + 0xc], 0x20
mov eax, dword [ebp + 0x14]
cmp eax, dword [esi + 0x410]
jl 0x4025f3
mov byte [esi + 4], 1
pop edi
pop esi
pop ebx
leave
ret 0x10