Closed jack4455667788 closed 1 month ago
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 Versione di MSBuild L17.9.8+b34f75857 per .NET Framework
Common++.vcxproj -> C:\Users\PCgames\Desktop\PPPwn_cpp-main\build_deps\pcapplusplus-build\Common++\Debug\Common++.li b hash-library.vcxproj -> C:\Users\PCgames\Desktop\PPPwn_cpp-main\build_deps\pcapplusplus-build\3rdParty\hash-library\ hash-library.dir\Debug\hash-library.lib Packet++.vcxproj -> C:\Users\PCgames\Desktop\PPPwn_cpp-main\build_deps\pcapplusplus-build\Packet++\Debug\Packet++.li b light_pcapng.vcxproj -> C:\Users\PCgames\Desktop\PPPwn_cpp-main\build_deps\pcapplusplus-build\3rdParty\LightPcapNg\l ight_pcapng.dir\Debug\light_pcapng.lib cl : error della riga di comando D8021 : argomento numerico '/Wno-macro-redefined' non valido C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): e rror MSB6006: "CL.exe" terminato con il codice 2. [C:\Users\PCgames\Desktop\PPPwncpp-main\build_deps\pcap-build\pcap static.vcxproj]`
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.
- libpcap doesn't support msvcrt (MINGW32/64), you can use CLANG32/CLANG64/UCRT64 instead
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.
- or you can use the wpcap.dll provided by npcap: -DPCAP_ROOT="sdk-path" (not -DPcaket_ROOT=...)
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 ucrt64/clang64: ucrt
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.
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 Versione di MSBuild L17.9.8+b34f75857 per .NET Framework
Common++.vcxproj -> C:\Users\PCgames\Desktop\PPPwn_cpp-main\build_deps\pcapplusplus-build\Common++\Debug\Common++.li b hash-library.vcxproj -> C:\Users\PCgames\Desktop\PPPwn_cpp-main\build_deps\pcapplusplus-build\3rdParty\hash-library hash-library.dir\Debug\hash-library.lib Packet++.vcxproj -> C:\Users\PCgames\Desktop\PPPwn_cpp-main\build_deps\pcapplusplus-build\Packet++\Debug\Packet++.li b light_pcapng.vcxproj -> C:\Users\PCgames\Desktop\PPPwn_cpp-main\build_deps\pcapplusplus-build\3rdParty\LightPcapNg\l ight_pcapng.dir\Debug\light_pcapng.lib cl : error della riga di comando D8021 : argomento numerico '/Wno-macro-redefined' non valido C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): e rror MSB6006: "CL.exe" terminato con il codice 2. [C:\Users\PCgames\Desktop\PPPwn_cpp-main\builddeps\pcap-build\pcap static.vcxproj]`
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)
Quando pensavo di esserci riuscito, eseguendo il comando cmake --build build -t pppwn ho ricevuto questo errore
C:\Users\PCgames\Desktop\PPPwn_cpp-main>cmake --build build -t pppwn Versione di MSBuild L17.9.8+b34f75857 per .NET Framework Common++.vcxproj -> C:\Users\PCgames\Desktop\PPPwn_cpp-main\build_deps\pcapplusplus-build\Common++\Debug\Common++.li b hash-library.vcxproj -> C:\Users\PCgames\Desktop\PPPwn_cpp- main\build_deps\pcapplusplus-build\3rdParty\hash-library hash-library.dir\Debug\hash-library.lib Packet++.vcxproj -> C:\Users\PCgames\Desktop\PPPwn_cpp-main\build_deps\pcapplusplus-build\ Packet++\Debug\Packet++.li b light_pcapng.vcxproj -> C:\Users\PCgames\Desktop\PPPwn_cpp-main\build_deps\pcapplusplus-build\3rdParty\LightPcapNg\l ight_pcapng.dir\Debug\light_pcapng.lib cl : errore della riga di comando D8021 : argomento numerico '/Wno-macro-refine' non valido C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): e rror MSB6006: "CL.exe" terminato con il codice 2. [C:\Users\PCgames\Desktop\PPPwn_cpp-main\build_deps\pcap-build\pcap_ static.vcxproj]
Non ho creato in Visual Studio, né ho utilizzato msvc come compilatore (cosa che presumo tu sia) ma questo suggerisce che "Wno-macro-refined" non è un argomento valido per il tuo compilatore. Trovalo e prova a commentarlo (è la riga 82 nel cmakelists.txt - ma lì è incluso anche un secondo flag che potresti non voler rimuovere). Potrebbe non funzionare, o potrebbe generare un output che non funziona, ma provalo (o prova a utilizzare un compilatore che comprenda quel flag, come clang o gcc)
I followed your advice and decided to use msys2 + gcc Although the first part was successfully resolved, this is what happens next:
alleluia!! I finally succeeded. now inside the build folder the file pppwn.exe has been created, if I launch it I see a window that opens and immediately closes. I don't quite understand how to use this, could you tell me the correct use?
# cmake --build build -t pppwn [16/100] Building CXX object _deps/pcapplusplus-.../CMakeFiles/Packet++.dir/src/DnsResource.cpp.obj In member function 'uint8_t* pcpp::IDnsResource::getRawData() const', inlined from 'pcpp::IDnsResource::IDnsResource(pcpp::DnsLayer*, size_t)' at C:/Users/PCgames/Des ktop/PPPwn_cpp-main/build/_deps/pcapplusplus-src/Packet++/src/DnsResource.cpp:16:51: C:/Users/PCgames/Desktop/PPPwn_cpp-main/build/_deps/pcapplusplus-src/Packet++/src/DnsResource.cpp:29 :24: warning: '*this.pcpp::IDnsResource::m_ExternalRawData' may be used uninitialized [-Wmaybe-unini tialized] 29 | return m_ExternalRawData; | ^~~~~~~~~~~~~~~~~ [100/100] Linking CXX executable pppwn.exe
alleluia!! I finally succeeded.
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?
if I launch it I see a window that opens and immediately closes. I don't quite understand how to use this, could you tell me the correct use?
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 pppwn.exe --help
will explain the syntax if you want to use it directly. The one snag is that when you use pppwn.exe list
to print out the interface name for your ethernet, for example \Device\NPF_{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} Ethernet Controller Name
, that name will need to be passed to pppwn in quotes and only include the text before the first " " character. In the example above, the correct format would be pppwn.exe --interface "\Device\NPF_{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}"
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).
alleluia!! Alla fine ci sono riuscito.
Congratulazioni! Per curiosità e poiché potrebbe aiutare altri con lo stesso problema, cosa hai fatto per risolvere il problema riscontrato?
se lo lancio vedo una finestra che si apre e si chiude subito. Non ho ben capito come si usa, sapreste dirmi l'uso corretto?
È uno strumento da riga di comando, non ha GUI (ci sono GUI disponibili che potresti trovare/costruire). È pensato per essere eseguito dalla riga di comando (funzionerà cmd o in msys2). La riga di comando
pppwn.exe --help
spiegherà la sintassi se desideri utilizzarla direttamente. L'unico problema è che quando usipppwn.exe list
per stampare il nome dell'interfaccia per la tua Ethernet, ad esempio\Device\NPF_{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} Ethernet Controller Name
, quel nome dovrà essere passato a pppwn tra virgolette e includere solo il testo prima del primo carattere " ". Nell'esempio sopra, il formato corretto sarebbepppwn.exe --interface "\Device\NPF_{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}"
Questo video mostra come impostare la GUI e utilizzare ciò che hai creato https://www.youtube.com/watch?v=GFuWbmJPbok (dovrai solo scambiare la tua copia di pppwn.exe se lo desideri scarica la GUI del caricatore come mostra nel video).
Problem solved.
Thank you so much for your support but above all for sharing your project with us.
How did I solve my problem?
The problem I encountered seemed to be related to the failure to declare asprintf in the header files included by pcap-npf.c. Asprintf is a standard C99 function, but may not be available on all platforms or compilers.
For my MinGW64 environment, asprintf was apparently not available by default. However, I thought I could include support for GNU extensions by installing libiberty, which includes this feature.
Searching the pacman repository I find that this function was not available for msys2.
I solved it with the alternative package mingw-w64-x86_64-binutils, it provides the binary tools needed for compiling with MinGW-w64, including asprintf and libiberty. Thanks to this I was able to solve the asprintf failure to declare problem that I was encountering.
I started compiling the project again (native build):
cmake -B build -DPacket_ROOT=
Thank you so much for your support
My pleasure. It is good to help when we can!
but above all for sharing your project with us
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:
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