Function at 0x504060
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff8
sub esp, 0x38
mov esi, dword [ebp + 0x18]
mov ebx, dword [ebp + 8]
mov ecx, dword [ebx + 0x3c]
mov edx, dword [ebx + 0x38]
add edx, esi
adc ecx, 0
xor eax, eax
mov edi, 0xffffffe0
cmp edi, edx
mov edi, 0xf
sbb edi, ecx
jb 0x5046d4
mov dword [ebx + 0x38], edx
mov dword [ebx + 0x3c], ecx
cmp dword [ebx + 0x174], 0
mov edx, ebx
je 0x50413e
mov eax, dword [ebp + 8]
lea edx, [eax + 0x60]
movdqu xmm0, xmmword [eax + 0x40]
pxor xmm2, xmm2
movdqa xmm1, xmm0
punpcklbw xmm1, xmm2
pshufd xmm1, xmm1, 0x4e
pshuflw xmm1, xmm1, 0x1b
pshufhw xmm1, xmm1, 0x1b
punpckhbw xmm0, xmm2
pshufd xmm0, xmm0, 0x4e
pshuflw xmm0, xmm0, 0x1b
pshufhw xmm0, xmm0, 0x1b
packuswb xmm0, xmm1
movdqu xmmword [esp + 0x18], xmm0
lea ecx, [esp + 0x18]
call fcn.005048c0
mov edx, dword [ebp + 8]
movdqu xmm0, xmmword [esp + 0x18]
movdqa xmm1, xmm0
pxor xmm2, xmm2
punpcklbw xmm1, xmm2
pshufd xmm1, xmm1, 0x4e
pshuflw xmm1, xmm1, 0x1b
pshufhw xmm1, xmm1, 0x1b
punpckhbw xmm0, xmm2
pshufd xmm0, xmm0, 0x4e
pshuflw xmm0, xmm0, 0x1b
pshufhw xmm0, xmm0, 0x1b
packuswb xmm0, xmm1
movdqu xmmword [edx + 0x40], xmm0
mov dword [edx + 0x174], 0
mov edi, dword [ebp + 0x14]
mov ebx, dword [ebp + 0x10]
mov eax, dword [edx + 0x170]
test eax, eax
je 0x504222
test esi, esi
je 0x5046c9
nop word [eax + eax]
movzx ecx, byte [ebx]
inc ebx
mov edx, dword [ebp + 8]
movzx edx, byte [edx + eax + 0x10]
xor dl, cl
mov byte [edi], dl
mov edx, dword [ebp + 8]
xor byte [edx + eax + 0x40], cl
inc edi
lea ecx, [esi - 1]
inc eax
and eax, 0xf
je 0x504188
cmp esi, 1
mov esi, ecx
jne 0x504160
test eax, eax
jne 0x5046c9
mov eax, dword [ebp + 8]
lea edx, [eax + 0x60]
movdqu xmm0, xmmword [eax + 0x40]
pxor xmm2, xmm2
movdqa xmm1, xmm0
punpcklbw xmm1, xmm2
pshufd xmm1, xmm1, 0x4e
pshuflw xmm1, xmm1, 0x1b
pshufhw xmm1, xmm1, 0x1b
punpckhbw xmm0, xmm2
pshufd xmm0, xmm0, 0x4e
pshuflw xmm0, xmm0, 0x1b
pshufhw xmm0, xmm0, 0x1b
packuswb xmm0, xmm1
movdqu xmmword [esp + 0x18], xmm0
mov esi, ecx
lea ecx, [esp + 0x18]
call fcn.005048c0
mov edx, dword [ebp + 8]
mov ecx, esi
movdqu xmm0, xmmword [esp + 0x18]
movdqa xmm1, xmm0
pxor xmm2, xmm2
punpcklbw xmm1, xmm2
pshufd xmm1, xmm1, 0x4e
pshuflw xmm1, xmm1, 0x1b
pshufhw xmm1, xmm1, 0x1b
punpckhbw xmm0, xmm2
pshufd xmm0, xmm0, 0x4e
pshuflw xmm0, xmm0, 0x1b
pshufhw xmm0, xmm0, 0x1b
packuswb xmm0, xmm1
movdqu xmmword [edx + 0x40], xmm0
jmp 0x504224
mov ecx, esi
mov eax, dword [edx + 0xc]
bswap eax
mov dword [esp + 0xc], eax
cmp ecx, 0xc00
mov dword [esp + 8], edi
jb 0x50438c
lea eax, [edx + 0x60]
mov dword [esp + 0x14], eax
nop word cs:[eax + eax]
mov dword [esp + 4], ecx
movdqu xmm0, xmmword [edx + 0x40]
movdqa xmm1, xmm0
pxor xmm2, xmm2
punpcklbw xmm1, xmm2
pshufd xmm1, xmm1, 0x4e
pshuflw xmm1, xmm1, 0x1b
pshufhw xmm1, xmm1, 0x1b
punpckhbw xmm0, xmm2
pshufd xmm0, xmm0, 0x4e
pshuflw xmm0, xmm0, 0x1b
pshufhw xmm0, xmm0, 0x1b
packuswb xmm0, xmm1
movdqu xmmword [esp + 0x18], xmm0
mov edi, ebx
mov ebx, 0xfffff400
mov esi, dword [esp + 0x14]
nop dword [eax]
movdqu xmm0, xmmword [edi + ebx + 0xc00]
movdqa xmm1, xmm0
pxor xmm2, xmm2
punpcklbw xmm1, xmm2
pshufd xmm1, xmm1, 0x4e
pshuflw xmm1, xmm1, 0x1b
pshufhw xmm1, xmm1, 0x1b
punpckhbw xmm0, xmm2
pshufd xmm0, xmm0, 0x4e
pshuflw xmm0, xmm0, 0x1b
pshufhw xmm0, xmm0, 0x1b
packuswb xmm0, xmm1
movdqu xmm1, xmmword [esp + 0x18]
pxor xmm1, xmm0
movdqu xmmword [esp + 0x18], xmm1
lea ecx, [esp + 0x18]
mov edx, esi
call fcn.005048c0
add ebx, 0x10
jne 0x5042a0
movdqu xmm0, xmmword [esp + 0x18]
movdqa xmm1, xmm0
pxor xmm2, xmm2
punpcklbw xmm1, xmm2
pshufd xmm1, xmm1, 0x4e
pshuflw xmm1, xmm1, 0x1b
pshufhw xmm1, xmm1, 0x1b
punpckhbw xmm0, xmm2
pshufd xmm0, xmm0, 0x4e
pshuflw xmm0, xmm0, 0x1b
pshufhw xmm0, xmm0, 0x1b
packuswb xmm0, xmm1
mov esi, dword [ebp + 8]
movdqu xmmword [esi + 0x40], xmm0
push esi
push dword [ebp + 0xc]
push 0xc0
mov ebx, dword [esp + 0x14]
push ebx
push edi
call dword [ebp + 0x1c]
mov edx, esi
add esp, 0x14
mov eax, dword [esp + 0xc]
add eax, 0xc0
mov dword [esp + 0xc], eax
bswap eax
mov dword [esi + 0xc], eax
add ebx, 0xc00
mov dword [esp + 8], ebx
add edi, 0xc00
mov ecx, dword [esp + 4]
add ecx, 0xfffff400
cmp ecx, 0xbff
mov ebx, edi
ja 0x504250
mov eax, ecx
and eax, 0xff0
je 0x50450a
mov dword [esp + 4], ecx
lea esi, [edx + 0x60]
movdqu xmm0, xmmword [edx + 0x40]
pxor xmm2, xmm2
movdqa xmm1, xmm0
punpcklbw xmm1, xmm2
pshufd xmm1, xmm1, 0x4e
pshuflw xmm1, xmm1, 0x1b
pshufhw xmm1, xmm1, 0x1b
punpckhbw xmm0, xmm2
pshufd xmm0, xmm0, 0x4e
pshuflw xmm0, xmm0, 0x1b
pshufhw xmm0, xmm0, 0x1b
packuswb xmm0, xmm1
movdqu xmmword [esp + 0x18], xmm0
xor edi, edi
mov dword [esp + 0x14], eax
nop word cs:[eax + eax]
movdqu xmm0, xmmword [ebx + edi]
movdqa xmm1, xmm0
pxor xmm2, xmm2
punpcklbw xmm1, xmm2
pshufd xmm1, xmm1, 0x4e
pshuflw xmm1, xmm1, 0x1b
pshufhw xmm1, xmm1, 0x1b
punpckhbw xmm0, xmm2
pshufd xmm0, xmm0, 0x4e
pshuflw xmm0, xmm0, 0x1b
pshufhw xmm0, xmm0, 0x1b
packuswb xmm0, xmm1
movdqu xmm1, xmmword [esp + 0x18]
pxor xmm1, xmm0
movdqu xmmword [esp + 0x18], xmm1
lea ecx, [esp + 0x18]
mov edx, esi
call fcn.005048c0
add edi, 0x10
cmp dword [esp + 0x14], edi
jne 0x5043f0
mov eax, dword [esp + 4]
shr eax, 4
mov dword [esp + 0x2c], eax
pxor xmm0, xmm0
movdqu xmm1, xmmword [esp + 0x18]
movdqa xmm2, xmm1
punpcklbw xmm2, xmm0
pshufd xmm2, xmm2, 0x4e
pshuflw xmm2, xmm2, 0x1b
pshufhw xmm2, xmm2, 0x1b
punpckhbw xmm1, xmm0
pshufd xmm0, xmm1, 0x4e
pshuflw xmm0, xmm0, 0x1b
pshufhw xmm0, xmm0, 0x1b
packuswb xmm0, xmm2
mov edi, dword [ebp + 8]
movdqu xmmword [edi + 0x40], xmm0
push edi
push dword [ebp + 0xc]
push eax
mov esi, dword [esp + 0x14]
push esi
push ebx
call dword [ebp + 0x1c]
mov edx, edi
mov ecx, dword [esp + 0x18]
add esp, 0x14
mov edi, dword [esp + 0xc]
add edi, dword [esp + 0x2c]
mov eax, edi
bswap eax
mov dword [edx + 0xc], eax
mov eax, dword [esp + 0x14]
add esi, eax
mov dword [esp + 8], esi
add ebx, eax
and ecx, 0xf
test ecx, ecx
je 0x504512
mov dword [esp + 0xc], ebx
lea ebx, [edx + 0x10]
push dword [ebp + 0xc]
push ebx
push edx
mov dword [esp + 0x10], ecx
mov esi, edx
call dword [edx + 0x168]
mov edx, esi
mov ecx, dword [esp + 0x10]
add esp, 0xc
inc edi
bswap edi
mov dword [esi + 0xc], edi
xor eax, eax
cmp ecx, 8
jae 0x504519
mov esi, dword [esp + 0xc]
mov edi, dword [esp + 8]
jmp 0x50464c
mov edi, dword [esp + 0xc]
test ecx, ecx
jne 0x5044cf
xor eax, eax
jmp 0x5046c9
add edx, ecx
add edx, 0x40
mov dword [esp + 0x30], edx
mov esi, dword [esp + 8]
lea edx, [esi + ecx]
mov dword [esp + 0x2c], edx
mov edi, ecx
mov ecx, dword [esp + 0xc]
add edi, ecx
cmp ebx, edx
setb byte [esp + 0x14]
mov edx, dword [esp + 0x30]
cmp esi, edx
setb byte [esp + 0x13]
cmp ebx, edi
setb bh
cmp ecx, edx
setb dh
cmp esi, edi
setb dl
cmp ecx, dword [esp + 0x2c]
setb bl
movzx ecx, byte [esp + 0x13]
test byte [esp + 0x14], cl
jne 0x5045da
and bh, dh
jne 0x5045da
mov ecx, dword [esp + 4]
and dl, bl
mov edx, dword [ebp + 8]
mov edi, dword [esp + 8]
mov esi, dword [esp + 0xc]
jne 0x50464c
xor eax, eax
mov ecx, dword [esp + 4]
cmp ecx, 0x10
jb 0x5045f5
mov eax, ecx
and eax, 0xfffffff0
xor ecx, ecx
nop word cs:[eax + eax]
movdqu xmm0, xmmword [esi + ecx]
movdqu xmm1, xmmword [edx + ecx + 0x10]
movdqu xmm2, xmmword [edx + ecx + 0x40]
pxor xmm2, xmm0
movdqu xmmword [edx + ecx + 0x40], xmm2
pxor xmm1, xmm0
movdqu xmmword [edi + ecx], xmm1
add ecx, 0x10
cmp eax, ecx
jne 0x5045a0
mov ecx, dword [esp + 4]
cmp ecx, eax
jne 0x5045eb
mov eax, ecx
jmp 0x5046c9
mov ecx, dword [esp + 4]
mov edx, dword [ebp + 8]
mov edi, dword [esp + 8]
mov esi, dword [esp + 0xc]
jmp 0x50464c
test cl, 8
jne 0x5045f5
and ecx, 0xf
jmp 0x50464c
mov ebx, edx
mov edx, eax
mov eax, ecx
and eax, 0xfffffff8
and ecx, 7
nop word cs:[eax + eax]
movq xmm0, qword [esi + edx]
movq xmm1, qword [ebx + edx + 0x10]
movq xmm2, qword [ebx + edx + 0x40]
pxor xmm2, xmm0
movq qword [ebx + edx + 0x40], xmm2
pxor xmm1, xmm0
movq qword [edi + edx], xmm1
add edx, 8
cmp eax, edx
jne 0x504610
cmp dword [esp + 4], eax
mov edx, ebx
jne 0x50464c
mov eax, dword [esp + 4]
jmp 0x5046c9
mov ebx, edx
test cl, 1
jne 0x50469f
mov edx, ecx
cmp ecx, 1
je 0x5046c3
lea ecx, [esi + eax]
inc ecx
lea esi, [eax + ebx]
add esi, 0x41
add eax, edi
inc eax
xor edi, edi
nop dword [eax]
movzx ebx, byte [ecx + edi - 1]
xor byte [esi + edi - 1], bl
xor bl, byte [esi + edi - 0x31]
mov byte [eax + edi - 1], bl
movzx ebx, byte [ecx + edi]
xor byte [esi + edi], bl
xor bl, byte [esi + edi - 0x30]
mov byte [eax + edi], bl
add edi, 2
cmp edx, edi
jne 0x504670
mov eax, dword [esp + 4]
mov edx, dword [ebp + 8]
jmp 0x5046c9
movzx edx, byte [esi + eax]
mov dword [esp + 8], edi
mov edi, ebx
xor byte [ebx + eax + 0x40], dl
xor dl, byte [ebx + eax + 0x10]
mov edi, dword [esp + 8]
mov byte [edi + eax], dl
lea edx, [ecx - 1]
or eax, 1
cmp ecx, 1
jne 0x50465a
mov eax, dword [esp + 4]
mov edx, ebx
mov dword [edx + 0x170], eax
mov eax, 1
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret