Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proto: use v2 of Protobuf #46

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ require (
github.com/Masterminds/semver v1.5.0 // indirect
github.com/dchest/htmlmin v1.0.0 // indirect
github.com/decomp/exp v0.0.0-20181210173419-052a5b074939
github.com/golang/protobuf v1.3.2
github.com/google/subcommands v1.0.1
github.com/gorilla/websocket v1.4.1 // indirect
github.com/kr/pretty v0.1.0
Expand All @@ -22,6 +21,8 @@ require (
golang.org/x/text v0.3.2 // indirect
google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610 // indirect
google.golang.org/grpc v1.22.0
gopkg.in/yaml.v3 v3.0.0-20190924164351-c8b7dadae555 // indirect
google.golang.org/protobuf v0.0.0-20191007210826-3b65992c65a8
)

go 1.13
28 changes: 28 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,23 @@ github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfU
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.2.1-0.20190514181236-7800af189d76/go.mod h1:Zfz6qcDoDBESdv6JsKsGpgNHnkvwJAJwcA9eL+mOkgc=
github.com/golang/protobuf v1.2.1-0.20190515194842-7574ba03306e/go.mod h1:GjgUz9uwrRQmdPBBrFqiVbojAmlpy6ryM6DCzC+20rE=
github.com/golang/protobuf v1.2.1-0.20190516201927-a2cd3ac1b343/go.mod h1:PScGDF2x230A126tLt9Ol9RjhXzbiPJrt/CogooD2mE=
github.com/golang/protobuf v1.2.1-0.20190516215712-ae2eaafab405/go.mod h1:UmP8hhPKR5WWIjbT9v0JEVT+U0DBSjbW8KaZVeyFfRE=
github.com/golang/protobuf v1.2.1-0.20190523175523-a1331f0b4ab4/go.mod h1:G+fNMoyvKWZDB7PCDHF+dXbH9OeE3+JoozCd9V7i66U=
github.com/golang/protobuf v1.2.1-0.20190605195750-76c9e09470ba/go.mod h1:S1YIJXvYHGRCG2UmZsOcElkAYfvZLg2sDRr9+Xu8JXU=
github.com/golang/protobuf v1.2.1-0.20190617175902-f94016f5239f/go.mod h1:G+HpKX7pYZAVkElkAWZkr08MToW6pTp/vs+E9osFfbg=
github.com/golang/protobuf v1.2.1-0.20190620192300-1ee46dfd80dd/go.mod h1:+CMAsi9jpYf/wAltLUKlg++CWXqxCJyD8iLDbQONsJs=
github.com/golang/protobuf v1.2.1-0.20190806214225-7037721e6de0/go.mod h1:tDQPRlaHYu9yt1wPgdx85inRiLvUCuJZXsYjC0mwc1c=
github.com/golang/protobuf v1.2.1-0.20190820204156-2da1b93405dd/go.mod h1:x87I3ou7ehf/yR6iQ88MkyDogdxXN04TELJ7HVy7V7I=
github.com/golang/protobuf v1.2.1-0.20190820213554-ae1d65bc5435/go.mod h1:k7dGkiTZ3rjVDhKSpGt+x1zDzAePJk4jdhoBwIkQgBo=
github.com/golang/protobuf v1.2.1-0.20191004062209-62f67f1ea9df/go.mod h1:o4el5ABfDjqFlwwvAq2OIgAPeNXQYUkhtrjNPXy6T6I=
github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/subcommands v1.0.1 h1:/eqq+otEXm5vhfBrbREPCSVQbvofip6kIz+mX5TUH7k=
github.com/google/subcommands v1.0.1/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk=
github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q=
Expand Down Expand Up @@ -179,6 +193,20 @@ google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610/go.mod h1:DMBHOl98
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.22.0 h1:J0UbZOIrCAl+fpTOf8YLs4dJo8L/owV4LYVtAXQoPkw=
google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/protobuf v0.0.0-20190514172829-e89e6244e0e8/go.mod h1:791zQGC15vDqjpmPRn1uGPu5oHy/Jzw/Q1n5JsgIIcY=
google.golang.org/protobuf v0.0.0-20190514231807-cdb777356907/go.mod h1:HeRLsKXv4+wE27dOIGwnqcOgq6a1O/GJ7mGhiEPnBrU=
google.golang.org/protobuf v0.0.0-20190516201745-40b83d67fc75/go.mod h1:jf+u8AHuKtkib+0J4/bQXPNzCmT3V9a02hVzYKtatuw=
google.golang.org/protobuf v0.0.0-20190516215540-a95b29fbf623/go.mod h1:cWWmz5lsCWIcqGLROrKq5Lu231IJw2PzqOZ8cgspbfY=
google.golang.org/protobuf v0.0.0-20190522194032-21ade498bd69/go.mod h1:cJytyYi/6qdwy/+gD49hmgHcwD7zhWxE/1KPEslaZ3M=
google.golang.org/protobuf v0.0.0-20190605195314-89d49632e5cf/go.mod h1:Btug4TBaP5wNYcb2zGKDTS7WMcaPPLuqEAKfEAZWYbo=
google.golang.org/protobuf v0.0.0-20190617175724-bd7b7a9e0c26/go.mod h1:+FOB8T5/Yw4ywwdyeun9/KlDeuwFYBkNQ+kVuwj9C94=
google.golang.org/protobuf v0.0.0-20190620020611-d888139e7b59/go.mod h1:of3pt14Y+dOxz2tBOHXEoapPpKFC15/0zWhPAddkfsU=
google.golang.org/protobuf v0.0.0-20190717230113-f647c82cc3c7/go.mod h1:yGm7aNHn9Bp1NIvj6+CVUkcJshu+Usshfd3A+YxEuI8=
google.golang.org/protobuf v0.0.0-20190820203659-c0f8c0a24ece/go.mod h1:tRqhEyKwbKqwt5CQZAuOtj09RfhLNklDOhndhYA9blU=
google.golang.org/protobuf v0.0.0-20190820213257-f1e905b04207/go.mod h1:UJqt2ZERO8/qk5A9t8Ujq6OJ+MNvOQpg9X4RKyYz9Ho=
google.golang.org/protobuf v0.0.0-20190828183429-79bfdbe45be2/go.mod h1:fYMzYhnMXLj/kGDPzNOptS3IFFlQjWTlu2j3ZPET2lw=
google.golang.org/protobuf v0.0.0-20191007210826-3b65992c65a8 h1:cZcakhUh6rAgo2+CrQBULO/UuMJPubNvNgyL+iVBXkM=
google.golang.org/protobuf v0.0.0-20191007210826-3b65992c65a8/go.mod h1:qKrTvhhUFcTIUF6KuejTfRdHXKeBPoa4mtynR6usTss=
gopkg.in/AlecAivazis/survey.v1 v1.8.4/go.mod h1:iBNOmqKz/NUbZx3bA+4hAGLRC7fSK7tgtVDT4tB22XA=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
Expand Down
6 changes: 4 additions & 2 deletions proto/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ all: ${DIR} ${PB_GO} ${PB_PY} ${PB_RS}

# Go protobuf compiler:
#
# $ go get -u github.com/golang/protobuf/protoc-gen-go
# $ go get -u google.golang.org/protobuf/cmd/protoc-gen-go
# // Note: protoc-gen-go-grpc will move to google.golang.org/grpc (see https://github.com/golang/protobuf/issues/903)
# $ go get -u google.golang.org/protobuf/cmd/protoc-gen-go-grpc
# $ go get -u golang.org/x/tools/cmd/goimports

%.pb.go: %.proto
protoc -I . --go_out=plugins=grpc,paths=source_relative:$(basename $<) $<
protoc -I . --go_out=paths=source_relative:$(basename $<) --go-grpc_out=paths=source_relative:$(basename $<) $<
goimports -w "$(basename $<)/$@"

# Python protobuf compiler:
Expand Down
17 changes: 9 additions & 8 deletions proto/bin.proto
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
syntax = "proto3";

package bin;

option go_package = "github.com/lapsang-boys/pippi/proto/bin";

service BinaryParser {
Expand Down Expand Up @@ -38,14 +39,6 @@ enum Arch {
PowerPC_32 = 3;
}

// A Func is an imported or exported function.
message Func {
// Function address.
uint64 addr = 1;
// Function name.
string name = 2;
}

// A Section represents a continuous section of memory.
message Section {
// Section name; or empty if unnamed section or memory segment.
Expand Down Expand Up @@ -80,3 +73,11 @@ enum Perm {
// Memory is executable.
X = 2;
}

// A Func is an imported or exported function.
message Func {
// Function address.
uint64 addr = 1;
// Function name.
string name = 2;
}
2 changes: 2 additions & 0 deletions proto/disasm.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ syntax = "proto3";

package disasm;

option go_package = "github.com/lapsang-boys/pippi/proto/disasm";

import "bin.proto";

service Disassembler {
Expand Down
2 changes: 2 additions & 0 deletions proto/disasm_objdump.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ syntax = "proto3";

package disasm_objdump;

option go_package = "github.com/lapsang-boys/pippi/proto/disasm_objdump";

service InstAddrExtractor {
rpc ExtractInstAddrs(InstAddrsRequest) returns (InstAddrsReply) {}
}
Expand Down
10 changes: 6 additions & 4 deletions proto/strings.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ syntax = "proto3";

package strings;

option go_package = "github.com/lapsang-boys/pippi/proto/strings";

service StringsExtractor {
rpc ExtractStrings (StringsRequest) returns (StringsReply) {}
}
Expand All @@ -11,6 +13,10 @@ message StringsRequest {
string bin_id = 1;
}

message StringsReply {
repeated StringInfo strings = 1;
}

message StringInfo {
// File offset to start of string.
uint64 location = 1;
Expand All @@ -22,10 +28,6 @@ message StringInfo {
Encoding encoding = 4;
}

message StringsReply {
repeated StringInfo strings = 1;
}

// String encodings.
enum Encoding {
// ASCII encoding.
Expand Down
2 changes: 2 additions & 0 deletions proto/upload.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ syntax = "proto3";

package upload;

option go_package = "github.com/lapsang-boys/pippi/proto/upload";

service Upload {
rpc Upload (UploadRequest) returns (UploadReply) {}
}
Expand Down