func (f *File) ReadBytesForUUID(uuid types.UUID, offset int64, size uint64) ([]byte, error) {
	data := make([]byte, size)
	if _, err := f.r[uuid].ReadAt(data, offset); err != nil {
		return nil, fmt.Errorf("failed to read bytes at offset %#x: %v", offset, err)
	}
	return data, nil
}
ReadBytesForUUID returns bytes at a given offset for a given cache UUID
package dyld
import (
	"encoding/binary"
	"fmt"
	"strings"
	"github.com/blacktop/go-macho/types"
)
func (f *File) Is64bit() bool {
	return strings.Contains(f.Headers[f.UUID].Magic.String(), "64")
}
func (f *File) IsArm64() bool {
	return strings.Contains(f.Headers[f.UUID].Magic.String(), "arm64")
}
func (f *File) GetOffset(address uint64) (types.UUID, uint64, error) {
	for uuid, cacheMaps := range f.Mappings {
		for _, mapping := range cacheMaps {
			if mapping.Address <= address && address < mapping.Address+mapping.Size {
				return uuid, (address - mapping.Address) + mapping.FileOffset, nil
			}
		}
	}
	var badUUID types.UUID  
	return badUUID, 0, fmt.Errorf("address %#x not within any mappings address range", address)
}
func (f *File) GetOffsetForUUID(uuid types.UUID, address uint64) (uint64, error) {
	for _, mapping := range f.Mappings[uuid] {
		if mapping.Address <= address && address < mapping.Address+mapping.Size {
			return (address - mapping.Address) + mapping.FileOffset, nil
		}
	}
	return 0, fmt.Errorf("address %#x not within any mappings address range", address)
}
func (f *File) IsAddressInCache(uuid types.UUID, address uint64) bool {
	for _, mapping := range f.Mappings[uuid] {
		if mapping.Address <= address && address < mapping.Address+mapping.Size {
			return true
		}
	}
	return false
}
func (f *File) GetVMAddressForUUID(uuid types.UUID, offset uint64) (uint64, error) {
	for _, mapping := range f.Mappings[uuid] {
		if mapping.FileOffset <= offset && offset < mapping.FileOffset+mapping.Size {
			return (offset - mapping.FileOffset) + mapping.Address, nil
		}
	}
	return 0, fmt.Errorf("offset %#x not within any mappings file offset range", offset)
}
func (f *File) GetMappingForOffsetForUUID(uuid types.UUID, offset uint64) (*CacheMapping, error) {
	for _, mapping := range f.Mappings[uuid] {
		if mapping.FileOffset <= offset && offset < mapping.FileOffset+mapping.Size {
			return mapping, nil
		}
	}
	return nil, fmt.Errorf("offset %#x not within any mappings file offset range", offset)
}
func (f *File) GetMappingForVMAddress(address uint64) (*CacheMapping, error) {
	for _, cacheMaps := range f.Mappings {
		for _, mapping := range cacheMaps {
			if mapping.Address <= address && address < mapping.Address+mapping.Size {
				return mapping, nil
			}
		}
	}
	return nil, fmt.Errorf("address %#x not within any mapping's address range", address)
}