diff --git a/go.mod b/go.mod index b20346f..a625496 100644 --- a/go.mod +++ b/go.mod @@ -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 @@ -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 diff --git a/go.sum b/go.sum index 4abfc07..bdc989f 100644 --- a/go.sum +++ b/go.sum @@ -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= @@ -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= diff --git a/proto/Makefile b/proto/Makefile index ded8621..a0f45fe 100644 --- a/proto/Makefile +++ b/proto/Makefile @@ -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: diff --git a/proto/bin.proto b/proto/bin.proto index 0c083f8..904c20b 100644 --- a/proto/bin.proto +++ b/proto/bin.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package bin; + option go_package = "github.com/lapsang-boys/pippi/proto/bin"; service BinaryParser { @@ -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. @@ -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; +} diff --git a/proto/disasm.proto b/proto/disasm.proto index 2c48e80..cf34107 100644 --- a/proto/disasm.proto +++ b/proto/disasm.proto @@ -2,6 +2,8 @@ syntax = "proto3"; package disasm; +option go_package = "github.com/lapsang-boys/pippi/proto/disasm"; + import "bin.proto"; service Disassembler { diff --git a/proto/disasm_objdump.proto b/proto/disasm_objdump.proto index 845b988..ba01cae 100644 --- a/proto/disasm_objdump.proto +++ b/proto/disasm_objdump.proto @@ -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) {} } diff --git a/proto/strings.proto b/proto/strings.proto index 7896699..83a3402 100644 --- a/proto/strings.proto +++ b/proto/strings.proto @@ -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) {} } @@ -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; @@ -22,10 +28,6 @@ message StringInfo { Encoding encoding = 4; } -message StringsReply { - repeated StringInfo strings = 1; -} - // String encodings. enum Encoding { // ASCII encoding. diff --git a/proto/upload.proto b/proto/upload.proto index e5613cc..78181bb 100644 --- a/proto/upload.proto +++ b/proto/upload.proto @@ -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) {} }