-
Notifications
You must be signed in to change notification settings - Fork 9
/
SpawnDetails.go
46 lines (36 loc) · 927 Bytes
/
SpawnDetails.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package frida_go
import (
"fmt"
"github.com/a97077088/frida-go/cfrida"
"unsafe"
)
type SpawnDetails struct {
CObj
}
func (s *SpawnDetails) Description() string {
if s.instance==0{
return ""
}
return fmt.Sprintf("Frida.SpawnDetails(pid: %d, identifier: %s)",s.Pid(),s.Identifier())
}
func (p *SpawnDetails) Pid() uint {
return cfrida.Frida_spawn_get_pid(p.instance)
}
func (p *SpawnDetails) Identifier() string {
return cfrida.Frida_spawn_get_identifier(p.instance)
}
func (d *SpawnDetails) Free() {
//fmt.Println("spawn gc")
cfrida.G_object_unref(d.instance)
}
// SpawnDetailsFromInst
// 新建一个对象来自已经存在的对象实例指针。
//
// Create a new object from an existing object instance pointer.
func SpawnDetailsFromInst(inst uintptr) *SpawnDetails {
dl:=new(SpawnDetails)
dl.instance=inst
dl.ptr= unsafe.Pointer(dl.instance)
setFinalizer(dl, (*SpawnDetails).Free)
return dl
}