Function at 0x41efa7
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x3c
push ebx
push esi
push edi
mov esi, edx
mov dword [ebp - 8], ecx
mov ebx, eax
mov dword [ebp - 0x10], eax
test eax, eax
jle 0x41f23b
cmp dword [esi + 0x18], 0
je 0x41f144
mov eax, dword [esi + 0x20]
mov dword [ebp - 4], eax
cmp eax, ebx
jl 0x41efd9
mov dword [ebp - 4], ebx
mov eax, dword [esi + 0x1c]
mov edi, dword [ebp - 4]
sub eax, dword [esi + 0x20]
mov edx, dword [ebp - 8]
push edi
push edx
lea ecx, [eax + esi + 4]
push ecx
call fcn.0051c007
add esp, 0xc
sub dword [esi + 0x20], edi
jne 0x41f225
mov ecx, dword [esi + 4]
mov eax, ecx
shr eax, 8
and eax, 0x7f
cmp eax, 0x7e
jge 0x41f011
xor edi, edi
jmp 0x41f01e
lea edi, [eax - 0x7e]
neg edi
sbb edi, edi
and edi, 6
add edi, 2
mov ebx, ecx
shr ebx, 0xf
and ebx, 1
add ebx, ebx
add ebx, ebx
lea edx, [ebx + edi + 2]
mov dword [ebp - 0xc], edx
mov edx, dword [esi + 0x1c]
cmp edx, dword [ebp - 0xc]
jge 0x41f04b
mov eax, dword [ebp - 0xc]
mov ecx, eax
sub ecx, edx
mov dword [esi + 0x20], ecx
mov dword [esi + 0x1c], eax
jmp 0x41f225
test edi, edi
jne 0x41f054
cdq
mov ecx, eax
jmp 0x41f093
cmp edi, 2
jne 0x41f06b
shr ecx, 0x10
push ecx
call dword [0x1012b30c]
movzx eax, ax
cdq
mov ecx, eax
jmp 0x41f093
mov eax, dword [esi + 0xa]
mov edx, dword [esi + 6]
push eax
mov dword [ebp - 0x24], edx
call dword [0x1012b2dc]
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x24]
push eax
call dword [0x1012b2dc]
xor ecx, ecx
or ecx, dword [ebp - 0x30]
mov edx, eax
xor eax, eax
or edx, eax
mov eax, edx
mov dword [esi + 0x28], ecx
mov dword [esi + 0x2c], edx
mov dword [esi + 0x30], ecx
mov dword [esi + 0x34], eax
test ebx, ebx
jle 0x41f0ab
lea ebx, [edi + esi + 6]
jmp 0x41f0ad
xor ebx, ebx
mov dword [esi + 0x14], ebx
mov dl, byte [esi + 4]
mov eax, dword [esi + 4]
and dl, 0xf
mov byte [ebp - 0x14], dl
mov edx, eax
shr eax, 7
and eax, 1
mov dword [ebp - 0xc], eax
mov eax, dword [esi + 0x2c]
push eax
mov dword [ebp - 0x38], ecx
mov eax, dword [ebp - 0x38]
mov ecx, dword [esi]
mov edi, dword [ecx + 0xc]
mov ecx, dword [ecx + 8]
mov ecx, dword [ecx + 0x230]
push eax
mov eax, dword [ebp - 0x14]
shr edx, 4
and dl, 7
push ebx
push eax
mov byte [ebp - 0x18], dl
mov eax, dword [ebp - 0x18]
push eax
mov eax, dword [ebp - 0xc]
mov dword [ebp - 0x1c], ecx
mov ecx, dword [ecx]
push eax
mov eax, dword [edi + 4]
mov edx, dword [eax + 0x30]
mov dword [ebp - 0xc], ecx
lea ecx, [edi + 4]
call edx
mov ecx, dword [ebp - 0x1c]
push eax
mov eax, dword [ebp - 0xc]
mov eax, dword [eax + 0x2c]
push edi
call eax
cmp eax, 2
je 0x41f23b
cmp dword [esi + 0x2c], 0
ja 0x41f12b
cmp dword [esi + 0x28], 0
jbe 0x41f137
mov dword [esi + 0x18], 0
jmp 0x41f225
call fcn.0041f3d7
cmp eax, 2
jmp 0x41f223
mov edi, dword [esi + 0x30]
mov eax, ebx
cdq
cmp dword [esi + 0x34], edx
ja 0x41f15a
jb 0x41f155
cmp edi, eax
jae 0x41f15a
mov dword [ebp - 4], edi
jmp 0x41f15f
mov dword [ebp - 4], ebx
mov edi, ebx
cmp dword [esi + 0x14], 0
je 0x41f18e
mov ecx, dword [esi + 0x28]
sub ecx, dword [esi + 0x30]
and ecx, 3
test edi, edi
jle 0x41f18e
mov eax, dword [ebp - 8]
sub ecx, eax
mov dword [ebp - 0xc], edi
mov ebx, dword [esi + 0x14]
lea edx, [ecx + eax]
and edx, 3
mov dl, byte [edx + ebx]
xor byte [eax], dl
inc eax
dec dword [ebp - 0xc]
jne 0x41f17a
mov eax, edi
cdq
sub dword [esi + 0x30], eax
mov eax, dword [esi]
push edi
sbb dword [esi + 0x34], edx
mov ebx, dword [eax + 0xc]
mov eax, dword [eax + 8]
mov eax, dword [eax + 0x230]
mov edx, dword [ebp - 8]
lea ecx, [ebx + 4]
push edx
mov edx, dword [ecx]
mov edx, dword [edx + 0x30]
mov dword [ebp - 0x1c], eax
mov eax, dword [eax]
mov dword [ebp - 0xc], eax
call edx
mov ecx, dword [ebp - 0x1c]
push eax
mov eax, dword [ebp - 0xc]
mov eax, dword [eax + 0x30]
push ebx
call eax
cmp eax, 2
je 0x41f23b
mov ecx, dword [esi + 0x30]
or ecx, dword [esi + 0x34]
jne 0x41f225
mov eax, dword [esi]
mov ebx, dword [eax + 0xc]
mov eax, dword [eax + 8]
mov eax, dword [eax + 0x230]
mov edx, dword [ebx + 4]
mov edi, dword [eax]
lea ecx, [ebx + 4]
mov dword [ebp - 0x1c], eax
mov eax, dword [edx + 0x30]
call eax
mov ecx, dword [ebp - 0x1c]
mov edx, dword [edi + 0x34]
push eax
push ebx
call edx
xor edx, edx
mov ecx, 2
mov dword [esi + 0x18], 1
mov dword [esi + 0x14], edx
mov dword [esi + 0x1c], ecx
mov dword [esi + 0x20], ecx
mov dword [esi + 0x28], edx
mov dword [esi + 0x2c], edx
mov dword [esi + 0x30], edx
mov dword [esi + 0x34], edx
cmp eax, ecx
je 0x41f23b
mov eax, dword [ebp - 4]
mov ebx, dword [ebp - 0x10]
add dword [ebp - 8], eax
sub ebx, eax
mov dword [ebp - 0x10], ebx
test ebx, ebx
jg 0x41efc2
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret