From f1da8f68ee091fdfebb4a3728a8ed1b5bf24245d Mon Sep 17 00:00:00 2001 From: xfangfang <2553041586@qq.com> Date: Sun, 26 May 2024 11:06:37 +0800 Subject: [PATCH] Fix pppoe_softc_list --- src/exploit.cpp | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/src/exploit.cpp b/src/exploit.cpp index e8f7eab..63e7cb9 100644 --- a/src/exploit.cpp +++ b/src/exploit.cpp @@ -916,7 +916,7 @@ int Exploit::stage2() { if (option[0] != 1) return false; // type 1 is ICMPv6NDOptSrcLLAddr if (option[1] > 1) { auto *self = (Exploit *) cookie; - self->pppoe_softc_list = *(uint64_t * )(option + 3); + self->pppoe_softc_list = htole64(*(uint64_t * )(option + 3)); return true; // length > 1 } return false; @@ -1100,34 +1100,23 @@ int Exploit::run() { return RETURN_SUCCESS; } -template +template struct Tunnel; -template -struct Tunnel { +template +struct Tunnel { friend T &stopThread(U &u) { return u.*M; } -}; - -template -struct Tunnel<&pcpp::PcapLiveDevice::m_StopThread>; - -std::atomic &stopThread(pcpp::PcapLiveDevice &); - -template -struct Tunnel2; - -template -struct Tunnel2 { - friend T &pcapHandle(U &u) { - return u.*M; + friend Q &pcapHandle(V &u) { + return u.*N; } }; template -struct Tunnel2<&pcpp::IPcapDevice::m_PcapDescriptor>; +struct Tunnel<&pcpp::PcapLiveDevice::m_StopThread, &pcpp::IPcapDevice::m_PcapDescriptor>; +std::atomic &stopThread(pcpp::PcapLiveDevice &); pcap_t *&pcapHandle(pcpp::IPcapDevice &); void Exploit::stop() {