Function at 0x477a90
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x27c
mov eax, dword [0x572844]
xor eax, esp
mov dword [esp + 0x278], eax
mov eax, dword [esp + 0x288]
mov edx, ecx
mov ecx, dword [esp + 0x284]
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x28c]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x290]
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x298]
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x294]
mov dword [esp + 8], edx
mov dword [esp], ecx
push ebp
mov ebp, dword [esp + 0x2a0]
cmp eax, 0x18
ja 0x477d64
push ebx
push esi
push edi
xor edi, edi
lea ebx, [edx + 0x4b4]
jmp 0x477b10
cmp dword [ebx + 0x134], eax
lea esi, [ebx + 0x102]
jne 0x477b97
push ecx
mov ecx, ebx
call fcn.004ad330
test al, al
je 0x477b8c
mov ecx, dword [esp + 0x14]
mov edx, 0xc
mov eax, dword [esi]
cmp eax, dword [ecx]
jne 0x477b8c
add esi, 4
add ecx, 4
sub edx, 4
jae 0x477b33
push 0
push 0
push 0x20
lea eax, [esp + 0x54]
mov ecx, 8
lea esi, [ebx + 0x112]
lea edi, [esp + 0x54]
rep movsd dword es:[edi], dword [esi]
push eax
call fcn.004ad680
lea esi, [ebx + 0x138]
mov ecx, 8
lea edi, [esp + 0x28]
rep movsd dword es:[edi], dword [esi]
lea esi, [ebx + 0x158]
mov ecx, 8
lea edi, [esp + 0x68]
rep movsd dword es:[edi], dword [esi]
jmp 0x477cb6
mov ecx, dword [esp + 0x10]
mov eax, dword [esp + 0x2a4]
inc edi
add ebx, 0x178
cmp edi, 4
jb 0x477b10
push 0x200
lea eax, [esp + 0x8c]
push eax
push dword [esp + 0x24]
call fcn.004b40a0
lea edx, [esp + 0x88]
lea ecx, [edx + 1]
mov al, byte [edx]
inc edx
test al, al
jne 0x477bc7
mov edi, dword [esp + 0x2a4]
sub edx, ecx
mov ebx, dword [esp + 0x14]
mov ecx, edi
mov eax, 1
shl eax, cl
push eax
lea eax, [esp + 0x2c]
push eax
lea eax, [esp + 0x70]
push eax
lea eax, [esp + 0x54]
push eax
push 0x10
push ebx
push edx
lea eax, [esp + 0xa4]
push eax
call fcn.004781f0
push 0x200
lea eax, [esp + 0x8c]
push eax
call fcn.004ad810
mov esi, dword [esp + 0x18]
push 0
push 1
push 0x20
mov ecx, dword [esi + 0xa94]
lea edx, [esi + 0x4b4]
mov eax, ecx
and eax, 3
imul eax, eax, 0x178
add edx, eax
lea eax, [ecx + 1]
mov dword [esi + 0xa94], eax
mov ecx, 0x40
mov esi, dword [esp + 0x1c]
mov dword [edx + 0x134], edi
mov edi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, 8
movsw word es:[edi], word [esi]
mov eax, dword [ebx]
lea esi, [esp + 0x54]
mov dword [edx + 0x102], eax
mov eax, dword [ebx + 4]
mov dword [edx + 0x106], eax
mov eax, dword [ebx + 8]
mov dword [edx + 0x10a], eax
mov eax, dword [ebx + 0xc]
mov dword [edx + 0x10e], eax
lea eax, [edx + 0x112]
mov edi, eax
rep movsd dword es:[edi], dword [esi]
lea edi, [edx + 0x138]
mov ecx, 8
lea esi, [esp + 0x34]
rep movsd dword es:[edi], dword [esi]
lea edi, [edx + 0x158]
mov ecx, 8
lea esi, [esp + 0x74]
rep movsd dword es:[edi], dword [esi]
push eax
call fcn.004ad680
mov eax, dword [esp + 0x20]
test eax, eax
je 0x477ccb
mov ecx, 8
lea esi, [esp + 0x68]
mov edi, eax
rep movsd dword es:[edi], dword [esi]
test ebp, ebp
je 0x477d2c
xor eax, eax
mov esi, 1
mov dword [ebp], eax
xor edi, edi
mov dword [ebp + 4], eax
lea edx, [eax + 3]
mov al, byte [esp + esi + 0x27]
mov ecx, edi
and ecx, 7
add edi, 4
xor byte [ecx + ebp], al
mov ecx, esi
mov al, byte [esp + esi + 0x28]
and ecx, 7
add esi, 4
xor byte [ecx + ebp], al
lea ecx, [edx - 1]
mov al, byte [esp + edx + 0x27]
and ecx, 7
xor byte [ecx + ebp], al
mov ecx, edx
mov al, byte [esp + edx + 0x28]
and ecx, 7
add edx, 4
xor byte [ecx + ebp], al
cmp esi, 0x21
jb 0x477ce1
push 0x20
lea eax, [esp + 0x2c]
push eax
call fcn.004ad810
mov eax, dword [esp + 0x24]
pop edi
pop esi
pop ebx
test eax, eax
je 0x477d58
mov ecx, dword [esp + 0xc]
push eax
push 0x100
lea eax, [esp + 0x44]
add ecx, 0xa9c
push eax
push dword [esp + 0x290]
call fcn.004aa000
push 0x20
lea eax, [esp + 0x40]
push eax
call fcn.004ad810
mov ecx, dword [esp + 0x27c]
pop ebp
xor ecx, esp
call fcn.0051dca8
add esp, 0x27c
ret 0x20