Function at 0x4af170
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x3c
mov eax, dword [0x592830]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
mov esi, ecx
mov dword [ebp - 0x24], eax
mov bl, byte [esi]
mov ecx, dword [esi + 0x28]
mov eax, dword [esi + 0x2c]
push edi
mov edi, edx
mov dword [ebp - 0x1c], edx
mov dword [ebp - 0x38], esi
mov byte [ebp - 0x1d], bl
mov dword [ebp - 0x2c], ecx
mov dword [ebp - 0x28], eax
test bl, 0x40
jne 0x4af1b4
push eax
lea eax, [esi + 0x10]
push eax
push esi
call ecx
add esp, 0xc
movzx eax, bl
and eax, 7
mov edx, 0xf
sub edx, eax
xor ecx, ecx
mov byte [esi], al
mov dword [ebp - 0x34], edx
cmp edx, 0xf
jae 0x4af1e3
lea ecx, [ecx]
movzx eax, byte [esi + edx]
or ecx, eax
mov byte [esi + edx], 0
inc edx
shl ecx, 8
cmp edx, 0xf
jb 0x4af1d0
movzx eax, byte [esi + 0xf]
mov ebx, dword [ebp + 0xc]
or ecx, eax
mov byte [esi + 0xf], 1
cmp ecx, ebx
je 0x4af208
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004ebb9e
mov esp, ebp
pop ebp
ret
cmp ebx, 0x10
jb 0x4af284
mov eax, ebx
shr eax, 4
mov dword [ebp - 0x1c], eax
push dword [ebp - 0x28]
lea eax, [ebp - 0x18]
push eax
push esi
call dword [ebp - 0x2c]
add esp, 0xc
mov eax, 8
dec eax
inc byte [esi + eax + 8]
jne 0x4af233
test eax, eax
jne 0x4af228
mov ecx, dword [edi]
mov eax, dword [edi + 4]
xor eax, dword [ebp - 0x14]
xor ecx, dword [ebp - 0x18]
mov edx, dword [ebp - 0x24]
push dword [ebp - 0x28]
mov dword [edx + 4], eax
mov dword [edx], ecx
xor dword [esi + 0x14], eax
xor dword [esi + 0x10], ecx
mov ecx, dword [edi + 8]
mov eax, dword [edi + 0xc]
xor eax, dword [ebp - 0xc]
xor ecx, dword [ebp - 0x10]
mov dword [edx + 0xc], eax
mov dword [edx + 8], ecx
xor dword [esi + 0x1c], eax
xor dword [esi + 0x18], ecx
lea eax, [esi + 0x10]
push eax
push eax
call dword [ebp - 0x2c]
add dword [ebp - 0x24], 0x10
add esp, 0xc
add edi, 0x10
sub ebx, 0x10
dec dword [ebp - 0x1c]
jne 0x4af215
mov dword [ebp - 0x1c], edi
test ebx, ebx
je 0x4af2e5
push dword [ebp - 0x28]
lea eax, [ebp - 0x18]
push eax
push esi
call dword [ebp - 0x2c]
add esp, 0xc
xor edi, edi
test ebx, ebx
je 0x4af2d3
lea eax, [ebp - 0x18]
sub dword [ebp - 0x1c], eax
sub dword [ebp - 0x24], eax
lea eax, [esi + 0x10]
mov esi, dword [ebp - 0x1c]
mov dword [ebp - 0x30], eax
mov edi, edi
lea ecx, [ebp - 0x18]
add ecx, edi
inc edi
movzx edx, byte [esi + ecx]
movzx eax, byte [ecx]
xor edx, eax
mov eax, dword [ebp - 0x24]
mov byte [eax + ecx], dl
mov eax, dword [ebp - 0x30]
xor byte [eax + edi - 1], dl
cmp edi, ebx
jb 0x4af2b0
mov esi, dword [ebp - 0x38]
push dword [ebp - 0x28]
mov ebx, dword [ebp - 0x2c]
lea eax, [esi + 0x10]
push eax
push eax
call ebx
add esp, 0xc
jmp 0x4af2e8
mov ebx, dword [ebp - 0x2c]
mov eax, dword [ebp - 0x34]
cmp eax, 0x10
jae 0x4af30a
mov ecx, 0x10
sub ecx, eax
mov edx, ecx
shr ecx, 2
lea edi, [esi + eax]
xor eax, eax
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
push dword [ebp - 0x28]
lea eax, [ebp - 0x18]
push eax
push esi
call ebx
mov eax, dword [ebp - 0x18]
xor dword [esi + 0x10], eax
mov eax, dword [ebp - 0x14]
xor dword [esi + 0x14], eax
mov eax, dword [ebp - 0x10]
xor dword [esi + 0x18], eax
mov eax, dword [ebp - 0xc]
xor dword [esi + 0x1c], eax
mov al, byte [ebp - 0x1d]
mov ecx, dword [ebp - 4]
add esp, 0xc
mov byte [esi], al
pop edi
pop esi
xor ecx, ebp
xor eax, eax
pop ebx
call fcn.004ebb9e
mov esp, ebp
pop ebp
ret