-
Notifications
You must be signed in to change notification settings - Fork 45
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
Trouble compiling natively in windows using msys2 (64 bit) mingw64 - (Solved!) #35
Comments
I have said it many times in many issues:Please refer to: https://github.com/xfangfang/PPPwn_cpp/blob/main/.github/workflows/ci.yaml
if you just want a safe build, the nightly-build is build by the workflow under GitHub Actions you can check every step in the build process. |
When I thought I had succeeded, by running the command cmake --build build -t pppwn I got this error `C:\Users\PCgames\Desktop\PPPwn_cpp-main>cmake --build build -t pppwn Common++.vcxproj -> C:\Users\PCgames\Desktop\PPPwn_cpp-main\build_deps\pcapplusplus-build\Common++\Debug\Common++.li |
Thank you for the quick and helpful response! Thanks to you i got it working, and i was able to build stage1 of pppwn using zig as well - however stage2 is still bombing with a linker error. I used the stage1 and the compiled pppwn_cpp to successfully jailbreak a ps4 pro 7215B on 10.50 on the first try.
Clang64 exhibited the exact same problems detailed above. When compiled with the pre-built libpcap package, the interface list is always empty, and when built with the libpcap compiled from source it gives the errors. Neither work. UCRT64 (when configured properly/standard) uses msvc, so that wouldn't work, right? In any case, libpcap simply doesn't function when used - although everything compiles successfully with no errors/warnings. Interestingly, the libraries are always external (.dlls) when using libpcap, and statically in the executable as expected when winpcap is used (which was the magic bullet for me) I finally got the working copy built in MINGW64 (using gcc as the compiler). As far as I am aware, msvcrt is not involved.
This was the key for me. Thank you. The command i used that finally built the working copy was
However, it required uninstalling llbpcap entirely in order to work (which doesn't seem right). When libpcap is installed - it is used even when the -DPCAP_ROOT is specified as above, and -DUSE_SYSTEM_PCAP=OFF just causes linking to bomb (although it seems to build pcap from source, it seems the libraries are not passed to the linker properly). Thanks again! Now if i can just figure out why stage2 compilation is bombing on linking (with zig), everything can be done natively in windows. |
@jack4455667788 https://www.msys2.org/docs/environments/ mingw64: msvcrt |
Thanks for clearing that up for me! However, as i said - building in ucrt or clang with libpcap (either precompiled or compiled from source) succeeded the same way as in mingw64 and all behaved identically (i.e. did not function). If there is a way to build a functioning copy using libpcap natively in windows - i couldn't figure it out regardless of the compiling environment of msys2 i tried. |
I did not build in visual studio, nor use msvc as the compiler (which I assume you are) but this suggests that "Wno-macro-redefined" is not a valid argument to your compiler. Find it and try commenting it out (it's line 82 in the cmakelists.txt - but there is a second flag included there as well which you may not want to remove.). It may not work, or it may generate an output that doesn't work - but give it a whirl (or try using a compiler which does understand that flag, like clang or gcc) |
I followed your advice and decided to use msys2 + gcc |
alleluia!!
|
Congrats! Out of curiosity, and because it could possibly help others with the same issue, what did you do to solve the issue you encountered?
It's a command line tool, it has no gui (there are gui's available for it you could find/build). It is meant to be run from the command line (cmd or in msys2 will work). The command line This video shows how to set up the gui and use what you've built https://www.youtube.com/watch?v=GFuWbmJPbok (you'll just need to swap in your copy of pppwn.exe if you choose to download the loader gui the way he shows in the video). |
Problem solved. |
My pleasure. It is good to help when we can!
It isn't my project, but I also share your gratitude towards @xfangfang (and of course @TheOfficialFloW)! |
I have encountered all sorts of issues, and although i have finally gotten the darn thing to build successfully - it isn't functional. I'm hoping someone can give me some direction on what I'm doing wrong, or share what they did to successfully compile natively in windows.
Issues Encountered:
[ERROR: /build/_deps/pcapplusplus-src/Pcap++/src/PcapLiveDevice.cpp: setDeviceMacAddress:774] Error in retrieving MAC address: Adapter is NULL
[ERROR: /build/_deps/pcapplusplus-src/Pcap++/src/PcapLiveDevice.cpp: setDeviceMtu:713] Error in retrieving MTU: Adapter is NULL
[ERROR: /build/_deps/pcapplusplus-src/Pcap++/src/PcapLiveDevice.cpp: setDeviceMacAddress:774] Error in retrieving MAC address: Adapter is NULL
dbus-system D-Bus system bus
dbus-session D-Bus session bus"
I am at a loss as to how to proceed (specifically with issue #2 above). Any direction/tips/input would be greatly appreciated!
Bonus - Would zig be a good tool to compile the pppwn payloads in windows? Any direction on making this work?
Thanks in any case.
Output of cmake command above, showing I am using gnu cc and c++ - possibly useful in debugging?
$ cmake -B build -DPacket_ROOT=../npcap-sdk-1.13
-- Building for: Ninja
-- The C compiler identification is GNU 13.2.0
-- The CXX compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/msys64/mingw64/bin/cc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/msys64/mingw64/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PCAP: C:/msys64/mingw64/lib/libpcap.dll.a
-- Performing Test PCAP_LINKS_SOLO
-- Performing Test PCAP_LINKS_SOLO - Success
-- Looking for pcap_set_immediate_mode
-- Looking for pcap_set_immediate_mode - found
-- Looking for pcap_setdirection
-- Looking for pcap_setdirection - found
-- Found Packet: C:/msys64/usr/src/npcap-sdk-1.13/Lib/x64/Packet.lib
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
CMake Deprecation Warning at build/_deps/pcapplusplus-src/3rdParty/MemPlumber/MemPlumber/CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument value or use a ... suffix to tell
CMake that the project does not need compatibility with older versions.
-- Looking for backtrace
-- Looking for backtrace - not found
-- Could NOT find Backtrace (missing: Backtrace_LIBRARY Backtrace_INCLUDE_DIR)
-- Backtrace not found or not supported!
-- Configuring done (16.4s)
-- Generating done (0.1s)
-- Build files have been written to: C:/msys64/usr/src/PPPwn_cpp/build
The text was updated successfully, but these errors were encountered: