Function at 0x4af050
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
mov eax, dword [ebp + 0xc]
push edi
mov edi, ecx
mov dword [ebp - 0x1c], edi
test eax, eax
je 0x4af2a9
mov edx, dword [ebp + 8]
push ebx
push esi
lea esp, [esp]
mov ecx, dword [edi + 0x168]
dec eax
mov dword [ebp + 0xc], eax
mov al, byte [edx]
inc edx
mov dword [ebp + 8], edx
mov byte [edi + ecx + 0x28], al
inc dword [edi + 0x168]
cmp dword [edi + 0x168], 0x40
jb 0x4af28e
lea esi, [edi + 0x28]
mov edi, 4
mov ebx, esi
mov ecx, dword [ebx]
lea ebx, [ebx + 0x10]
mov edx, ecx
mov eax, ecx
shr eax, 0x10
and edx, 0xff0000
or edx, eax
mov eax, ecx
shl eax, 0x10
and ecx, 0xff00
or eax, ecx
shr edx, 8
shl eax, 8
or edx, eax
mov dword [ebx - 0x10], edx
mov ecx, dword [ebx - 0xc]
mov edx, ecx
and edx, 0xff0000
mov eax, ecx
shr eax, 0x10
or edx, eax
mov eax, ecx
shl eax, 0x10
and ecx, 0xff00
or eax, ecx
shr edx, 8
shl eax, 8
or edx, eax
mov dword [ebx - 0xc], edx
mov ecx, dword [ebx - 8]
mov edx, ecx
and edx, 0xff0000
mov eax, ecx
shr eax, 0x10
or edx, eax
mov eax, ecx
shl eax, 0x10
and ecx, 0xff00
or eax, ecx
shr edx, 8
shl eax, 8
or edx, eax
mov dword [ebx - 8], edx
mov ecx, dword [ebx - 4]
mov edx, ecx
and edx, 0xff0000
mov eax, ecx
shr eax, 0x10
or edx, eax
mov eax, ecx
shl eax, 0x10
and ecx, 0xff00
or eax, ecx
shr edx, 8
shl eax, 8
or edx, eax
mov dword [ebx - 4], edx
dec edi
jne 0x4af0a1
lea ecx, [edi + 0x40]
mov edi, dword [ebp - 0x1c]
jmp 0x4af160
mov eax, dword [esi + 0x34]
lea esi, [esi + 4]
xor eax, dword [esi + 0x1c]
xor eax, dword [esi + 4]
xor eax, dword [esi - 4]
rol eax, 1
mov dword [esi + 0x3c], eax
dec ecx
jne 0x4af160
mov eax, dword [edi + 0x14]
xor edx, edx
mov dword [edi], eax
mov eax, dword [edi + 0x18]
mov dword [edi + 4], eax
mov eax, dword [edi + 0x1c]
mov ebx, dword [edi + 4]
mov dword [edi + 8], eax
mov eax, dword [edi + 0x20]
mov esi, dword [edi + 8]
mov dword [edi + 0xc], eax
mov eax, dword [edi + 0x24]
mov ecx, dword [edi + 0xc]
mov dword [ebp - 0x10], eax
mov dword [edi + 0x10], eax
mov dword [ebp - 0x18], edx
mov dword [ebp - 0x14], ebx
mov dword [ebp - 0xc], ecx
mov dword [ebp - 8], 0x28
mov eax, dword [edi]
mov dword [ebp - 4], eax
cmp edx, 0x14
jae 0x4af1ca
mov eax, ebx
not eax
and eax, ecx
mov ecx, ebx
and ecx, esi
or eax, ecx
jmp 0x4af1e9
cmp edx, 0x28
jb 0x4af1e3
cmp edx, 0x3c
jae 0x4af1e3
mov eax, esi
or eax, ecx
mov ecx, esi
and ecx, dword [ebp - 0xc]
and eax, ebx
or eax, ecx
jmp 0x4af1e9
mov eax, ebx
xor eax, esi
xor eax, ecx
cmp edx, 0x14
jae 0x4af1f5
mov ecx, 0x5a827999
jmp 0x4af212
cmp edx, 0x28
jae 0x4af201
mov ecx, 0x6ed9eba1
jmp 0x4af212
cmp edx, 0x3c
sbb ecx, ecx
and ecx, 0xc4b8fb06
add ecx, 0xca62c1d6
mov edx, dword [ebp - 8]
mov ebx, dword [ebp - 4]
add dword [ebp - 8], 4
rol ebx, 5
add ebx, dword [edx + edi]
add ebx, dword [ebp - 0x10]
mov edx, dword [ebp - 0x18]
add ebx, ecx
mov dword [ebp - 4], ebx
mov ecx, esi
add dword [ebp - 4], eax
inc edx
mov eax, dword [ebp - 0xc]
mov ebx, dword [edi]
mov dword [ebp - 0xc], esi
mov dword [edi + 0xc], esi
mov esi, dword [ebp - 0x14]
ror esi, 2
cmp dword [ebp - 8], 0x168
mov dword [ebp - 0x10], eax
mov dword [edi + 0x10], eax
mov eax, dword [ebp - 4]
mov dword [edi + 8], esi
mov dword [ebp - 0x14], ebx
mov dword [edi + 4], ebx
mov dword [edi], eax
mov dword [ebp - 0x18], edx
jb 0x4af1b2
add dword [edi + 0x14], eax
mov eax, ebx
add dword [edi + 0x18], eax
mov eax, esi
add dword [edi + 0x1c], eax
mov eax, dword [edi + 0xc]
add dword [edi + 0x20], eax
mov eax, dword [edi + 0x10]
add dword [edi + 0x24], eax
mov edx, dword [ebp + 8]
mov dword [edi + 0x168], 0
add dword [edi + 0x170], 8
mov eax, dword [ebp + 0xc]
adc dword [edi + 0x174], 0
test eax, eax
jne 0x4af070
pop esi
pop ebx
pop edi
mov esp, ebp
pop ebp
ret 8