func (f *File) readBaseRelocationTable() (*[]RelocationTableEntry, error) {
	if f.OptionalHeader == nil {  
		return nil, nil
	}
	var dd DataDirectory
	if f.Machine == IMAGE_FILE_MACHINE_AMD64 {
		dd = f.OptionalHeader.(*OptionalHeader64).DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC]
	} else {
		dd = f.OptionalHeader.(*OptionalHeader32).DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC]
	}
	var sectionData []byte
	var err error
	for _, section := range f.Sections {
		if section.VirtualAddress == dd.VirtualAddress {
			sectionData, err = section.Data()
			if err != nil {
				return nil, err
			}
			break
		}
	}
	r := bytes.NewReader(sectionData)
	var reloBlocks []RelocationTableEntry
	bytesRead := uint32(0)
	for bytesRead < dd.Size {
		var reloBlock RelocationBlock
		err = binary.Read(r, binary.LittleEndian, &reloBlock)
		bytesRead += 8
		if err != nil {
			return nil, fmt.Errorf("fail to read relocation block: %v", err)
		}
		numBlocks := (reloBlock.SizeOfBlock - 8) / 2
		blocks := make([]BlockItem, numBlocks)
		for i := uint32(0); i < numBlocks; i++ {
			var buf [2]byte
			err = binary.Read(r, binary.LittleEndian, &buf)
			bytesRead += 2
			if err != nil {
				return nil, fmt.Errorf("fail to read relocation block item %d: %v", i, err)
			}
			var item BlockItem
			val := binary.LittleEndian.Uint16(buf[:2])
			item.Type = byte(val >> 12)
			item.Offset = val & 0x0fff
			blocks[i] = item
		}
		reloBlocks = append(reloBlocks, RelocationTableEntry{reloBlock, blocks})
	}
	return &reloBlocks, nil
}
readBaseRelocationTable - reads the base relocation table from the file and stores it
package pe
import (
	"bytes"
	"encoding/binary"
	"fmt"
	"io"
)
type RelocationTableEntry struct {
	RelocationBlock
	BlockItems []BlockItem
}
type RelocationBlock struct {
	VirtualAddress uint32
	SizeOfBlock    uint32
}
type BlockItem struct {
	Type   byte    
	Offset uint16  
}
type Reloc struct {
	VirtualAddress   uint32
	SymbolTableIndex uint32
	Type             uint16
}
const (
	IMAGE_REL_BASED_ABSOLUTE = 0
	IMAGE_REL_BASED_HIGHLOW = 3
	IMAGE_REL_BASED_DIR64 = 10
)