Function at 0x470750
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x148
push ebx
push ebp
push esi
push edi
call fcn.0046f210
mov esi, eax
cmp esi, 0xffffffff
mov dword [esp + 0x24], esi
je 0x470baf
mov ecx, dword [0x4a6a68]
lea eax, [esi*8]
sub eax, esi
xor edi, edi
mov dword [esp + 0x1c], edi
lea ebp, [ecx + eax*8]
mov ecx, dword [esp + 0x160]
mov eax, ecx
and eax, 0x80000000
mov dword [esp + 0x20], eax
jne 0x470809
or ebx, 0xffffffff
test ecx, 0x20000000
je 0x4707aa
mov ebx, 9
push 0x38
call fcn.004629a0
add esp, 4
cmp eax, edi
mov dword [esp + 0x1c], eax
je 0x470baf
push 0x38
push 0x49de6c
push edi
push 8
push 0xfffffffffffffff1
mov dword [eax + 4], edi
mov dword [eax + 0x10], 0x8000
mov edx, dword [0x4a5064]
push 8
push ebx
push eax
mov dword [eax + 0xc], edx
mov dword [eax + 8], edi
mov dword [eax + 0x14], edi
mov dword [eax + 0x20], edi
mov dword [eax + 0x24], edi
mov dword [eax + 0x28], edi
call fcn.00472f00
add esp, 0x20
test eax, eax
jne 0x470baf
mov ecx, dword [esp + 0x160]
test ecx, 0x10000000
jne 0x47086a
mov eax, dword [esp + 0x15c]
push eax
push esi
call fcn.0046f720
add esp, 8
cmp eax, 0xffffffff
je 0x47086a
mov esi, dword [ebp + 0x18]
mov eax, dword [0x4a691c]
lea ebx, [esi*8]
sub ebx, esi
shl ebx, 3
cmp dword [ebx + eax + 0x14], edi
je 0x470b9e
mov edi, dword [ebx + eax + 0x18]
mov ecx, dword [ebx + eax + 4]
push 0
push edi
push ecx
mov dword [esp + 0x24], ecx
call fcn.00462970
add esp, 0xc
cmp eax, edi
jne 0x470b9c
jmp 0x470912
mov eax, dword [esp + 0x168]
cmp eax, edi
je 0x470934
push eax
call fcn.0046f800
add esp, 4
cmp eax, edi
je 0x470b9e
mov ecx, dword [0x4a691c]
lea edx, [eax*8]
sub edx, eax
mov esi, eax
cmp dword [ecx + edx*8 + 0x14], edi
je 0x470b9e
lea ebx, [esi*8]
push 0
sub ebx, esi
shl ebx, 3
mov edi, dword [ebx + ecx + 0x18]
mov eax, dword [ebx + ecx + 4]
push edi
push eax
mov dword [esp + 0x24], eax
call fcn.00462970
add esp, 0xc
cmp eax, edi
jne 0x470b9c
mov ecx, dword [0x4a691c]
mov eax, dword [esp + 0x15c]
push 0
push 0
mov edx, dword [ebx + ecx]
push 0
push 0
push 0
push 0
push eax
push edx
call fcn.00472440
add esp, 0x20
mov dword [esp + 0x14], eax
test eax, eax
je 0x470b9c
call fcn.00472080
mov dword [ebp + 0x24], eax
mov eax, dword [esp + 0x14]
mov dword [ebp + 0x34], eax
mov eax, dword [0x4a691c]
mov ecx, dword [esp + 0x20]
mov edx, dword [ebx + eax + 8]
or edx, 0x80000000
mov dword [ebx + eax + 8], edx
xor eax, eax
cmp ecx, eax
je 0x47095f
mov dword [ebp + 0xc], eax
jmp 0x470966
mov ecx, dword [0x4a691c]
mov esi, 0xf
lea eax, [ecx + 0x348]
cmp dword [eax], edi
je 0x470952
cmp dword [eax + 0x14], edi
jne 0x4708a5
dec esi
sub eax, 0x38
cmp esi, edi
jg 0x470945
jmp 0x470b9e
mov dword [ebp + 0xc], 8
mov dword [ebp + 0x18], esi
mov esi, 0x40000000
mov dword [ebp + 8], edi
mov dword [ebp + 0x10], eax
mov dword [ebp], eax
mov dword [ebp + 4], eax
mov dword [ebp + 0x14], eax
mov dword [ebp + 0x30], eax
mov dword [ebp + 0x20], esi
call fcn.00470700
mov edx, dword [ebp + 0x20]
mov ecx, dword [esp + 0x160]
or edx, 0x80000000
mov dword [ebp + 0x1c], eax
test esi, ecx
mov dword [ebp + 0x20], edx
mov eax, edx
je 0x4709ac
or eax, 0x20000000
mov dword [ebp + 0x20], eax
mov ecx, dword [esp + 0x1c]
mov dword [ebp + 0x2c], 0
mov dword [ebp + 0x28], ecx
mov edx, dword [0x4a691c]
test byte [ebx + edx + 8], 1
jne 0x470a52
mov ecx, dword [esp + 0x18]
lea eax, [esp + 0x34]
push 0x1e
push eax
push ecx
call fcn.004628c0
add esp, 0xc
cmp eax, 0x1e
jne 0x470b9c
mov edi, dword [esp + 0x15c]
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x54]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
mov edx, dword [esp + 0x18]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [esp + 0x54]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov esi, ecx
lea ecx, [esp + 0x54]
push esi
push ecx
push edx
call fcn.004628c0
add esp, 0xc
cmp eax, esi
jne 0x470b9c
mov edx, dword [ebp + 8]
lea eax, [esi + 0x1e]
add edx, eax
add esi, 0x1e
mov dword [ebp + 8], edx
mov eax, dword [0x4a691c]
add dword [ebx + eax + 0x18], esi
mov ecx, dword [0x4a691c]
mov al, byte [ebx + ecx + 0x20]
test al, al
je 0x470bc6
mov eax, dword [0x4a5068]
test eax, eax
jne 0x470a87
push 0
mov dword [0x4a5068], 1
call fcn.00479393
push eax
call fcn.00478c47
add esp, 8
mov edx, dword [ebp + 4]
mov edi, 0xc
add edx, edi
mov dword [ebp + 4], edx
mov edx, dword [0x4a691c]
lea eax, [ebx + edx + 0x20]
push eax
call fcn.00470670
add esp, 4
xor esi, esi
call fcn.00478c54
sar eax, 7
mov byte [esp + 0x14], al
call fcn.00470650
mov ecx, dword [esp + 0x14]
mov byte [esp + 0x13], al
push ecx
call fcn.004705e0
mov al, byte [esp + 0x17]
mov dl, byte [esp + 0x18]
xor al, dl
add esp, 4
mov byte [esi + 0x4a6a50], al
inc esi
cmp esi, 0xa
jl 0x470aa9
mov edx, dword [0x4a691c]
lea eax, [ebx + edx + 0x20]
push eax
call fcn.00470670
add esp, 4
xor esi, esi
mov cl, byte [esi + 0x4a6a50]
mov byte [esp + 0x14], cl
call fcn.00470650
mov edx, dword [esp + 0x14]
mov byte [esp + 0x13], al
push edx
call fcn.004705e0
mov al, byte [esp + 0x17]
mov dl, byte [esp + 0x18]
xor al, dl
add esp, 4
mov byte [esp + esi + 0x28], al
inc esi
cmp esi, 0xa
jl 0x470af6
mov esi, dword [esp + 0x164]
mov eax, esi
sar eax, 0x10
mov byte [esp + 0x14], al
call fcn.00470650
mov byte [esp + 0x13], al
mov eax, dword [esp + 0x14]
push eax
call fcn.004705e0
mov al, byte [esp + 0x17]
mov cl, byte [esp + 0x18]
xor al, cl
mov byte [esp + 0x36], al
mov eax, esi
sar eax, 0x18
mov byte [esp + 0x18], al
call fcn.00470650
mov ecx, dword [esp + 0x18]
mov byte [esp + 0x17], al
push ecx
call fcn.004705e0
mov al, byte [esp + 0x1b]
mov cl, byte [esp + 0x1c]
xor al, cl
lea edx, [esp + 0x30]
mov byte [esp + 0x3b], al
mov eax, dword [esp + 0x20]
push edi
push edx
push eax
call fcn.004628c0
add esp, 0x14
cmp eax, edi
je 0x470bbd
xor edi, edi
mov eax, dword [esp + 0x1c]
cmp eax, edi
je 0x470baf
push eax
call fcn.004734e0
add esp, 4
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x148
ret
mov eax, dword [0x4a691c]
add dword [ebx + eax + 0x18], edi
mov ecx, dword [esp + 0x24]
mov edx, dword [0x4a5058]
pop edi
inc edx
lea eax, [ecx + 0x7530]
pop esi
pop ebp
mov dword [0x4a5058], edx
or ah, 0x80
pop ebx
add esp, 0x148
ret