From e510b1ed6ed4f3d13e424195f66eb1092e4afb14 Mon Sep 17 00:00:00 2001 From: msojocs Date: Sun, 20 Aug 2023 21:46:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=80=BB=E8=BE=91=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/wxss/x_compiler.cpp | 23 ++++++++++++++++++----- test/wcsc.disassembly.cpp | 15 ++++++++------- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/src/wxss/x_compiler.cpp b/src/wxss/x_compiler.cpp index b698c03..680a0b6 100644 --- a/src/wxss/x_compiler.cpp +++ b/src/wxss/x_compiler.cpp @@ -30,14 +30,13 @@ namespace WXSS else { v4->Traval(v29.offset_0); - std::string v42; + std::string v42 = i->first; for (int j = 0; j < v29.offset_0->offset_120.size(); j++) { auto cur = v29.offset_0->offset_120[j]; if (cur->offset_0 == "DIRECTIVE") { auto v8 = cur->offset_120; - v42 = i->first; if (v8.size() > 1 && v8[0]->offset_0 == "@import") { std::string lit = v8[1]->offset_24.GetLiteral(); @@ -454,15 +453,29 @@ namespace WXSS { if (this->offset_32.count(a2)) { - std::vector v15; + std::deque v15; v15.push_back(a2); while (v15.begin() != v15.end()) { - throw "not implement"; + std::string v14 = v15.front(); + v15.pop_front(); + + if (this->offset_32[v14]->offset_156.get() && this->offset_32[v14]->offset_156->offset_12 != -1) + { + auto v11 = this->offset_32[v14]; + auto v5 = this->offset_32[a2]; + v5->offset_156 = v11->offset_156; + } + this->offset_128[v14]++; + for (int i = 0; i < this->offset_56[v14].size(); i++) + { + v15.push_back(this->offset_56[v14][i]); + } + } } - throw "not implement"; + return 0; } int XCompiler::GetCommHead(std::vector & a2, std::string& a3, bool a4, std::string const& a5) { diff --git a/test/wcsc.disassembly.cpp b/test/wcsc.disassembly.cpp index c66ee9f..22e30e3 100644 --- a/test/wcsc.disassembly.cpp +++ b/test/wcsc.disassembly.cpp @@ -8422,7 +8422,7 @@ int __thiscall WXSS::XCompiler::MarkImported(int this, int a2) if ( std::map>::count((_DWORD *)(this + 32), a2) ) { v15[1] = (void *)8; - v15[0] = operator new(0x20u); + v15[0] = operator new(0x20u); // size: 32 v2 = operator new(0x1F8u); Block = v2; @@ -8438,7 +8438,7 @@ int __thiscall WXSS::XCompiler::MarkImported(int this, int a2) std::deque::push_back(v15, a2); while ( v16 != v20 ) { - std::string::basic_string((char *)v14, (int)v16); + std::string::basic_string((char *)v14, (int)v16); // front if ( v16 == (void **)(v18 - 24) ) { std::string::_M_dispose(v16); @@ -8452,25 +8452,26 @@ int __thiscall WXSS::XCompiler::MarkImported(int this, int a2) else { std::string::_M_dispose(v16); - v16 += 6; + v16 += 6; // 后移24字节 } if ( *(_DWORD *)(*(_DWORD *)std::map>::operator[]( - lpuexcpt, + lpuexcpt, // this->offset_32 (int)v14) + 156) && *(_DWORD *)(*(_DWORD *)(*(_DWORD *)std::map>::operator[]( - lpuexcpt, + lpuexcpt, // this->offset_32 (int)v14) + 156) + 12) != -1 ) { v11 = *(_DWORD *)std::map>::operator[]( - lpuexcpt, + lpuexcpt, // this->offset_32 (int)v14); v5 = (volatile signed __int32 **)(*(_DWORD *)std::map>::operator[]( - lpuexcpt, + lpuexcpt, // this->offset_32 a2) + 160); + // 160 - 1 * 4 = 156 *(v5 - 1) = *(volatile signed __int32 **)(v11 + 156); std::__shared_count<(__gnu_cxx::_Lock_policy)2>::operator=(v5, *(volatile signed __int32 **)(v11 + 160)); }