Function at 0x499c94
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffdc
mov eax, dword [ebp + 8]
mov ax, word [eax - 2]
mov word [ebp - 8], ax
xor eax, eax
mov dword [ebp - 0x10], eax
xor eax, eax
mov dword [ebp - 0x14], eax
mov byte [ebp - 1], 0
xor eax, eax
mov al, byte [ebp - 1]
lea eax, [eax + eax*2]
mov edx, dword [0x52d7dc]
lea eax, [edx + eax*4]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x1c]
cmp byte [eax], 0
je 0x499ef7
mov eax, dword [ebp - 0x1c]
mov al, byte [eax + 1]
mov edx, dword [ebp - 0x1c]
mov dl, byte [edx + 2]
sub dl, al
jb 0x499ef7
inc edx
mov byte [ebp - 0x1d], dl
mov byte [ebp - 2], al
mov eax, dword [0x52db98]
mov al, byte [eax]
test al, al
jbe 0x499eeb
mov byte [ebp - 0x1e], al
mov byte [ebp - 4], 1
xor eax, eax
mov al, byte [ebp - 4]
mov edx, dword [0x52d7d8]
mov edx, dword [edx]
mov al, byte [edx + eax]
mov byte [ebp - 3], al
xor eax, eax
mov al, byte [ebp - 3]
shl eax, 4
lea eax, [eax + eax*8]
mov edx, dword [0x52d900]
mov edx, dword [edx]
lea eax, [edx + eax*8]
xor edx, edx
mov dl, byte [ebp - 1]
add edx, edx
lea edx, [edx + edx*8]
lea eax, [eax + edx*8]
xor edx, edx
mov dl, byte [ebp - 2]
lea edx, [edx + edx*2]
lea eax, [eax + edx*4]
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x24]
cmp dword [eax], 0
je 0x499eb7
mov eax, dword [ebp - 0x24]
cmp word [eax + 4], 0
jne 0x499eb7
mov cl, byte [ebp - 2]
mov dl, byte [ebp - 1]
mov al, byte [ebp - 3]
call fcn.00417590
test al, al
jne 0x499eb7
mov eax, dword [ebp - 0x24]
mov eax, dword [eax]
mov edx, dword [0x52d4d0]
cmp eax, dword [edx]
je 0x499eb7
lea eax, [ebp - 0x14]
push eax
mov eax, dword [ebp + 8]
mov al, byte [eax - 3]
push eax
mov eax, dword [ebp + 8]
mov al, byte [eax - 4]
push eax
push 1
lea edx, [ebp - 1]
lea eax, [ebp - 3]
mov cl, byte [ebp - 2]
call fcn.00499a24
test al, al
je 0x499eb7
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
je 0x499e11
mov eax, dword [ebp - 0x18]
mov ax, word [eax]
mov word [ebp - 6], ax
mov eax, dword [ebp + 8]
mov cl, byte [eax - 4]
mov eax, dword [ebp + 8]
mov dl, byte [eax - 3]
mov ax, word [ebp - 6]
call fcn.00499ab8
mov byte [ebp - 9], al
movzx eax, word [ebp - 6]
mov edx, dword [ebp + 8]
mov edx, dword [edx - 8]
movzx eax, byte [edx + eax]
sub word [ebp - 8], ax
movsx eax, byte [ebp - 9]
cdq
xor eax, edx
sub eax, edx
add word [ebp - 8], ax
mov eax, dword [ebp - 0x18]
mov eax, dword [eax + 4]
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
jne 0x499dc1
mov eax, dword [ebp + 8]
mov ax, word [eax - 2]
cmp ax, word [ebp - 8]
ja 0x499e4d
lea eax, [ebp - 0x14]
push eax
mov eax, dword [ebp + 8]
mov al, byte [eax - 3]
push eax
mov eax, dword [ebp + 8]
mov al, byte [eax - 4]
push eax
push 0
lea edx, [ebp - 1]
lea eax, [ebp - 3]
mov cl, byte [ebp - 2]
call fcn.00499a24
mov eax, dword [ebp + 8]
mov ax, word [eax - 2]
mov word [ebp - 8], ax
jmp 0x499eb7
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
je 0x499eac
mov eax, dword [ebp - 0x18]
mov ax, word [eax]
mov word [ebp - 6], ax
mov eax, dword [ebp + 8]
mov cl, byte [eax - 4]
mov eax, dword [ebp + 8]
mov dl, byte [eax - 3]
mov ax, word [ebp - 6]
call fcn.00499ab8
movsx eax, al
cdq
xor eax, edx
sub eax, edx
movzx edx, word [ebp - 6]
mov ecx, dword [ebp + 8]
mov ecx, dword [ecx - 8]
mov byte [ecx + edx], al
mov eax, dword [0x52d61c]
mov eax, dword [eax]
mov dx, word [ebp - 6]
call fcn.00402dc4
mov eax, dword [ebp - 0x18]
mov eax, dword [eax + 4]
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
jne 0x499e59
mov eax, dword [ebp + 8]
mov dx, word [ebp - 8]
mov word [eax - 2], dx
cmp dword [ebp - 0x14], 0
je 0x499edf
mov eax, dword [ebp - 0x14]
mov eax, dword [eax + 4]
mov dword [ebp - 0x18], eax
mov edx, 8
mov eax, dword [ebp - 0x14]
call sub.Vcl40.bpl__System__FreeMem_qqrv
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jne 0x499ebd
inc byte [ebp - 4]
dec byte [ebp - 0x1e]
jne 0x499d04
inc byte [ebp - 2]
dec byte [ebp - 0x1d]
jne 0x499cee
inc byte [ebp - 1]
cmp byte [ebp - 1], 6
jne 0x499cb3
cmp dword [ebp - 0x10], 0
jne 0x499caf
mov esp, ebp
pop ebp
ret