-
Notifications
You must be signed in to change notification settings - Fork 9
/
CrashDetails.go
55 lines (44 loc) · 1.21 KB
/
CrashDetails.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
47
48
49
50
51
52
53
54
55
package frida_go
import (
"fmt"
"github.com/a97077088/frida-go/cfrida"
"unsafe"
)
type CrashDetails struct {
CObj
}
func (c *CrashDetails) Pid() uint {
return cfrida.Frida_crash_get_pid(c.instance)
}
func (c *CrashDetails) ProcessName() string {
return cfrida.Frida_crash_get_process_name(c.instance)
}
func (c *CrashDetails) Summary() string {
return cfrida.Frida_crash_get_summary(c.instance)
}
func (c *CrashDetails) Report() string {
return cfrida.Frida_crash_get_report(c.instance)
}
func (c *CrashDetails) Parameters() map[string]interface{} {
return cfrida.Frida_crash_get_parameters(c.instance)
}
func (c *CrashDetails) Description() string {
if c.instance==0{
return ""
}
return fmt.Sprintf("Frida.CrashDetails(pid: %d, processName: %s, summary: %s",c.Pid(),c.ProcessName(),c.Summary())
}
func (c *CrashDetails) Free() {
cfrida.G_object_unref(c.instance)
}
// CrashDetailsFromInst
// 新建一个对象来自已经存在的对象实例指针。
//
// Create a new object from an existing object instance pointer.
func CrashDetailsFromInst(inst uintptr) *CrashDetails {
dl:=new(CrashDetails)
dl.instance=inst
dl.ptr= unsafe.Pointer(dl.instance)
setFinalizer(dl, (*CrashDetails).Free)
return dl
}