diff --git a/README.md b/README.md index 17d0c24..f80e22c 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Supported OS: - [x] MacOS - [x] Linux - [x] Android -- [ ] Windows +- [x] Windows # Small example ```golang diff --git a/frida/frida.go b/frida/frida.go index d94d72f..5a181ff 100644 --- a/frida/frida.go +++ b/frida/frida.go @@ -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 diff --git a/frida/unmarshaller.go b/frida/unmarshaller.go index c4c30ac..6aaead3 100644 --- a/frida/unmarshaller.go +++ b/frida/unmarshaller.go @@ -1,10 +1,20 @@ package frida /* +#ifdef _WIN32 + #include + #include + #pragma comment(lib, "Ws2_32.lib") + typedef unsigned short in_port_t; +#else + #include + #include + #include +#endif + #include -#include -#include -#include +#include +#include static char * get_gvalue_gtype(GValue * val) { return (char*)(G_VALUE_TYPE_NAME(val));