Closed osm0sis closed 3 years ago
Following from my build instructions in https://github.com/ssut/payload-dumper-go/issues/1#issuecomment-807586352 I was able to hack my Ubuntu mingw-w64 build environment to make a static Win32 build:
apt-get install mingw-w64
# install include and lib from https://packages.msys2.org/package/mingw-w64-i686-xz to /usr/i686-w64-mingw32
GOOS=windows GOARCH=386 CGO_ENABLED=1 CC=i686-w64-mingw32-gcc go build -a -ldflags '-extldflags "-static -s -w"'
That got me the following: payload-dumper-go_1.0.1_windows_386.zip
I'm still working on arm-v5/7.
@ssut the go-xz dependency also being dependent on the toolchain hopefully containing liblzma (which it usually does not) is extremely problematic and frustrating for cross-compiling. ☹️
Got it. NDK gcc wasn't cooperating with go build but, since we're building static, armhf will still work fine on Android:
apt-get install gcc-arm-linux-gnueabihf
# install include and lib from https://launchpad.net/ubuntu/bionic/armhf/liblzma-dev/5.2.2-1.3 to /usr/arm-linux-gnueabihf/
GOOS=linux GOARCH=arm GOARM=7 CGO_ENABLED=1 CC=arm-linux-gnueabihf-gcc go build -a -ldflags '-extldflags "-static -s -w"'
That got me the following: payload-dumper-go_1.0.1_android_arm-v7.zip
Thanks for sharing your work. I have no idea if there is a better way to solve this issue because there were no alternatives to go-xz, I don't remember that well but there were some issues when using https://github.com/ulikunitz/xz for this project.
@osm0sis Any idea how to build (cross compile) for windows/arm64 on Debian?
Probably similar to what I explained above for arm, can't help you beyond that.
Hi, any chance of a Win32 build? Also curious if it's possible to cross-compile this to arm, since on-device is where payload dumper might be most useful!