-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to implement the dynamic library frida-gadget-16.0.19-linux-x86.so.xz provided by Frida using Golang? #14
Comments
Hi, you could probably do something like this. main.go package main
/*
extern void intercept(void);
__attribute__((constructor))
static void ctor(int argc, char **argv) {
intercept();
}
*/
import "C"
import (
"fmt"
"github.com/frida/frida-go/frida"
)
//export intercept
func intercept() {
fmt.Printf("frida version is %s\n", frida.Version())
}
func main() {
} file.c #include <stdio.h>
int main(void) {
printf("hello there\n");
return 0;
} Compiling $ go build -o libinterceptor.dylib -buildmode=c-shared main.go
$ gcc file.c -o file Usage Since I am on MacOS, I use $ DYLD_INSERT_LIBRARIES=./libinterceptor.dylib ./file |
If I put frida encapsulated into a dynamic library, through localDev. Attach (OS) Getpid (), nil) monitoring pid will appear this mistake:FError: Unable to access process with pid 2928 due to system restrictions; try |
I have a requirement to write a dynamic library using Go, and if I compile it into a libtool.so library, I can load it using LD_PRELOAD=/root/libtool.so ./dome. Currently, frida-gadget-16.0.19-linux-x86.so.xz provided by the official Frida can intercept functions specified in dome using this method. If I want to implement such a library using Go, what should I do to achieve the same principle as the .so library of frida-gadget-16.0.19-linux-x86.so.xz?
The text was updated successfully, but these errors were encountered: