Skip to content

Commit

Permalink
15.0.12
Browse files Browse the repository at this point in the history
  • Loading branch information
@ committed Jul 30, 2021
1 parent 1e64e0a commit a9665ad
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 6 deletions.
1 change: 1 addition & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
go build -ldflags="-s -w" -tags=tempdll
15 changes: 14 additions & 1 deletion falgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ func entry()error{
lsps.PrintDefaults()
}

lsdev:=flag.NewFlagSet("lsdev",flag.ExitOnError)
lsdev.Usage= func() {
fmt.Fprintf(lsdev.Output(), "============== 列出所有设备 使用方法:%s\n", "lsdev")
lsdev.PrintDefaults()
}

api:=flag.NewFlagSet("api",flag.ExitOnError)
api.Usage= func() {
fmt.Fprintf(api.Output(), "============== api导出 使用方法:%s\n", "api 1.js -name 通讯录")
Expand All @@ -76,6 +82,8 @@ func entry()error{


flag.Usage=func() {
lsdev.Usage()
fmt.Fprintln(flag.CommandLine.Output(),"")
create.Usage()
fmt.Fprintln(flag.CommandLine.Output(),"")
run.Usage()
Expand All @@ -90,6 +98,7 @@ func entry()error{
fmt.Fprintln(flag.CommandLine.Output(),"")
bagbak.Usage()
fmt.Fprintln(flag.CommandLine.Output(),"")

}


Expand All @@ -100,7 +109,8 @@ func entry()error{

cmd:=os.Args[1]
switch cmd{

case "lsdev":
lsdev.Parse(os.Args[2:])
case "lsapp":
lsapp.Parse(os.Args[2:])
case "lsps":
Expand Down Expand Up @@ -202,6 +212,9 @@ func entry()error{
default:
return errors.New("不支持这个命令行")
}
if lsdev.Parsed(){
return NewLsDev().Run(LsDevParam{})
}
if lsapp.Parsed(){
return NewLsApp().Run(LsAppParam{Devi: *lsapp_devi})
}
Expand Down
20 changes: 17 additions & 3 deletions func.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
frida_go "github.com/a97077088/frida-go"
"net"
"strings"
)

Expand All @@ -10,11 +11,24 @@ func ParseDevice(mgr* frida_go.DeviceManager,s string)(*frida_go.Device,error){
if s==""||s=="usb"||s=="u"{
return mgr.GetDeviceByType(frida_go.DeviceType_USB,1000)
}
if s=="local"||s=="localhost"{
if s=="local"||s=="localhost"||s=="Local System"||s=="Local Socket"{
return mgr.GetDeviceByType(frida_go.DeviceType_LOCAL,1000)
}
d,err:=mgr.AddRemoteDevice(s,frida_go.RemoteDeviceOptions{
})
var d *frida_go.Device
_,_,err:=net.SplitHostPort(s)
if err==nil{
d,err=mgr.AddRemoteDevice(s,frida_go.RemoteDeviceOptions{
})
if err!=nil{
return nil,err
}
}else{
d,err=mgr.FindDeviceById(s,1000)
if err!=nil{
return nil,err
}
}

_,err=d.EnumerateProcesses(frida_go.ProcessQueryOptions{})
if err!=nil{
return nil,err
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (

require (
github.com/a97077088/dylib v0.0.0-20210726041103-cf42039dadef // indirect
github.com/a97077088/libfridabinres v0.0.0-20210727051601-2a4bab9190b0 // indirect
github.com/a97077088/libfridabinres v0.0.0-20210730113754-7e4118dad053 // indirect
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-playground/locales v0.13.0 // indirect
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ github.com/a97077088/frida-go v0.0.0-20210727074114-31f14e05a98a h1:WAWysz2LUg8g
github.com/a97077088/frida-go v0.0.0-20210727074114-31f14e05a98a/go.mod h1:t1Q6YshypLGY5bs/aZT7UH3Ty/HKR7Gx8UcR7B0/HNY=
github.com/a97077088/libfridabinres v0.0.0-20210727051601-2a4bab9190b0 h1:fUx+VlQ41kfzJGcCjLS1mVdm8129/dViIYjWaNeN/3M=
github.com/a97077088/libfridabinres v0.0.0-20210727051601-2a4bab9190b0/go.mod h1:ooSNVs9odQ8D99rUL1SsXoYDiXzC5yGvdWG1sYeir+0=
github.com/a97077088/libfridabinres v0.0.0-20210730113629-afeb95d87b64 h1:k6eHHbnYZjAXucLZCL2PmRoAOBHAWaZBDyj7uim/nlU=
github.com/a97077088/libfridabinres v0.0.0-20210730113629-afeb95d87b64/go.mod h1:ooSNVs9odQ8D99rUL1SsXoYDiXzC5yGvdWG1sYeir+0=
github.com/a97077088/libfridabinres v0.0.0-20210730113754-7e4118dad053 h1:1/OU6+ik6Hwi5agD3SSfBfRXz97qbK/rbbI4lBnXyow=
github.com/a97077088/libfridabinres v0.0.0-20210730113754-7e4118dad053/go.mod h1:ooSNVs9odQ8D99rUL1SsXoYDiXzC5yGvdWG1sYeir+0=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down
1 change: 0 additions & 1 deletion lsapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ type LsApp struct {
}

func (l *LsApp) Run(param LsAppParam) error {
fmt.Println(param.Devi)
mgr:=frida_go.DeviceManager_Create()
defer mgr.Close()

Expand Down
39 changes: 39 additions & 0 deletions lsds.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package main

import (
"fmt"
frida_go "github.com/a97077088/frida-go"
)

type LsDevParam struct {

}
type LsDev struct {

}

func (l *LsDev) Run(param LsDevParam) error {
mgr:=frida_go.DeviceManager_Create()
defer mgr.Close()
ds,err:=mgr.EnumerateDevices()
if err!=nil{
panic(err)
}
for _, d := range ds {
dtype:=d.Type()
tp:="未知"
if dtype==0{
tp="本地"
}else if dtype==1{
tp="远程"
}else if dtype==2{
tp="usb"
}
fmt.Println(fmt.Sprintf("设备id:%s ,名称: %s 类型:%s",d.Id(),d.Name(),tp))
}
return nil
}

func NewLsDev()*LsDev{
return &LsDev{}
}

0 comments on commit a9665ad

Please sign in to comment.