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

Disassembly:
mov eax, dword [esp + 0xc]
push ebx
push ebp
push esi
cmp eax, 0x10
push edi
je 0x401063
cmp eax, 0x18
je 0x401057
cmp eax, 0x20
jne 0x4012d8
mov edx, dword [esp + 0x14]
mov dword [edx], 0xe
jmp 0x40106d
mov edx, dword [esp + 0x14]
mov dword [edx], 0xc
jmp 0x40106d
mov edx, dword [esp + 0x14]
mov dword [edx], 0xa
lea ecx, [eax*8]
lea esi, [edx + 8]
shr ecx, 5
mov dword [edx + 4], esi
je 0x4010b1
mov eax, dword [esp + 0x18]
mov edi, esi
add eax, 2
mov ebp, ecx
xor ecx, ecx
xor ebx, ebx
mov ch, byte [eax + 1]
mov bl, byte [eax - 1]
mov cl, byte [eax]
add eax, 4
shl ecx, 8
or ecx, ebx
xor ebx, ebx
mov bl, byte [eax - 6]
add edi, 4
shl ecx, 8
or ecx, ebx
dec ebp
mov dword [edi - 4], ecx
jne 0x40108a
mov eax, dword [edx]
sub eax, 0xa
je 0x401259
sub eax, 2
je 0x4011bf
sub eax, 2
jne 0x4012d8
mov edi, 0x40523c
mov eax, dword [esi + 0x1c]
xor ecx, ecx
mov edx, eax
xor ebx, ebx
and edx, 0xff
mov dword [esp + 0x14], eax
mov ebp, dword [esi]
add edi, 4
mov ch, byte [edx + str.cw]
mov edx, eax
shr edx, 0x18
add esi, 0x20
mov bl, byte [edx + str.cw]
xor edx, edx
mov dl, byte [esp + 0x16]
xor ecx, ebx
xor ebx, ebx
mov bl, byte [edx + str.cw]
xor edx, edx
shl ecx, 8
mov dl, ah
xor ecx, ebx
xor eax, eax
xor ebx, ebx
mov al, byte [edx + str.cw]
xor edx, edx
shl ecx, 8
xor ecx, eax
mov eax, dword [edi - 4]
xor eax, ecx
mov ecx, dword [esi - 0x1c]
xor eax, ebp
mov dword [esi], eax
xor ecx, eax
mov eax, dword [esi - 0x18]
mov dword [esi + 4], ecx
xor eax, ecx
mov ecx, dword [esi - 0x14]
xor ecx, eax
mov dword [esi + 8], eax
mov dword [esp + 0x1c], ecx
xor eax, eax
mov dl, byte [esp + 0x1e]
mov dword [esi + 0xc], ecx
mov al, byte [edx + str.cw]
mov edx, ecx
shr edx, 0x18
mov bh, byte [edx + str.cw]
xor edx, edx
xor eax, ebx
mov dl, ch
xor ebx, ebx
and ecx, 0xff
mov bl, byte [edx + str.cw]
xor edx, edx
mov dl, byte [ecx + str.cw]
mov ecx, dword [esi - 0x10]
shl eax, 8
xor eax, ebx
shl eax, 8
xor eax, edx
mov edx, dword [esp + 0x14]
xor eax, ecx
mov ecx, dword [esi - 0xc]
mov dword [esi + 0x10], eax
xor ecx, eax
mov eax, dword [esi - 8]
mov dword [esi + 0x14], ecx
xor eax, ecx
mov dword [esi + 0x18], eax
xor eax, edx
mov dword [esi + 0x1c], eax
cmp edi, 0x405258
jb 0x4010d3
pop edi
pop esi
pop ebp
pop ebx
ret 0xc
mov edi, 0x40523c
mov ecx, dword [esi + 0x14]
xor edx, edx
mov eax, ecx
xor ebx, ebx
and eax, 0xff
mov dword [esp + 0x14], ecx
add edi, 4
add esi, 0x18
mov dh, byte [eax + str.cw]
mov eax, ecx
shr eax, 0x18
mov bl, byte [eax + str.cw]
xor eax, eax
mov al, byte [esp + 0x16]
xor edx, ebx
xor ebx, ebx
mov bl, byte [eax + str.cw]
xor eax, eax
shl edx, 8
xor edx, ebx
mov al, ch
xor ebx, ebx
mov bl, byte [eax + str.cw]
shl edx, 8
xor edx, ebx
mov ebx, dword [esi - 0x18]
xor edx, ebx
mov eax, edx
mov edx, dword [edi - 4]
xor eax, edx
mov edx, dword [esi - 0x14]
mov dword [esi], eax
xor edx, eax
mov eax, dword [esi - 0x10]
mov dword [esi + 4], edx
xor eax, edx
mov edx, dword [esi - 0xc]
mov dword [esi + 8], eax
xor edx, eax
mov eax, dword [esi - 8]
mov dword [esi + 0xc], edx
xor eax, edx
mov dword [esi + 0x10], eax
xor eax, ecx
mov dword [esi + 0x14], eax
cmp edi, 0x40525c
jb 0x4011c4
pop edi
pop esi
pop ebp
pop ebx
ret 0xc
mov edi, 0x40523c
mov eax, dword [esi + 0xc]
xor edx, edx
mov ecx, eax
xor ebx, ebx
and ecx, 0xff
mov dword [esp + 0x14], eax
mov ebp, dword [esi]
add edi, 4
mov dh, byte [ecx + str.cw]
mov ecx, eax
shr ecx, 0x18
add esi, 0x10
mov bl, byte [ecx + str.cw]
xor ecx, ecx
mov cl, byte [esp + 0x16]
xor edx, ebx
xor ebx, ebx
mov bl, byte [ecx + str.cw]
xor ecx, ecx
shl edx, 8
xor edx, ebx
mov cl, ah
xor ebx, ebx
mov bl, byte [ecx + str.cw]
shl edx, 8
xor edx, ebx
mov ebx, dword [edi - 4]
xor edx, ebp
mov ecx, edx
mov edx, dword [esi - 0xc]
xor ecx, ebx
mov dword [esi], ecx
xor ecx, edx
mov edx, dword [esi - 8]
mov dword [esi + 4], ecx
xor edx, ecx
xor eax, edx
mov dword [esi + 8], edx
mov dword [esi + 0xc], eax
cmp edi, str.cw
jb 0x40125e
pop edi
pop esi
pop ebp
pop ebx
ret 0xc