59 lines
1.3 KiB
Protocol Buffer
59 lines
1.3 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
option optimize_for = LITE_RUNTIME;
|
|
option go_package = "pkg/protomodel";
|
|
|
|
package protomodel;
|
|
|
|
message MachoInfo {
|
|
enum PointerSize {
|
|
invalid = 0;
|
|
p32 = 1;
|
|
p64 = 2;
|
|
}
|
|
|
|
message InitPointer {
|
|
uint64 offset = 1; // offset relative to the macho header
|
|
uint64 value = 2; // address of the init function
|
|
}
|
|
|
|
// right now we waste memory to store name/hash for all symbols
|
|
// should consider compress them, dyld stores the index in list of LC_DYLIB
|
|
message BindSymbol {
|
|
string name = 1;
|
|
string libname = 2;
|
|
uint32 libhash = 3;
|
|
uint32 segment = 4; // segment index
|
|
uint64 offset = 5; // offset in segment
|
|
}
|
|
|
|
message SymbolTable {
|
|
uint32 symbolIndex = 1;
|
|
uint32 segmentIndex = 2;
|
|
uint32 offset = 3;
|
|
}
|
|
message LibraryImportedSymbols {
|
|
uint32 libIndex = 1;
|
|
uint32 nsymbols = 2;
|
|
repeated SymbolTable symbols = 3;
|
|
}
|
|
|
|
message AllImportedSymbols {
|
|
repeated string libs = 1;
|
|
repeated string symbols = 2;
|
|
repeated LibraryImportedSymbols tables = 3;
|
|
}
|
|
|
|
message Selector {
|
|
uint32 idx = 1;
|
|
string name = 2;
|
|
}
|
|
|
|
PointerSize pointer_size = 1;
|
|
uint64 image_base = 2;
|
|
uint64 main = 3;
|
|
repeated InitPointer init_pointers = 4;
|
|
AllImportedSymbols symbols = 5;
|
|
repeated Selector special_selectors = 6;
|
|
}
|