feat: support for Windows (using MinGW)

This commit is contained in:
pk5ls20 committed 2024-12-08 05:48:12 +08:00
1 parent b6c9fbc3ae
commit c2af150eef
3 files changed
+18 -5

No files matched your search

+1 -1
View File
@@ -18,7 +18,7 @@ Supported OS:
- [x] MacOS
- [x] Linux
- [x] Android
- [ ] Windows
- [x] Windows
# Small example
```golang
+4 -1
View File
@@ -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
+13 -3
View File
@@ -1,10 +1,20 @@
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>
#include <stdlib.h>
#include <string.h>
static char * get_gvalue_gtype(GValue * val) {
return (char*)(G_VALUE_TYPE_NAME(val));