Skip to content
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

feat: support for Windows (using MinGW) #53

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Supported OS:
- [x] MacOS
- [x] Linux
- [x] Android
- [ ] Windows
- [x] Windows

# Small example
```golang
Expand Down
5 changes: 4 additions & 1 deletion frida/frida.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@
package frida

/*
#cgo LDFLAGS: -lfrida-core -lm -ldl
#cgo LDFLAGS: -lfrida-core -lm
#cgo !windows LDFLAGS: -ldl
#cgo windows LDFLAGS: -lws2_32 -lgdi32 -lole32 -liphlpapi -lsetupapi -lpsapi -lshell32 -lshlwapi -ldnsapi -lcrypt32 -luuid -lshfolder
#cgo CFLAGS: -I/usr/local/include/ -w
#cgo windows CFLAGS: -Wno-error=incompatible-pointer-types
#cgo darwin LDFLAGS: -lbsm -framework IOKit -framework Foundation -framework AppKit -framework Security -lpthread
#cgo darwin CFLAGS: -Wno-error=incompatible-function-pointer-types
#cgo android LDFLAGS: -llog
Expand Down
14 changes: 11 additions & 3 deletions frida/unmarshaller.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
package frida

/*
#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#pragma comment(lib, "Ws2_32.lib")
typedef unsigned short in_port_t;
#else
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#endif

#include <frida-core.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>

static char * get_gvalue_gtype(GValue * val) {
return (char*)(G_VALUE_TYPE_NAME(val));
Expand Down
Loading