
syntax = "proto3";

import "angr/protos/primitives.proto";

package angr.protos;

message CFGNode {
    uint64          ea = 1; // Address of the node
    uint32          size = 2; // Size of the node
    repeated int64  block_id = 3; // A unique identifier of the node
    bool            returning = 4; // If it is a call node, does it return?
    repeated uint64 instr_addrs = 5; // Instruction addresses
}

message CFG {
    string                  ident = 1; // The identifier of this CFG
    repeated CFGNode        nodes = 2; // All nodes in this CFG
    repeated Edge           edges = 3; // All edges in this CFG
    repeated MemoryData     memory_data = 4;
    bool                    normalized = 5; // Whether the control flow graph has been normalized or not
}

message MemoryData {
    enum MemoryDataType {
        UnknownDataType = 0;
        Unspecified = 1;
        Integer = 2;
        PointerArray = 3;
        String = 4;
        UnicodeString = 5;
        SegmentBoundary = 6;
        CodeReference = 7;
        GOTPLTEntry = 8;
        ELFHeader = 9;
        FloatingPoint = 10;
        Alignment = 11;
    }

    uint64          ea = 1; // Address of the data
    optional uint32 size = 2; // Size of the memory data item in memory
    MemoryDataType  type = 3; // Type of the data (reference)
    optional uint32 reference_size = 4; // Reference size of the data
}
