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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34
cmp byte [0x680737], 0
push ebx
push esi
mov esi, ecx
push edi
mov dword [ebp - 0x24], esi
jne 0x518fbc
call fcn.005146a0
cmp byte [0x682ad2], 0
je 0x5193b8
mov ecx, dword [esi + 0xc]
mov eax, dword [esi + 0x18]
shl ecx, 4
add ecx, eax
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x18], ecx
mov edx, dword [0x668df4]
mov edi, dword [ebp + 8]
mov esi, dword [ebp - 0x14]
movd mm5, dword [ebp - 0x18]
push ebp
lea ebp, [0x5ff6e8]
mov eax, dword [esi]
xor eax, dword [edi]
movd mm0, eax
mov ebx, dword [esi + 4]
xor ebx, dword [edi + 4]
movd mm1, ebx
and ebx, eax
mov eax, dword [esi + 8]
xor eax, dword [edi + 8]
movd mm2, eax
and ebx, eax
mov ecx, dword [esi + 0xc]
xor ecx, dword [edi + 0xc]
and ebx, ecx
and ebx, 0
mov edi, ebx
and ebx, dword [ebp + edi]
add edi, edx
and ebx, dword [ebp + edi]
add edi, edx
and ebx, dword [ebp + edi]
add edi, edx
and ebx, dword [ebp + edi]
add edi, edx
cmp edi, 0x400
jl 0x51901b
and ebx, dword [ebp + 0x3fc]
movd mm6, ebx
pxor mm2, mm6
pxor mm1, mm6
pxor mm0, mm6
xor ecx, ebx
mov edi, dword [esi + 0x10]
mov eax, dword [esi + 0x14]
mov ebx, dword [esi + 0x18]
mov edx, dword [esi + 0x1c]
add esi, 0x20
movd mm4, esi
movzx esi, cl
xor edx, dword [ebp + esi*4]
movzx esi, ch
xor ebx, dword [ebp + esi*4 + 0x400]
shr ecx, 0x10
movzx esi, cl
xor eax, dword [ebp + esi*4 + 0x800]
movzx esi, ch
xor edi, dword [ebp + esi*4 + 0xc00]
movd ecx, mm2
movzx esi, cl
xor ebx, dword [ebp + esi*4]
movzx esi, ch
xor eax, dword [ebp + esi*4 + 0x400]
shr ecx, 0x10
movzx esi, cl
xor edi, dword [ebp + esi*4 + 0x800]
movzx esi, ch
xor edx, dword [ebp + esi*4 + 0xc00]
movd ecx, mm1
movzx esi, cl
xor eax, dword [ebp + esi*4]
movzx esi, ch
xor edi, dword [ebp + esi*4 + 0x400]
shr ecx, 0x10
movzx esi, cl
xor edx, dword [ebp + esi*4 + 0x800]
movzx esi, ch
xor ebx, dword [ebp + esi*4 + 0xc00]
movd ecx, mm0
movzx esi, cl
xor edi, dword [ebp + esi*4]
movzx esi, ch
xor edx, dword [ebp + esi*4 + 0x400]
shr ecx, 0x10
movzx esi, cl
xor ebx, dword [ebp + esi*4 + 0x800]
movzx esi, ch
xor eax, dword [ebp + esi*4 + 0xc00]
movd mm2, ebx
movd mm1, eax
movd mm0, edi
movd esi, mm4
mov edi, dword [esi]
mov eax, dword [esi + 4]
mov ebx, dword [esi + 8]
mov ecx, dword [esi + 0xc]
movzx esi, dl
xor edi, dword [ebp + esi*4 + 0xc00]
movzx esi, dh
xor eax, dword [ebp + esi*4 + 0x800]
shr edx, 0x10
movzx esi, dl
xor ebx, dword [ebp + esi*4 + 0x400]
movzx esi, dh
xor ecx, dword [ebp + esi*4]
movd edx, mm2
movzx esi, dl
xor ecx, dword [ebp + esi*4 + 0xc00]
movzx esi, dh
xor edi, dword [ebp + esi*4 + 0x800]
shr edx, 0x10
movzx esi, dl
xor eax, dword [ebp + esi*4 + 0x400]
movzx esi, dh
xor ebx, dword [ebp + esi*4]
movd edx, mm1
movzx esi, dl
xor ebx, dword [ebp + esi*4 + 0xc00]
movzx esi, dh
xor ecx, dword [ebp + esi*4 + 0x800]
shr edx, 0x10
movzx esi, dl
xor edi, dword [ebp + esi*4 + 0x400]
movzx esi, dh
xor eax, dword [ebp + esi*4]
movd edx, mm0
movzx esi, dl
xor eax, dword [ebp + esi*4 + 0xc00]
movzx esi, dh
xor ebx, dword [ebp + esi*4 + 0x800]
shr edx, 0x10
movzx esi, dl
xor ecx, dword [ebp + esi*4 + 0x400]
movzx esi, dh
xor edi, dword [ebp + esi*4]
movd esi, mm4
movd mm2, ebx
movd mm1, eax
movd mm0, edi
mov edi, dword [esi + 0x10]
mov eax, dword [esi + 0x14]
mov ebx, dword [esi + 0x18]
mov edx, dword [esi + 0x1c]
movzx esi, cl
xor edi, dword [ebp + esi*4 + 0xc00]
movzx esi, ch
xor eax, dword [ebp + esi*4 + 0x800]
shr ecx, 0x10
movzx esi, cl
xor ebx, dword [ebp + esi*4 + 0x400]
movzx esi, ch
xor edx, dword [ebp + esi*4]
movd ecx, mm2
movzx esi, cl
xor edx, dword [ebp + esi*4 + 0xc00]
movzx esi, ch
xor edi, dword [ebp + esi*4 + 0x800]
shr ecx, 0x10
movzx esi, cl
xor eax, dword [ebp + esi*4 + 0x400]
movzx esi, ch
xor ebx, dword [ebp + esi*4]
movd ecx, mm1
movzx esi, cl
xor ebx, dword [ebp + esi*4 + 0xc00]
movzx esi, ch
xor edx, dword [ebp + esi*4 + 0x800]
shr ecx, 0x10
movzx esi, cl
xor edi, dword [ebp + esi*4 + 0x400]
movzx esi, ch
xor eax, dword [ebp + esi*4]
movd ecx, mm0
movzx esi, cl
xor eax, dword [ebp + esi*4 + 0xc00]
movzx esi, ch
xor ebx, dword [ebp + esi*4 + 0x800]
shr ecx, 0x10
movzx esi, cl
xor edx, dword [ebp + esi*4 + 0x400]
movzx esi, ch
xor edi, dword [ebp + esi*4]
movd mm2, ebx
movd mm1, eax
movd mm0, edi
movd esi, mm4
movd edi, mm5
add esi, 0x20
movd mm4, esi
cmp edi, esi
jne 0x519116
mov eax, dword [edi]
mov ecx, dword [edi + 4]
mov esi, dword [edi + 8]
mov edi, dword [edi + 0xc]
movzx ebx, dl
movzx ebx, byte [ebp + ebx*4 + 1]
shl ebx, 0x18
xor eax, ebx
movzx ebx, dh
movzx ebx, byte [ebp + ebx*4 + 1]
shl ebx, 0x10
xor ecx, ebx
shr edx, 0x10
movzx ebx, dl
shr edx, 8
movzx ebx, byte [ebp + ebx*4 + 1]
shl ebx, 8
xor esi, ebx
movzx ebx, byte [ebp + edx*4 + 1]
xor edi, ebx
movd edx, mm2
movzx ebx, dl
movzx ebx, byte [ebp + ebx*4 + 1]
shl ebx, 0x18
xor edi, ebx
movzx ebx, dh
movzx ebx, byte [ebp + ebx*4 + 1]
shl ebx, 0x10
xor eax, ebx
shr edx, 0x10
movzx ebx, dl
shr edx, 8
movzx ebx, byte [ebp + ebx*4 + 1]
shl ebx, 8
xor ecx, ebx
movzx ebx, byte [ebp + edx*4 + 1]
xor esi, ebx
movd edx, mm1
movzx ebx, dl
movzx ebx, byte [ebp + ebx*4 + 1]
shl ebx, 0x18
xor esi, ebx
movzx ebx, dh
movzx ebx, byte [ebp + ebx*4 + 1]
shl ebx, 0x10
xor edi, ebx
shr edx, 0x10
movzx ebx, dl
shr edx, 8
movzx ebx, byte [ebp + ebx*4 + 1]
shl ebx, 8
xor eax, ebx
movzx ebx, byte [ebp + edx*4 + 1]
xor ecx, ebx
movd edx, mm0
movzx ebx, dl
movzx ebx, byte [ebp + ebx*4 + 1]
shl ebx, 0x18
xor ecx, ebx
movzx ebx, dh
movzx ebx, byte [ebp + ebx*4 + 1]
shl ebx, 0x10
xor esi, ebx
shr edx, 0x10
movzx ebx, dl
shr edx, 8
movzx ebx, byte [ebp + ebx*4 + 1]
shl ebx, 8
xor edi, ebx
movzx ebx, byte [ebp + edx*4 + 1]
xor eax, ebx
emms
pop ebp
mov ebx, dword [ebp + 0xc]
test ebx, ebx
je 0x5193a1
xor eax, dword [ebx]
xor ecx, dword [ebx + 4]
xor esi, dword [ebx + 8]
xor edi, dword [ebx + 0xc]
mov ebx, dword [ebp + 0x10]
mov dword [ebx], eax
mov dword [ebx + 4], ecx
mov dword [ebx + 8], esi
mov dword [ebx + 0xc], edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov esi, dword [esi + 0x18]
mov edx, dword [ebp + 8]
mov edi, dword [esi + 8]
xor edi, dword [edx + 8]
mov eax, dword [edx]
mov ecx, dword [esi + 4]
xor ecx, dword [edx + 4]
xor eax, dword [esi]
mov ebx, dword [esi + 0x1c]
mov dword [ebp - 0x10], edi
mov edi, dword [esi + 0xc]
xor edi, dword [edx + 0xc]
mov edx, dword [esi + 0x10]
mov dword [ebp - 4], edx
mov edx, dword [esi + 0x14]
mov dword [ebp - 8], edx
mov edx, dword [esi + 0x18]
add esi, 0x20
cmp byte [0x680737], 0
mov dword [ebp - 0x18], eax
mov dword [ebp - 0xc], ecx
mov dword [ebp - 0x1c], edi
mov dword [ebp + 8], edx
mov dword [ebp - 0x14], esi
jne 0x51940f
call fcn.005146a0
mov eax, dword [ebp - 0x18]
mov ecx, dword [ebp - 0xc]
xor edi, edi
xor edx, edx
jmp 0x519423
mov edi, dword [ebp - 0xc]
and edi, dword [edx + 0x5ff6e8]
add edx, dword [0x668df4]
mov dword [ebp - 0xc], edi
cmp edx, 0x400
jb 0x519420
mov edx, edi
and edx, 0x2c16163a
or dword [ebp - 0x10], edx
or ecx, edx
or eax, edx
mov dword [ebp - 0xc], edx
mov edx, dword [ebp - 0x1c]
or edx, dword [ebp - 0xc]
movzx edi, dl
xor ebx, dword [edi*4 + 0x5ff6e8]
shr edx, 8
movzx edi, dl
mov edi, dword [edi*4 + 0x5ff6e8]
shr edx, 8
ror edi, 8
mov dword [ebp - 0x1c], edi
movzx edi, dl
mov edi, dword [edi*4 + 0x5ff6e8]
shr edx, 8
mov edx, dword [edx*4 + 0x5ff6e8]
ror edi, 0x10
ror edx, 0x18
mov dword [ebp - 0xc], edx
movzx edx, byte [ebp - 0x10]
mov edx, dword [edx*4 + 0x5ff6e8]
xor edx, dword [ebp - 0x1c]
mov dword [ebp - 0x18], edi
xor dword [ebp + 8], edx
mov edx, dword [ebp - 0x10]
shr edx, 8
movzx edi, dl
mov edi, dword [edi*4 + 0x5ff6e8]
shr edx, 8
ror edi, 8
mov dword [ebp - 0x1c], edi
movzx edi, dl
mov edi, dword [edi*4 + 0x5ff6e8]
shr edx, 8
mov edx, dword [edx*4 + 0x5ff6e8]
ror edi, 0x10
ror edx, 0x18
mov dword [ebp - 0x20], edx
movzx edx, cl
mov edx, dword [edx*4 + 0x5ff6e8]
xor edx, dword [ebp - 0x1c]
shr ecx, 8
xor edx, dword [ebp - 0x18]
mov dword [ebp - 0x10], edi
xor dword [ebp - 8], edx
movzx edx, cl
mov edx, dword [edx*4 + 0x5ff6e8]
shr ecx, 8
movzx edi, cl
mov edi, dword [edi*4 + 0x5ff6e8]
shr ecx, 8
mov ecx, dword [ecx*4 + 0x5ff6e8]
ror edx, 8
ror edi, 0x10
ror ecx, 0x18
mov dword [ebp - 0x1c], ecx
movzx ecx, al
mov ecx, dword [ecx*4 + 0x5ff6e8]
xor ecx, edx
xor ecx, dword [ebp - 0x10]
shr eax, 8
xor ecx, dword [ebp - 0xc]
movzx edx, al
xor dword [ebp - 4], ecx
mov ecx, dword [edx*4 + 0x5ff6e8]
ror ecx, 8
xor ecx, edi
xor ecx, dword [ebp - 0x20]
shr eax, 8
movzx edx, al
xor ebx, ecx
mov ecx, dword [edx*4 + 0x5ff6e8]
ror ecx, 0x10
xor ecx, dword [ebp - 0x1c]
xor dword [ebp + 8], ecx
shr eax, 8
mov edx, dword [eax*4 + 0x5ff6e8]
mov eax, dword [ebp - 0x24]
mov eax, dword [eax + 0xc]
ror edx, 0x18
xor dword [ebp - 8], edx
shr eax, 1
dec eax
mov dword [ebp - 0x18], eax
movzx ecx, bl
mov eax, dword [ecx*4 + 0x6002e8]
shr ebx, 8
movzx edx, bl
mov edi, dword [edx*4 + 0x5ffee8]
xor edi, dword [esi + 4]
shr ebx, 8
movzx ecx, bl
mov edx, dword [ecx*4 + 0x5ffae8]
movzx ecx, byte [ebp + 8]
xor eax, dword [esi]
shr ebx, 8
mov dword [ebp - 0x24], ecx
mov ecx, dword [ebx*4 + 0x5ff6e8]
mov ebx, dword [ebp - 0x24]
xor ecx, dword [ebx*4 + 0x6002e8]
mov ebx, dword [ebp + 8]
shr ebx, 8
mov dword [ebp + 8], ebx
movzx ebx, bl
xor eax, dword [ebx*4 + 0x5ffee8]
mov ebx, dword [ebp + 8]
xor edx, dword [esi + 8]
xor ecx, dword [esi + 0xc]
shr ebx, 8
mov dword [ebp + 8], ebx
movzx ebx, bl
xor edi, dword [ebx*4 + 0x5ffae8]
movzx ebx, byte [ebp - 8]
mov dword [ebp - 0xc], edi
mov edi, dword [ebp + 8]
shr edi, 8
mov edi, dword [edi*4 + 0x5ff6e8]
xor edi, dword [ebx*4 + 0x6002e8]
mov ebx, dword [ebp - 8]
xor edx, edi
shr ebx, 8
movzx edi, bl
xor ecx, dword [edi*4 + 0x5ffee8]
shr ebx, 8
movzx edi, bl
xor eax, dword [edi*4 + 0x5ffae8]
movzx edi, byte [ebp - 4]
shr ebx, 8
mov ebx, dword [ebx*4 + 0x5ff6e8]
xor ebx, dword [edi*4 + 0x6002e8]
xor dword [ebp - 0xc], ebx
mov ebx, dword [ebp - 4]
shr ebx, 8
movzx edi, bl
xor edx, dword [edi*4 + 0x5ffee8]
shr ebx, 8
movzx edi, bl
xor ecx, dword [edi*4 + 0x5ffae8]
shr ebx, 8
xor eax, dword [ebx*4 + 0x5ff6e8]
movzx edi, cl
mov edi, dword [edi*4 + 0x6002e8]
xor edi, dword [esi + 0x10]
shr ecx, 8
mov dword [ebp - 4], edi
movzx edi, cl
mov edi, dword [edi*4 + 0x5ffee8]
xor edi, dword [esi + 0x14]
shr ecx, 8
mov dword [ebp - 8], edi
movzx ebx, dl
mov edi, ecx
shr edi, 8
mov edi, dword [edi*4 + 0x5ff6e8]
xor edi, dword [ebx*4 + 0x6002e8]
shr edx, 8
xor edi, dword [esi + 0x1c]
movzx esi, dl
mov esi, dword [esi*4 + 0x5ffee8]
xor dword [ebp - 4], esi
shr edx, 8
mov esi, edx
mov ebx, edi
mov dword [ebp - 0x10], edx
shr esi, 8
mov edx, dword [ebp - 0xc]
mov esi, dword [esi*4 + 0x5ff6e8]
movzx ecx, cl
movzx edi, dl
xor esi, dword [edi*4 + 0x6002e8]
shr edx, 8
xor esi, dword [ecx*4 + 0x5ffae8]
movzx ecx, dl
xor ebx, dword [ecx*4 + 0x5ffee8]
mov edi, esi
mov esi, dword [ebp - 0x14]
xor edi, dword [esi + 0x18]
shr edx, 8
mov dword [ebp + 8], edi
movzx edi, al
mov ecx, edx
shr ecx, 8
mov ecx, dword [ecx*4 + 0x5ff6e8]
xor ecx, dword [edi*4 + 0x6002e8]
movzx edi, byte [ebp - 0x10]
xor ecx, dword [edi*4 + 0x5ffae8]
shr eax, 8
xor dword [ebp - 8], ecx
movzx ecx, al
mov ecx, dword [ecx*4 + 0x5ffee8]
xor dword [ebp + 8], ecx
shr eax, 8
movzx ecx, al
xor ebx, dword [ecx*4 + 0x5ffae8]
shr eax, 8
mov eax, dword [eax*4 + 0x5ff6e8]
movzx edx, dl
xor eax, dword [edx*4 + 0x5ffae8]
add esi, 0x20
xor dword [ebp - 4], eax
sub dword [ebp - 0x18], 1
mov dword [ebp - 0x14], esi
jne 0x51957d
xor edx, edx
xor eax, eax
jmp 0x519770
and edx, dword [eax + str.cw]
add eax, dword [0x668df4]
cmp eax, 0x100
jb 0x519770
and edx, dword [0x5ff5e4]
mov eax, dword [ebp - 4]
mov ecx, dword [ebp - 8]
or ecx, edx
or eax, edx
mov dword [ebp - 0xc], edx
mov edx, dword [ebp + 8]
or edx, dword [ebp - 0xc]
or ebx, dword [ebp - 0xc]
mov dword [ebp + 8], edx
movzx edx, dl
movzx edx, byte [edx + str.cw]
mov byte [ebp - 0x25], dl
mov edx, dword [ebp + 8]
shr edx, 8
mov dword [ebp + 8], edx
movzx edx, dl
movzx edx, byte [edx + str.cw]
mov byte [ebp - 0x32], dl
mov edx, dword [ebp + 8]
shr edx, 8
mov dword [ebp + 8], edx
mov edi, dword [ebp + 8]
movzx edx, dl
movzx edx, byte [edx + str.cw]
mov byte [ebp - 0x2f], dl
shr edi, 8
movzx edx, byte [edi + str.cw]
mov byte [ebp - 0x2c], dl
movzx edx, cl
movzx edx, byte [edx + str.cw]
shr ecx, 8
mov byte [ebp - 0x29], dl
movzx edx, cl
movzx edx, byte [edx + str.cw]
shr ecx, 8
mov byte [ebp - 0x26], dl
movzx edx, cl
movzx edx, byte [edx + str.cw]
shr ecx, 8
movzx ecx, byte [ecx + str.cw]
mov byte [ebp - 0x33], dl
movzx edx, al
shr eax, 8
mov byte [ebp - 0x30], cl
movzx ecx, byte [edx + str.cw]
movzx edx, al
shr eax, 8
mov byte [ebp - 0x2d], cl
movzx ecx, byte [edx + str.cw]
movzx edx, al
shr eax, 8
mov byte [ebp - 0x2a], cl
movzx ecx, byte [edx + str.cw]
movzx edx, byte [eax + str.cw]
movzx eax, bl
shr ebx, 8
mov byte [ebp - 0x34], dl
movzx edx, bl
mov byte [ebp - 0x27], cl
movzx ecx, byte [eax + str.cw]
movzx eax, byte [edx + str.cw]
shr ebx, 8
mov byte [ebp - 0x31], cl
movzx ecx, bl
movzx edx, byte [ecx + str.cw]
shr ebx, 8
mov byte [ebp - 0x2e], al
movzx eax, byte [ebx + str.cw]
mov byte [ebp - 0x28], al
mov eax, dword [ebp + 0xc]
mov byte [ebp - 0x2b], dl
test eax, eax
je 0x5198d9
mov edx, dword [eax]
xor edx, dword [ebp - 0x34]
mov ecx, dword [ebp + 0x10]
xor edx, dword [esi]
mov dword [ecx], edx
mov edx, dword [esi + 4]
xor edx, dword [eax + 4]
xor edx, dword [ebp - 0x30]
mov dword [ecx + 4], edx
mov edx, dword [esi + 8]
xor edx, dword [eax + 8]
xor edx, dword [ebp - 0x2c]
mov dword [ecx + 8], edx
mov edx, dword [esi + 0xc]
xor edx, dword [eax + 0xc]
xor edx, dword [ebp - 0x28]
mov dword [ecx + 0xc], edx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov ecx, dword [esi]
xor ecx, dword [ebp - 0x34]
mov eax, dword [ebp + 0x10]
mov dword [eax], ecx
mov edx, dword [esi + 4]
xor edx, dword [ebp - 0x30]
pop edi
mov dword [eax + 4], edx
mov ecx, dword [esi + 8]
xor ecx, dword [ebp - 0x2c]
mov dword [eax + 8], ecx
mov edx, dword [esi + 0xc]
xor edx, dword [ebp - 0x28]
pop esi
mov dword [eax + 0xc], edx
pop ebx
mov esp, ebp
pop ebp
ret 0xc