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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x50
mov eax, dword [ebp + 0x1c]
push ebx
mov ebx, dword [ebp + 0xc]
mov ecx, dword [ebx]
xor edx, edx
div ecx
mov dword [ebp - 0x30], ecx
test edx, edx
jne 0x408927
mov eax, dword [ebx + 4]
push esi
push edi
mov edi, dword [ebp + 0x10]
mov dword [ebp - 0x24], eax
cmp byte [ebp + 8], dl
je 0x4082c7
mov esi, 4
add ebx, 8
mov dword [ebp - 0x1c], 0x49e618
mov dword [ebp - 0x18], 0x49ea18
mov dword [ebp - 0x14], 0x49ee18
mov dword [ebp - 0x20], 0x49f218
mov dword [ebp - 4], 0x49e418
mov dword [ebp - 0x3c], esi
mov dword [ebp + 0xc], ebx
jmp 0x408318
mov edx, dword [ebp + 0x14]
lea edx, [edx + ecx - 4]
mov dword [ebp + 0x14], edx
mov edx, dword [ebp + 0x18]
mov esi, 0xfffffffc
lea edx, [edx + ecx - 4]
mov dword [ebp - 0x1c], 0x49f618
mov dword [ebp - 0x18], 0x49fa18
mov dword [ebp - 0x14], 0x49fe18
mov dword [ebp - 0x20], 0x4a0218
mov dword [ebp - 4], 0x49e518
mov dword [ebp - 0x3c], esi
mov dword [ebp + 0x18], edx
test edi, edi
je 0x408311
lea edi, [edi + ecx - 4]
mov dword [ebp + 0x10], edi
lea eax, [ebx + eax*4 + 8]
mov dword [ebp + 0xc], eax
test edi, edi
je 0x4083b5
movzx ecx, byte [edi]
movzx edx, byte [edi + 1]
movzx eax, byte [edi + 2]
movzx ebx, byte [edi + esi]
shl ecx, 8
or ecx, edx
movzx edx, byte [edi + 3]
add edi, esi
shl ecx, 8
or ecx, eax
movzx eax, byte [edi + 1]
shl ebx, 8
or ebx, eax
movzx eax, byte [edi + 3]
shl ecx, 8
or ecx, edx
movzx edx, byte [edi + 2]
shl ebx, 8
or ebx, edx
movzx edx, byte [edi + esi + 1]
add edi, esi
shl ebx, 8
or ebx, eax
movzx eax, byte [edi]
shl eax, 8
or eax, edx
movzx edx, byte [edi + 2]
shl eax, 8
or eax, edx
movzx edx, byte [edi + 3]
shl eax, 8
or eax, edx
movzx edx, byte [edi + esi + 1]
mov dword [ebp - 0x2c], eax
movzx eax, byte [edi + esi]
add edi, esi
shl eax, 8
or eax, edx
movzx edx, byte [edi + 2]
shl eax, 8
or eax, edx
movzx edx, byte [edi + 3]
shl eax, 8
or eax, edx
add edi, esi
mov dword [ebp - 0xc], ecx
mov dword [ebp - 0x10], ebx
mov dword [ebp - 0x28], eax
mov dword [ebp + 0x10], edi
jmp 0x4083bb
mov ecx, dword [ebp - 0xc]
mov ebx, dword [ebp - 0x10]
mov eax, dword [ebp - 0x30]
cdq
and edx, 3
add edx, eax
mov eax, dword [ebp - 0x24]
sar edx, 2
sub eax, edx
mov edx, dword [ebp + 0xc]
lea eax, [edx + eax*4]
mov edx, dword [ebp + 0x14]
mov dword [ebp - 0x34], eax
mov eax, dword [ebp + 0x1c]
add eax, edx
mov dword [ebp - 0x50], eax
cmp edx, eax
jae 0x4088b3
mov ecx, dword [ebp + 0x18]
add ecx, 6
lea esi, [edx + 5]
mov dword [ebp - 0x38], ecx
mov edi, edi
movzx ecx, byte [esi - 5]
movzx edx, byte [esi - 4]
movzx eax, byte [esi - 3]
shl ecx, 8
or ecx, edx
movzx edx, byte [esi - 2]
shl ecx, 8
or ecx, eax
shl ecx, 8
or ecx, edx
cmp byte [ebp + 8], 0
je 0x408492
movzx edx, byte [esi - 1]
movzx eax, byte [esi]
movzx edi, byte [esi + 3]
movzx ebx, byte [esi + 7]
shl edx, 8
or edx, eax
movzx eax, byte [esi + 1]
shl edx, 8
or edx, eax
movzx eax, byte [esi + 2]
shl edx, 8
or edx, eax
movzx eax, byte [esi + 4]
shl edi, 8
or edi, eax
movzx eax, byte [esi + 5]
shl edi, 8
or edi, eax
movzx eax, byte [esi + 6]
shl edi, 8
or edi, eax
movzx eax, byte [esi + 8]
shl ebx, 8
or ebx, eax
movzx eax, byte [esi + 9]
shl ebx, 8
or ebx, eax
movzx eax, byte [esi + 0xa]
shl ebx, 8
or ebx, eax
cmp dword [ebp + 0x10], 0
je 0x408519
xor ecx, dword [ebp - 0xc]
xor edx, dword [ebp - 0x10]
xor edi, dword [ebp - 0x2c]
xor ebx, dword [ebp - 0x28]
jmp 0x408519
movzx edx, byte [esi - 9]
movzx eax, byte [esi - 8]
movzx edi, byte [esi - 0xd]
movzx ebx, byte [esi - 0x11]
shl edx, 8
or edx, eax
movzx eax, byte [esi - 7]
shl edx, 8
or edx, eax
movzx eax, byte [esi - 6]
shl edx, 8
or edx, eax
movzx eax, byte [esi - 0xc]
shl edi, 8
or edi, eax
movzx eax, byte [esi - 0xb]
shl edi, 8
or edi, eax
movzx eax, byte [esi - 0xa]
shl edi, 8
or edi, eax
movzx eax, byte [esi - 0x10]
shl ebx, 8
or ebx, eax
movzx eax, byte [esi - 0xf]
shl ebx, 8
or ebx, eax
movzx eax, byte [esi - 0xe]
shl ebx, 8
or ebx, eax
cmp dword [ebp + 0x10], 0
je 0x408519
mov eax, dword [ebp - 0xc]
mov dword [ebp - 0x40], eax
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x44], eax
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x48], eax
mov eax, dword [ebp - 0x28]
mov dword [ebp - 0x4c], eax
mov dword [ebp - 0xc], ecx
mov dword [ebp - 0x10], edx
mov dword [ebp - 0x2c], edi
mov dword [ebp - 0x28], ebx
mov eax, dword [ebp + 0xc]
mov eax, dword [eax]
add esi, dword [ebp - 0x30]
xor eax, ecx
mov ecx, dword [ebp + 0xc]
mov ecx, dword [ecx + 4]
xor ecx, edx
mov edx, dword [ebp + 0xc]
mov edx, dword [edx + 8]
xor edx, edi
mov edi, dword [ebp + 0xc]
mov dword [ebp + 0x14], edx
mov edx, dword [edi + 0xc]
add edi, 0x10
xor edx, ebx
mov dword [ebp - 0x24], esi
mov dword [ebp - 8], edi
cmp edi, dword [ebp - 0x34]
je 0x408649
lea ebx, [ebx]
mov ebx, edx
shr ebx, 8
movzx esi, bl
mov ebx, dword [ebp + 0x14]
shr ebx, 0x10
movzx edi, bl
mov ebx, dword [ebp - 0x14]
mov esi, dword [ebx + esi*4]
mov ebx, dword [ebp - 0x18]
xor esi, dword [ebx + edi*4]
mov ebx, dword [ebp - 0x1c]
mov edi, ecx
shr edi, 0x18
xor esi, dword [ebx + edi*4]
mov ebx, dword [ebp - 0x20]
movzx edi, al
xor esi, dword [ebx + edi*4]
mov ebx, edx
shr ebx, 0x10
mov dword [ebp + 0x1c], esi
movzx esi, bl
mov ebx, eax
shr ebx, 8
movzx edi, bl
mov ebx, dword [ebp - 0x18]
mov esi, dword [ebx + esi*4]
mov ebx, dword [ebp - 0x14]
xor esi, dword [ebx + edi*4]
mov edi, dword [ebp + 0x14]
mov ebx, dword [ebp - 0x1c]
shr edi, 0x18
xor esi, dword [ebx + edi*4]
mov ebx, dword [ebp - 0x20]
movzx edi, cl
xor esi, dword [ebx + edi*4]
mov ebx, ecx
shr ebx, 8
mov dword [ebp + 0x18], esi
movzx esi, bl
mov ebx, eax
shr ebx, 0x10
movzx edi, bl
mov ebx, dword [ebp - 0x14]
mov esi, dword [ebx + esi*4]
mov ebx, dword [ebp - 0x18]
xor esi, dword [ebx + edi*4]
mov ebx, dword [ebp - 0x1c]
mov edi, edx
shr edi, 0x18
xor esi, dword [ebx + edi*4]
movzx edi, byte [ebp + 0x14]
mov ebx, dword [ebp - 0x20]
xor esi, dword [ebx + edi*4]
mov ebx, dword [ebp + 0x14]
shr ebx, 8
movzx edi, bl
mov ebx, dword [ebp - 0x14]
mov ebx, dword [ebx + edi*4]
mov edi, dword [ebp - 0x18]
shr ecx, 0x10
movzx ecx, cl
xor ebx, dword [edi + ecx*4]
mov ecx, dword [ebp - 0x1c]
mov edi, dword [ebp - 8]
shr eax, 0x18
xor ebx, dword [ecx + eax*4]
mov eax, dword [ebp - 0x20]
mov ecx, dword [edi + 4]
xor ecx, dword [ebp + 0x1c]
movzx edx, dl
xor ebx, dword [eax + edx*4]
mov edx, dword [edi + 8]
xor edx, dword [ebp + 0x18]
xor ebx, dword [edi]
mov dword [ebp + 0x14], edx
mov edx, dword [edi + 0xc]
add edi, 0x10
xor edx, esi
cmp edi, dword [ebp - 0x34]
mov eax, ebx
mov dword [ebp - 8], edi
jne 0x408556
mov esi, dword [ebp - 0x24]
mov ebx, dword [ebp - 4]
mov edi, eax
shr edi, 0x18
movzx edi, byte [edi + ebx]
shl edi, 8
mov dword [ebp + 0x18], edi
mov ebx, ecx
shr ebx, 0x10
movzx edi, bl
mov ebx, dword [ebp - 4]
movzx ebx, byte [edi + ebx]
mov edi, dword [ebp + 0x18]
xor edi, ebx
mov ebx, dword [ebp + 0x14]
shr ebx, 8
shl edi, 8
mov dword [ebp + 0x18], edi
movzx edi, bl
mov ebx, dword [ebp - 4]
movzx ebx, byte [edi + ebx]
mov edi, dword [ebp + 0x18]
xor edi, ebx
mov ebx, dword [ebp - 4]
shl edi, 8
mov dword [ebp + 0x18], edi
movzx edi, dl
movzx ebx, byte [edi + ebx]
mov edi, dword [ebp + 0x18]
xor edi, ebx
mov ebx, dword [ebp - 8]
xor edi, dword [ebx]
mov ebx, dword [ebp + 0x14]
shr ebx, 0x10
movzx ebx, bl
mov dword [ebp - 0x24], edi
mov edi, dword [ebp - 4]
movzx ebx, byte [ebx + edi]
mov dword [ebp + 0x18], ebx
mov ebx, ecx
shr ebx, 0x18
movzx ebx, byte [ebx + edi]
mov edi, dword [ebp + 0x18]
shl ebx, 8
xor edi, ebx
shl edi, 8
mov dword [ebp + 0x18], edi
mov ebx, edx
shr ebx, 8
movzx edi, bl
mov ebx, dword [ebp - 4]
movzx ebx, byte [edi + ebx]
mov edi, dword [ebp + 0x18]
xor edi, ebx
mov ebx, dword [ebp - 4]
shl edi, 8
mov dword [ebp + 0x18], edi
movzx edi, al
movzx ebx, byte [edi + ebx]
mov edi, dword [ebp + 0x18]
xor edi, ebx
mov ebx, dword [ebp - 8]
xor edi, dword [ebx + 4]
mov ebx, dword [ebp + 0x14]
shr ebx, 0x18
mov dword [ebp + 0x1c], edi
mov edi, dword [ebp - 4]
movzx ebx, byte [ebx + edi]
mov dword [ebp + 0x18], ebx
shl dword [ebp + 0x18], 8
mov ebx, edx
shr ebx, 0x10
movzx ebx, bl
movzx ebx, byte [ebx + edi]
mov edi, dword [ebp + 0x18]
xor edi, ebx
shl edi, 8
mov ebx, eax
shr ebx, 8
mov dword [ebp + 0x18], edi
movzx edi, bl
mov ebx, dword [ebp - 4]
movzx ebx, byte [edi + ebx]
mov edi, dword [ebp + 0x18]
xor edi, ebx
mov ebx, dword [ebp - 4]
shl edi, 8
mov dword [ebp + 0x18], edi
movzx edi, cl
movzx ebx, byte [edi + ebx]
mov edi, dword [ebp + 0x18]
xor edi, ebx
mov ebx, dword [ebp - 8]
xor edi, dword [ebx + 8]
shr edx, 0x18
shr eax, 0x10
mov dword [ebp + 0x18], edi
mov edi, dword [ebp - 4]
movzx edx, byte [edx + edi]
movzx eax, al
movzx eax, byte [eax + edi]
shr ecx, 8
shl edx, 8
xor edx, eax
movzx ecx, cl
movzx eax, byte [ecx + edi]
movzx ecx, byte [ebp + 0x14]
shl edx, 8
xor edx, eax
movzx eax, byte [ecx + edi]
mov edi, dword [ebp + 0x10]
shl edx, 8
xor edx, eax
mov ecx, ebx
xor edx, dword [ecx + 0xc]
mov ecx, dword [ebp - 0x24]
test edi, edi
je 0x4087d0
cmp byte [ebp + 8], 0
je 0x4087be
mov eax, dword [ebp + 0x1c]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp + 0x18]
mov dword [ebp - 0xc], ecx
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x28], edx
jmp 0x4087d0
mov eax, dword [ebp - 0x44]
xor dword [ebp + 0x1c], eax
mov eax, dword [ebp - 0x48]
xor ecx, dword [ebp - 0x40]
xor dword [ebp + 0x18], eax
xor edx, dword [ebp - 0x4c]
mov eax, dword [ebp - 0x38]
lea ebx, [eax - 6]
test ebx, ebx
je 0x40889e
mov ebx, ecx
shr ebx, 8
mov byte [eax - 4], bl
mov ebx, ecx
mov byte [eax - 3], cl
shr ecx, 0x18
shr ebx, 0x10
mov byte [eax - 6], cl
mov ecx, dword [ebp + 0x1c]
mov byte [eax - 5], bl
mov ebx, ecx
shr ebx, 8
cmp byte [ebp + 8], 0
je 0x40884f
mov byte [eax + 1], cl
mov byte [eax], bl
mov ebx, ecx
shr ecx, 0x18
shr ebx, 0x10
mov byte [eax - 2], cl
mov ecx, dword [ebp + 0x18]
mov byte [eax - 1], bl
mov ebx, ecx
shr ebx, 8
mov byte [eax + 5], cl
mov byte [eax + 4], bl
mov ebx, ecx
shr ecx, 0x18
mov byte [eax + 2], cl
mov ecx, edx
shr ecx, 8
mov byte [eax + 8], cl
mov ecx, edx
shr ebx, 0x10
shr ecx, 0x10
mov byte [eax + 9], dl
shr edx, 0x18
mov byte [eax + 3], bl
mov byte [eax + 7], cl
mov byte [eax + 6], dl
jmp 0x408898
mov byte [eax - 7], cl
mov byte [eax - 8], bl
mov ebx, ecx
shr ecx, 0x18
shr ebx, 0x10
mov byte [eax - 0xa], cl
mov ecx, dword [ebp + 0x18]
mov byte [eax - 9], bl
mov ebx, ecx
shr ebx, 8
mov byte [eax - 0xb], cl
mov byte [eax - 0xc], bl
mov ebx, ecx
shr ecx, 0x18
mov byte [eax - 0xe], cl
mov ecx, edx
shr ecx, 8
mov byte [eax - 0x10], cl
mov ecx, edx
shr ebx, 0x10
shr ecx, 0x10
mov byte [eax - 0xf], dl
shr edx, 0x18
mov byte [eax - 0xd], bl
mov byte [eax - 0x11], cl
mov byte [eax - 0x12], dl
add eax, dword [ebp - 0x30]
mov dword [ebp - 0x38], eax
lea edx, [esi - 5]
cmp edx, dword [ebp - 0x50]
jb 0x4083f6
mov esi, dword [ebp - 0x3c]
mov ecx, dword [ebp - 0xc]
mov ebx, dword [ebp - 0x10]
test edi, edi
je 0x408925
mov eax, dword [ebp - 0x28]
mov edx, eax
shr edx, 8
sub edi, esi
mov byte [edi + 2], dl
mov byte [edi + 3], al
mov edx, eax
shr edx, 0x10
mov byte [edi + 1], dl
shr eax, 0x18
mov byte [edi], al
mov eax, dword [ebp - 0x2c]
mov edx, eax
shr edx, 8
sub edi, esi
mov byte [edi + 2], dl
mov byte [edi + 3], al
mov edx, eax
shr edx, 0x10
mov byte [edi + 1], dl
shr eax, 0x18
mov byte [edi], al
sub edi, esi
mov byte [edi + 3], bl
mov eax, ebx
shr eax, 8
mov byte [edi + 2], al
mov edx, ebx
shr edx, 0x10
mov byte [edi + 1], dl
shr ebx, 0x18
mov byte [edi], bl
sub edi, esi
mov eax, ecx
mov edx, ecx
shr eax, 8
shr edx, 0x10
mov byte [edi + 3], cl
shr ecx, 0x18
mov byte [edi + 2], al
mov byte [edi + 1], dl
mov byte [edi], cl
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x18