Function at 0x4afdd0
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff0
sub esp, 0x1d0
mov edi, dword [ebp + 0xc]
mov eax, dword [0x540010]
xor eax, ebp
mov dword [esp + 0x1c8], eax
test edi, edi
je 0x4aff7f
mov esi, dword [ebp + 0x10]
mov ebx, dword [ebp + 8]
call fcn.004114c0
mov dword [esp + 0xc], eax
pxor xmm0, xmm0
movdqa xmmword [esp + 0x180], xmm0
movdqa xmmword [esp + 0x170], xmm0
xor eax, eax
mov cl, byte [esi + eax]
xor byte [esp + eax + 0x170], cl
inc eax
cmp eax, 0x20
jne 0x4afe1f
lea eax, [esp + 0x40]
push 0x130
push 0xff
push eax
call fcn.004e3a90
add esp, 0xc
push 1
call fcn.004df9d0
add esp, 4
test eax, eax
je 0x4aff95
mov ecx, eax
add ecx, 0x120
mov dword [esp + 8], ecx
cmp dword [eax + 0x120], 0xfff
jbe 0x4b00bc
pcmpeqd xmm0, xmm0
lea ecx, [esp + 0x190]
movdqa xmmword [ecx + 0x20], xmm0
movdqa xmmword [ecx + 0x10], xmm0
movdqa xmmword [ecx], xmm0
mov edx, 0x30
push edx
push ecx
mov esi, eax
call fcn.004d08a0
add esp, 8
mov ecx, esi
lea edx, [esp + 0x190]
mov eax, 0x30
push eax
call fcn.004b0150
add esp, 4
test eax, eax
je 0x4b00e8
xor eax, eax
mov dword [esi + 0x114], eax
mov dword [esi + 0x110], 1
mov ecx, dword [esp + 8]
mov dword [ecx], eax
mov dword [esi + 0x11c], eax
mov dword [esi + 0x118], 0xc0ffee
mov eax, dword [esp + 0xc]
mov dword [esi + 0x128], eax
mov eax, esi
mov esi, 0x10000
cmp edi, 0x10000
cmovb esi, edi
lea ecx, [esp + 0x170]
push 0x20
push ecx
push esi
push ebx
mov dword [esp + 0x14], eax
push eax
call fcn.004b02c0
add esp, 0x14
test eax, eax
je 0x4b00e8
mov eax, dword [esp + 8]
inc dword [eax]
sub edi, esi
je 0x4aff67
add ebx, esi
mov eax, 0x10000
cmp edi, eax
mov esi, 0x10000
cmovb esi, edi
push 0
lea eax, [esp + 0x174]
push eax
push esi
push ebx
push dword [esp + 0x14]
call fcn.004b02c0
add esp, 0x14
test eax, eax
je 0x4b00e8
add ebx, esi
mov eax, dword [esp + 8]
inc dword [eax]
sub edi, esi
jne 0x4aff2c
lea eax, [esp + 0x40]
cmp dword [esp + 4], eax
jne 0x4aff7f
push 0x118
push eax
call fcn.004cc7a0
add esp, 8
mov ecx, dword [esp + 0x1c8]
xor ecx, ebp
call fcn.004e0685
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret
push 0x130
call fcn.004def80
add esp, 4
test eax, eax
je 0x4affbe
push 0x4b04f0
push eax
push 1
mov esi, eax
call fcn.004d0780
mov ecx, esi
add esp, 0xc
test eax, eax
jne 0x4affc2
lea ecx, [esp + 0x40]
mov dword [esp + 4], ecx
mov dword [ecx + 0x124], 0
pcmpeqd xmm0, xmm0
lea esi, [esp + 0x10]
movdqa xmmword [esi + 0x20], xmm0
movdqa xmmword [esi + 0x10], xmm0
movdqa xmmword [esi], xmm0
push 0x30
push esi
call fcn.004d08a0
add esp, 8
movaps xmm0, xmmword [esi + 0x20]
movaps xmmword [esp + 0x1b0], xmm0
movaps xmm0, xmmword [esi]
movaps xmm1, xmmword [esi + 0x10]
movaps xmmword [esp + 0x1a0], xmm1
movaps xmmword [esp + 0x190], xmm0
xor eax, eax
mov cl, byte [eax + 0x5337f0]
xor byte [esp + eax + 0x190], cl
inc eax
cmp eax, 0x30
jne 0x4b0016
push 1
call fcn.004df940
add esp, 4
bt eax, 0x19
jae 0x4b00ed
lea eax, [esp + 0x190]
mov esi, dword [esp + 4]
push esi
push 0x100
push eax
call fcn.00403380
add esp, 0xc
mov eax, 0x401b90
mov ecx, section..text
mov dword [esi + 0xf4], ecx
mov dword [esi + 0xf8], eax
movdqa xmm0, xmmword [esp + 0x1b0]
movdqu xmmword [esi + 0xfc], xmm0
xor eax, eax
mov dword [esi + 0x114], eax
mov dword [esi + 0x110], 1
lea ecx, [esi + 0x120]
mov dword [esp + 8], ecx
mov dword [esi + 0x120], eax
mov dword [esi + 0x11c], eax
mov dword [esi + 0x118], 0xc0ffee
mov eax, dword [esp + 0xc]
mov dword [esi + 0x128], eax
mov eax, esi
mov ecx, 0xc0ffee
xor ecx, dword [eax + 0x118]
or ecx, dword [eax + 0x11c]
jne 0x4afe74
mov ecx, dword [esp + 0xc]
cmp dword [eax + 0x128], ecx
je 0x4afef1
jmp 0x4afe74
call fcn.004f4b6e
bt eax, 9
jae 0x4b0119
lea eax, [esp + 0x190]
mov esi, dword [esp + 4]
push esi
push 0x100
push eax
call fcn.00403ea0
add esp, 0xc
xor eax, eax
mov ecx, 0x403f50
jmp 0x4b0061
lea eax, [esp + 0x190]
mov esi, dword [esp + 4]
push esi
push 0x100
push eax
call fcn.00510a00
add esp, 0xc
mov eax, 0x510f30
mov ecx, 0x510910
jmp 0x4b0061