Function at 0x4af390
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x40
mov eax, dword [0x592830]
xor eax, ebp
mov dword [ebp - 8], eax
mov eax, dword [ebp + 8]
push ebx
push esi
mov esi, ecx
mov dword [ebp - 0x24], eax
mov eax, dword [ebp + 0x10]
mov bl, byte [esi]
mov ecx, dword [esi + 0x28]
mov dword [ebp - 0x3c], eax
mov eax, dword [esi + 0x2c]
push edi
mov dword [ebp - 0x28], edx
mov dword [ebp - 0x38], esi
mov byte [ebp - 0x1d], bl
mov dword [ebp - 0x30], ecx
mov dword [ebp - 0x2c], eax
test bl, 0x40
jne 0x4af3e0
push eax
lea eax, [esi + 0x10]
push eax
push esi
call ecx
add esp, 0xc
add dword [esi + 0x20], 1
adc dword [esi + 0x24], 0
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 0x4af413
lea esp, [esp]
movzx eax, byte [esi + edx]
or ecx, eax
mov byte [esi + edx], 0
inc edx
shl ecx, 8
cmp edx, 0xf
jb 0x4af400
movzx eax, byte [esi + 0xf]
mov edi, dword [ebp + 0xc]
or ecx, eax
mov byte [esi + 0xf], 1
cmp ecx, edi
je 0x4af438
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.004ebb9e
mov esp, ebp
pop ebp
ret
lea eax, [edi + 0xf]
or eax, 8
shr eax, 3
add dword [esi + 0x20], eax
adc dword [esi + 0x24], 0
cmp dword [esi + 0x24], 0x20000000
jb 0x4af46f
ja 0x4af459
cmp dword [esi + 0x20], 0
jbe 0x4af46f
mov eax, 0xfffffffe
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.004ebb9e
mov esp, ebp
pop ebp
ret
mov ebx, edi
shr ebx, 4
test ebx, ebx
je 0x4af4a6
lea eax, [esi + 0x10]
push eax
push esi
push dword [ebp - 0x2c]
push ebx
push dword [ebp - 0x24]
push dword [ebp - 0x28]
call dword [ebp - 0x3c]
shl ebx, 4
add dword [ebp - 0x28], ebx
add dword [ebp - 0x24], ebx
add esp, 0x18
sub edi, ebx
je 0x4af505
shr ebx, 4
mov edx, ebx
mov ecx, esi
call fcn.004af350
test edi, edi
je 0x4af505
mov ebx, dword [ebp - 0x28]
xor ecx, ecx
test edi, edi
je 0x4af4bf
mov al, byte [ebx + ecx]
xor byte [esi + ecx + 0x10], al
inc ecx
cmp ecx, edi
jb 0x4af4b3
push dword [ebp - 0x2c]
lea eax, [esi + 0x10]
push eax
push eax
call dword [ebp - 0x30]
push dword [ebp - 0x2c]
lea eax, [ebp - 0x1c]
push eax
push esi
call dword [ebp - 0x30]
add esp, 0x18
xor edx, edx
test edi, edi
je 0x4af505
lea eax, [ebp - 0x1c]
sub ebx, eax
sub dword [ebp - 0x24], eax
mov esi, dword [ebp - 0x24]
lea esp, [esp]
lea ecx, [ebp - 0x1c]
add ecx, edx
inc edx
mov al, byte [ebx + ecx]
xor al, byte [ecx]
mov byte [esi + ecx], al
cmp edx, edi
jb 0x4af4f0
mov esi, dword [ebp - 0x38]
mov eax, dword [ebp - 0x34]
cmp eax, 0x10
jae 0x4af527
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 - 0x2c]
lea eax, [ebp - 0x1c]
push eax
push esi
call dword [ebp - 0x30]
mov eax, dword [ebp - 0x1c]
xor dword [esi + 0x10], eax
mov eax, dword [ebp - 0x18]
xor dword [esi + 0x14], eax
mov eax, dword [ebp - 0x14]
xor dword [esi + 0x18], eax
mov eax, dword [ebp - 0x10]
xor dword [esi + 0x1c], eax
mov al, byte [ebp - 0x1d]
mov ecx, dword [ebp - 8]
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