fix: 逻辑错误

This commit is contained in:
msojocs 2023-08-20 21:46:47 +08:00
parent 5006afee06
commit e510b1ed6e
2 changed files with 26 additions and 12 deletions

View File

@ -30,14 +30,13 @@ namespace WXSS
else else
{ {
v4->Traval(v29.offset_0); 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++) for (int j = 0; j < v29.offset_0->offset_120.size(); j++)
{ {
auto cur = v29.offset_0->offset_120[j]; auto cur = v29.offset_0->offset_120[j];
if (cur->offset_0 == "DIRECTIVE") if (cur->offset_0 == "DIRECTIVE")
{ {
auto v8 = cur->offset_120; auto v8 = cur->offset_120;
v42 = i->first;
if (v8.size() > 1 && v8[0]->offset_0 == "@import") if (v8.size() > 1 && v8[0]->offset_0 == "@import")
{ {
std::string lit = v8[1]->offset_24.GetLiteral(); std::string lit = v8[1]->offset_24.GetLiteral();
@ -454,15 +453,29 @@ namespace WXSS
{ {
if (this->offset_32.count(a2)) if (this->offset_32.count(a2))
{ {
std::vector<std::string> v15; std::deque<std::string> v15;
v15.push_back(a2); v15.push_back(a2);
while (v15.begin() != v15.end()) 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<std::string> & a2, std::string& a3, bool a4, std::string const& a5) int XCompiler::GetCommHead(std::vector<std::string> & a2, std::string& a3, bool a4, std::string const& a5)
{ {

View File

@ -8422,7 +8422,7 @@ int __thiscall WXSS::XCompiler::MarkImported(int this, int a2)
if ( std::map<std::string,zcc::shared_ptr<WXSS::CSSTreeLib::CSSSyntaxTree>>::count((_DWORD *)(this + 32), a2) ) if ( std::map<std::string,zcc::shared_ptr<WXSS::CSSTreeLib::CSSSyntaxTree>>::count((_DWORD *)(this + 32), a2) )
{ {
v15[1] = (void *)8; v15[1] = (void *)8;
v15[0] = operator new(0x20u); v15[0] = operator new(0x20u); // size: 32
v2 = operator new(0x1F8u); v2 = operator new(0x1F8u);
Block = v2; Block = v2;
@ -8438,7 +8438,7 @@ int __thiscall WXSS::XCompiler::MarkImported(int this, int a2)
std::deque<std::string>::push_back(v15, a2); std::deque<std::string>::push_back(v15, a2);
while ( v16 != v20 ) 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) ) if ( v16 == (void **)(v18 - 24) )
{ {
std::string::_M_dispose(v16); std::string::_M_dispose(v16);
@ -8452,25 +8452,26 @@ int __thiscall WXSS::XCompiler::MarkImported(int this, int a2)
else else
{ {
std::string::_M_dispose(v16); std::string::_M_dispose(v16);
v16 += 6; v16 += 6; // 后移24字节
} }
if ( *(_DWORD *)(*(_DWORD *)std::map<std::string,zcc::shared_ptr<WXSS::CSSTreeLib::CSSSyntaxTree>>::operator[]( if ( *(_DWORD *)(*(_DWORD *)std::map<std::string,zcc::shared_ptr<WXSS::CSSTreeLib::CSSSyntaxTree>>::operator[](
lpuexcpt, lpuexcpt, // this->offset_32
(int)v14) (int)v14)
+ 156) + 156)
&& *(_DWORD *)(*(_DWORD *)(*(_DWORD *)std::map<std::string,zcc::shared_ptr<WXSS::CSSTreeLib::CSSSyntaxTree>>::operator[]( && *(_DWORD *)(*(_DWORD *)(*(_DWORD *)std::map<std::string,zcc::shared_ptr<WXSS::CSSTreeLib::CSSSyntaxTree>>::operator[](
lpuexcpt, lpuexcpt, // this->offset_32
(int)v14) (int)v14)
+ 156) + 156)
+ 12) != -1 ) + 12) != -1 )
{ {
v11 = *(_DWORD *)std::map<std::string,zcc::shared_ptr<WXSS::CSSTreeLib::CSSSyntaxTree>>::operator[]( v11 = *(_DWORD *)std::map<std::string,zcc::shared_ptr<WXSS::CSSTreeLib::CSSSyntaxTree>>::operator[](
lpuexcpt, lpuexcpt, // this->offset_32
(int)v14); (int)v14);
v5 = (volatile signed __int32 **)(*(_DWORD *)std::map<std::string,zcc::shared_ptr<WXSS::CSSTreeLib::CSSSyntaxTree>>::operator[]( v5 = (volatile signed __int32 **)(*(_DWORD *)std::map<std::string,zcc::shared_ptr<WXSS::CSSTreeLib::CSSSyntaxTree>>::operator[](
lpuexcpt, lpuexcpt, // this->offset_32
a2) a2)
+ 160); + 160);
// 160 - 1 * 4 = 156
*(v5 - 1) = *(volatile signed __int32 **)(v11 + 156); *(v5 - 1) = *(volatile signed __int32 **)(v11 + 156);
std::__shared_count<(__gnu_cxx::_Lock_policy)2>::operator=(v5, *(volatile signed __int32 **)(v11 + 160)); std::__shared_count<(__gnu_cxx::_Lock_policy)2>::operator=(v5, *(volatile signed __int32 **)(v11 + 160));
} }