Function at 0x5aace0
Capabilities:
Encode data using xor
Hash data with crc32

Disassembly:
push ecx
mov eax, dword [0x9549ec]
mov ecx, dword [0x9549f0]
push ebx
mov ebx, dword [esp + 0x10]
push ebp
push esi
mov esi, dword [ecx + 0x30]
push edi
mov edi, dword [eax + 4]
mov eax, edi
mov dword [ebx], 5
lea ebp, [eax + 1]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x5aad05
sub eax, ebp
push 1
mov ecx, edi
call fcn.00582ed0
mov dword [ebx + 0xc], eax
mov eax, esi
add esp, 4
lea edi, [eax + 1]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x5aad24
sub eax, edi
push 1
mov ecx, esi
call fcn.00582ed0
mov edx, dword [0x9549dc]
mov ecx, dword [0x72598c]
mov dword [ebx + 8], eax
mov eax, dword [0x9549e4]
mov dword [ebx + 0x10], edx
mov edx, dword [esp + 0x1c]
mov dword [ebx + 0x14], eax
mov eax, dword [edx + 0x484]
mov dword [esp + 0x14], eax
shl eax, 4
or eax, 1
add esp, 4
mov dword [ebx + 0x60], ecx
mov dword [ebx + 0xe8], eax
xor edi, edi
mov dword [ebx + 0x18], 3
xor edx, edx
lea eax, [ebx + 0x20]
mov ecx, 0x9552e0
mov esi, dword [ecx]
mov dword [eax], esi
mov esi, dword [ecx + 4]
mov dword [eax + 4], esi
add edx, 1
add eax, 8
add ecx, 0x88
cmp edx, dword [ebx + 0x18]
jb 0x5aad85
cmp dword [ebx + 0x18], edi
mov dword [esp + 0x1c], edi
jbe 0x5aae02
mov ebp, 0x16b
mov edi, edi
xor eax, eax
cmp dword [ebx + 0x60], eax
jbe 0x5aadef
lea ecx, [ebx + edi*8 + 0x68]
jmp 0x5aadc0
cmp eax, 0x10
jb 0x5aadcb
xor edx, edx
xor esi, esi
jmp 0x5aaddc
lea esi, [eax + ebp]
mov edx, dword [esi*8 + 0x954708]
mov esi, dword [esi*8 + 0x95470c]
mov dword [ecx], edx
mov dword [ecx + 4], esi
add eax, 1
add edi, 1
add ecx, 8
cmp eax, dword [ebx + 0x60]
jb 0x5aadc0
mov eax, dword [esp + 0x1c]
add eax, 1
add ebp, 0x11
cmp eax, dword [ebx + 0x18]
mov dword [esp + 0x1c], eax
jb 0x5aadb0
mov eax, dword [ebx + 0x60]
imul eax, dword [ebx + 0x18]
mov edx, dword [0x9554b0]
mov dword [ebx + 0x60], eax
mov eax, edx
xor esi, esi
and eax, 0xf
jbe 0x5aae2f
mov ecx, 0x955454
movzx edi, word [ecx]
add ecx, 0xc
sub eax, 1
lea esi, [esi + edi*2 + 8]
jne 0x5aae20
shr edx, 4
and edx, 0xf
mov ecx, edx
jbe 0x5aae4f
mov eax, 0x955484
mov edi, edi
movzx edx, word [eax]
add eax, 0xc
sub ecx, 1
lea esi, [esi + edx + 8]
jne 0x5aae40
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x18]
mov edx, dword [ecx + 0x480]
push eax
push edx
push str.Save_Ghost_Length___d_Record_Length___d_n
mov dword [ebx + 0xec], esi
call fcn.00408d10
mov eax, dword [esp + 0x30]
add esi, 0xbf40
push esi
push str.Ghost_Size_Before_Saving___d_n
mov dword [eax], esi
call fcn.00408d10
add esp, 0x14
cmp dword [0x9d3e94], 0
jne 0x5aae96
xor ebp, ebp
jmp 0x5aaeb4
push 0x14a
push 0x6e9a20
mov edi, esi
mov esi, dword [0x9cdc68]
push 0x1000
call fcn.00589980
mov ebp, eax
mov ecx, 0x3c
mov esi, ebx
mov edi, ebp
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [esp + 0x20]
push 0
lea eax, [ebp + 0xf0]
push 0x955450
mov dword [ecx], eax
call fcn.005a9870
mov edx, dword [esp + 0x18]
mov eax, dword [ebx + 0xec]
push 0xbe50
add edx, 0x490
push edx
lea ecx, [eax + ebp + 0xf0]
push ecx
call fcn.004ad5c0
lea ecx, [ebp + 8]
add esp, 0xc
or eax, 0xffffffff
test ecx, ecx
je 0x5aaf33
mov edx, dword [esp + 0x24]
mov edx, dword [edx]
sub edx, 8
je 0x5aaf31
movzx edi, byte [ecx]
mov esi, eax
and esi, 0xff
xor esi, edi
shr eax, 8
xor eax, dword [esi*4 + 0x710748]
add ecx, 1
sub edx, 1
jne 0x5aaf12
not eax
pop edi
mov dword [ebx + 4], eax
mov dword [ebp + 4], eax
pop esi
mov eax, ebp
pop ebp
pop ebx
pop ecx
ret 0x10