Function at 0x51d660
Capabilities:
Encode data using xor

Disassembly:
mov eax, 0xd8
call fcn.00424b90
mov eax, dword [0x5fd098]
xor eax, esp
mov dword [esp + 0xd4], eax
mov eax, dword [esp + 0xdc]
push ebx
mov ebx, dword [esp + 0xf0]
push ebp
mov dword [esp + 0x4c], eax
xor ebp, ebp
mov eax, dword [esp + 0xfc]
push esi
mov esi, dword [esp + 0xf4]
mov dword [esp + 0x5c], eax
mov eax, dword [esp + 0x104]
push edi
mov edi, dword [esp + 0xf4]
mov dword [esp + 0x58], eax
mov eax, dword [esp + 0x10c]
shr edi, 3
mov dword [esp + 0x5c], eax
mov eax, dword [esp + 0x110]
mov dword [esp + 0x3c], esi
mov dword [esp + 0x30], ebx
mov dword [esp + 0x1c], eax
mov dword [esp + 0x48], 0
mov dword [esp + 0x2c], 0
mov dword [esp + 0x44], 2
cmp edi, 0x14
je 0x51d6fc
cmp edi, 0x1c
je 0x51d6fc
cmp edi, 0x20
jne 0x51d74d
test esi, esi
jne 0x51d70b
call fcn.004b8f00
mov esi, eax
mov dword [esp + 0x3c], eax
mov eax, 0x200
cmp dword [esp + 0xf0], eax
cmovae eax, dword [esp + 0xf0]
add eax, 0x3f
and eax, 0xffffffc0
mov dword [esp + 0x34], eax
test ebx, ebx
je 0x51d769
mov eax, dword [esp + 0x100]
cmp eax, edi
jae 0x51d754
push 0x4e
push 0x5d28c8
push 0x6e
push 0x7d
push 0xa
call fcn.004bf7e0
add esp, 0x14
xor eax, eax
jmp 0x51dd96
cmova eax, edi
push eax
lea eax, [esp + 0xa8]
push ebx
push eax
call fcn.0043bee0
add esp, 0xc
call fcn.004c9960
mov dword [esp + 0x28], eax
test eax, eax
je 0x51dd80
call fcn.004d5c00
mov ebp, eax
mov dword [esp + 0x18], ebp
test ebp, ebp
je 0x51dd80
push ebp
call fcn.004d5c70
push ebp
call fcn.004d5ba0
mov ebx, dword [esp + 0x20]
mov ebp, eax
push ebx
call fcn.004d5ba0
push ebx
mov dword [esp + 0x34], eax
call fcn.004d5ba0
push ebx
mov dword [esp + 0x4c], eax
call fcn.004d5ba0
push ebx
mov dword [esp + 0x38], eax
call fcn.004d5ba0
push ebx
mov dword [esp + 0x6c], eax
call fcn.004d5ba0
push ebx
mov dword [esp + 0x6c], eax
call fcn.004d5ba0
push ebx
mov dword [esp + 0x38], eax
call fcn.004d5ba0
mov ebx, eax
add esp, 0x24
mov dword [esp + 0x10], ebx
test ebx, ebx
je 0x51dd73
mov eax, dword [esp + 0x34]
dec eax
push eax
call fcn.004b5c00
push eax
push ebx
call fcn.004f49b0
add esp, 0xc
test eax, eax
je 0x51dd73
nop
push dword [esp + 0x2c]
xor ebx, ebx
cmp dword [esp + 0x34], ebx
push 0
push dword [esp + 0x24]
sete bl
call fcn.00528120
inc dword [esp + 0x38]
add esp, 0xc
test eax, eax
je 0x51dd73
cmp dword [esp + 0x30], 0
jne 0x51d859
lea eax, [esp + 0xa4]
push edi
push eax
call fcn.004bd7a0
add esp, 8
test eax, eax
jle 0x51dd73
jmp 0x51d861
mov dword [esp + 0x30], 0
push edi
lea eax, [esp + 0xa8]
push eax
lea eax, [esp + 0x8c]
push eax
call fcn.0043bee0
push edi
lea eax, [esp + 0xb4]
push eax
lea eax, [esp + 0xd8]
push eax
call fcn.0043bee0
lea eax, [edi - 1]
add esp, 0x18
test eax, eax
js 0x51d8af
nop word [eax + eax]
add byte [esp + eax + 0x84], 1
jne 0x51d8af
sub eax, 1
jns 0x51d8a0
push 0
push esi
push 0
lea eax, [esp + 0x70]
push eax
lea eax, [esp + 0xb4]
push edi
push eax
call fcn.004b86b0
add esp, 0x18
test eax, eax
je 0x51dd73
push 0
push esi
push 0
lea eax, [esp + 0xd0]
push eax
lea eax, [esp + 0x94]
push edi
push eax
call fcn.004b86b0
add esp, 0x18
test eax, eax
je 0x51dd73
xor ecx, ecx
test edi, edi
je 0x51d953
cmp edi, 0x20
jb 0x51d953
mov eax, edi
and eax, 0x8000001f
jns 0x51d911
dec eax
or eax, 0xffffffe0
inc eax
mov edx, edi
sub edx, eax
nop word [eax + eax]
movups xmm0, xmmword [esp + ecx + 0x64]
movups xmm1, xmmword [esp + ecx + 0xc4]
pxor xmm1, xmm0
movups xmmword [esp + ecx + 0x64], xmm1
movups xmm0, xmmword [esp + ecx + 0x74]
movups xmm1, xmmword [esp + ecx + 0xd4]
pxor xmm1, xmm0
movups xmmword [esp + ecx + 0x74], xmm1
add ecx, 0x20
cmp ecx, edx
jl 0x51d920
cmp ecx, edi
jge 0x51d970
nop word [eax + eax]
mov al, byte [esp + ecx + 0xc4]
xor byte [esp + ecx + 0x64], al
inc ecx
cmp ecx, edi
jl 0x51d960
push dword [esp + 0x20]
or byte [esp + 0x68], 0x80
lea eax, [esp + 0x68]
or byte [esp + edi + 0x67], 1
push edi
push eax
call fcn.004b5030
add esp, 0xc
test eax, eax
je 0x51dd73
push dword [esp + 0x1c]
push ebx
push dword [esp + 0x20]
push 0x32
push dword [esp + 0x30]
call fcn.00528420
add esp, 0x14
test eax, eax
jg 0x51d9ba
je 0x51d810
jmp 0x51dd73
mov ebx, dword [esp + 0x1c]
push 0
push 2
push ebx
call fcn.00528120
add esp, 0xc
test eax, eax
je 0x51dd73
push 0
push 3
push ebx
call fcn.00528120
add esp, 0xc
test eax, eax
je 0x51dd73
mov ecx, dword [esp + 0x34]
mov eax, 0xcccccccd
xor esi, esi
mov dword [esp + 0x40], esi
lea ecx, [ecx - 1]
mul ecx
mov ebx, edx
shr ebx, 7
test esi, esi
je 0x51da1c
push esi
push 0
push dword [esp + 0x24]
call fcn.00528120
add esp, 0xc
test eax, eax
je 0x51dd73
push 0
push dword [esp + 0x3c]
call fcn.004b5b50
add esp, 8
xor esi, esi
test ebx, ebx
js 0x51dac9
lea eax, [edi - 1]
test eax, eax
js 0x51da4f
nop dword [eax + eax]
add byte [esp + eax + 0x84], 1
jne 0x51da4f
sub eax, 1
jns 0x51da40
push 0
push dword [esp + 0x40]
lea eax, [esp + 0x6c]
push 0
push eax
lea eax, [esp + 0x94]
push edi
push eax
call fcn.004b86b0
add esp, 0x18
test eax, eax
je 0x51dd73
push ebp
lea eax, [esp + 0x68]
push edi
push eax
call fcn.004b5030
add esp, 0xc
test eax, eax
je 0x51dd73
lea eax, [edi*8]
imul eax, esi
push eax
push ebp
push ebp
call fcn.004f49b0
add esp, 0xc
test eax, eax
je 0x51dd73
mov eax, dword [esp + 0x38]
push ebp
push eax
push eax
call fcn.004d5ed0
add esp, 0xc
test eax, eax
je 0x51dd73
inc esi
cmp esi, ebx
jle 0x51da34
mov eax, dword [esp + 0x34]
mov esi, dword [esp + 0x38]
dec eax
push eax
push esi
call fcn.004b5870
add esp, 8
test eax, eax
je 0x51dd73
push esi
mov esi, dword [esp + 0x54]
push esi
call fcn.004b5590
add esp, 8
test eax, eax
je 0x51dd73
push dword [esp + 0x10]
push esi
push esi
call fcn.004d5ed0
add esp, 0xc
test eax, eax
je 0x51dd73
push dword [esp + 0x20]
push ebp
call fcn.004f4ae0
add esp, 8
test eax, eax
je 0x51dd73
push dword [esp + 0x18]
push ebp
push esi
push dword [esp + 0x58]
push 0
call fcn.004fb420
add esp, 0x14
test eax, eax
je 0x51dd73
call fcn.004b5c00
push eax
push dword [esp + 0x50]
push ebp
call fcn.004d5f60
add esp, 0xc
test eax, eax
je 0x51dd73
push ebp
push esi
mov esi, dword [esp + 0x1c]
push esi
call fcn.004d5f60
add esp, 0xc
test eax, eax
je 0x51dd73
push dword [esp + 0x10]
push esi
call fcn.004b5240
add esp, 8
test eax, eax
js 0x51dba7
mov esi, dword [esp + 0x1c]
push esi
push 1
push dword [esp + 0x20]
push 0x32
push dword [esp + 0x24]
call fcn.00528420
add esp, 0x14
test eax, eax
jg 0x51dbc5
jne 0x51dd73
mov esi, dword [esp + 0x40]
inc esi
mov dword [esp + 0x40], esi
cmp esi, 0x1000
jl 0x51da01
mov esi, dword [esp + 0x3c]
jmp 0x51d810
push 1
push 2
push esi
call fcn.00528120
add esp, 0xc
test eax, eax
je 0x51dd73
call fcn.004b5c00
push eax
push dword [esp + 0x18]
push dword [esp + 0x18]
call fcn.004d5f60
add esp, 0xc
test eax, eax
je 0x51dd73
mov ebx, dword [esp + 0x18]
push ebx
push dword [esp + 0x24]
push dword [esp + 0x18]
push 0
push ebp
call fcn.004fb420
add esp, 0x14
test eax, eax
je 0x51dd73
push 2
push dword [esp + 0x14]
call fcn.004b5b50
add esp, 8
test eax, eax
je 0x51dd73
push ebx
push dword [esp + 0x18]
push dword [esp + 0x30]
call fcn.004c99c0
add esp, 0xc
test eax, eax
je 0x51dd73
push dword [esp + 0x28]
push ebx
push dword [esp + 0x1c]
push ebp
push dword [esp + 0x20]
push dword [esp + 0x38]
call fcn.00508090
add esp, 0x18
test eax, eax
je 0x51dd73
nop dword [eax]
push dword [esp + 0x24]
call fcn.004b5810
add esp, 4
test eax, eax
je 0x51dcc3
call fcn.004b5c00
push eax
mov eax, dword [esp + 0x14]
push eax
push eax
call fcn.004d5ed0
add esp, 0xc
test eax, eax
je 0x51dd73
push dword [esp + 0x28]
inc dword [esp + 0x48]
push ebx
push dword [esp + 0x1c]
push ebp
push dword [esp + 0x20]
push dword [esp + 0x38]
call fcn.00508090
add esp, 0x18
test eax, eax
jne 0x51dc70
jmp 0x51dd73
push 1
push 3
push esi
call fcn.00528120
add esp, 0xc
test eax, eax
je 0x51dd73
mov dword [esp + 0x48], 1
mov ebx, dword [esp + 0x54]
push dword [ebx + 8]
call fcn.004b5700
push dword [ebx + 0xc]
call fcn.004b5700
push dword [ebx + 0x10]
call fcn.004b5700
push dword [esp + 0x20]
call fcn.004b5670
push dword [esp + 0x30]
mov dword [ebx + 8], eax
call fcn.004b5670
push dword [esp + 0x38]
mov dword [ebx + 0xc], eax
call fcn.004b5670
add esp, 0x18
mov dword [ebx + 0x10], eax
cmp dword [ebx + 8], 0
je 0x51dd6b
cmp dword [ebx + 0xc], 0
je 0x51dd6b
test eax, eax
je 0x51dd6b
mov ecx, dword [esp + 0x58]
test ecx, ecx
je 0x51dd41
mov eax, dword [esp + 0x40]
mov dword [ecx], eax
mov ecx, dword [esp + 0x5c]
test ecx, ecx
je 0x51dd4f
mov eax, dword [esp + 0x44]
mov dword [ecx], eax
mov eax, dword [esp + 0x60]
test eax, eax
je 0x51dd73
push edi
lea ecx, [esp + 0xa8]
push ecx
push eax
call fcn.0043bee0
add esp, 0xc
jmp 0x51dd73
mov dword [esp + 0x48], 0
mov ebp, dword [esp + 0x18]
push ebp
call fcn.004d5b20
add esp, 4
push ebp
call fcn.004d5b60
push dword [esp + 0x2c]
call fcn.004c9910
mov eax, dword [esp + 0x50]
add esp, 8
mov ecx, dword [esp + 0xe4]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00423fe9
add esp, 0xd8
ret