fix: 逻辑错误

This commit is contained in:
msojocs 2023-08-25 20:16:02 +08:00
parent e8ddf7d6c9
commit 8ccd5799a8
6 changed files with 21 additions and 9 deletions

View File

@ -15,8 +15,11 @@ namespace WXSS
{ {
} }
int RenderCode_i = 0;
void CSSSyntaxTree::RenderCode(std::string & a2, bool a3) void CSSSyntaxTree::RenderCode(std::string & a2, bool a3)
{ {
RenderCode_i++;
int inner_RenderCode_i = RenderCode_i; // 10296
if (this->offset_116) if (this->offset_116)
{ {
if (!this->offset_172) if (!this->offset_172)

View File

@ -15,15 +15,15 @@ namespace WXSS
{ {
for (auto lt = a2->offset_120.begin(); lt != a2->offset_120.end(); lt++) for (auto lt = a2->offset_120.begin(); lt != a2->offset_120.end(); lt++)
{ {
if (lt->get()->offset_0 == "SELECTORS") if ((*lt)->offset_0 == "SELECTORS")
{ {
auto v2 = lt->get()->offset_120; auto v2 = (*lt)->offset_120;
if (v2.size() == 1) if (v2.size() == 1)
{ {
auto v3 = v2.front().get(); auto v3 = v2[0];
if (v3->offset_0 == "F_SELECTOR") if (v3->offset_0 == "F_SELECTOR")
{ {
auto v4 = v2.front()->offset_120; auto v4 = v2[0]->offset_120;
if (v4.size() > 1) if (v4.size() > 1)
{ {
auto v12 = v4[1]; auto v12 = v4[1];
@ -35,7 +35,7 @@ namespace WXSS
a2->offset_172 = 1; a2->offset_172 = 1;
if (v4.size() == 5) if (v4.size() == 5)
{ {
auto lb = v4[3].get(); auto lb = v4[3];
if (lb->offset_0 == "SELECTOR") if (lb->offset_0 == "SELECTOR")
{ {
auto v13 = lb->offset_120; auto v13 = lb->offset_120;
@ -119,6 +119,7 @@ namespace WXSS
*v24 = v26.str(); *v24 = v26.str();
v18->offset_24.offset_4 = v24; v18->offset_24.offset_4 = v24;
v18->offset_24.offset_0 = 3;
v18->offset_164 = v9 + 1; v18->offset_164 = v9 + 1;
v18->offset_168 = v9 + 2; v18->offset_168 = v9 + 2;
@ -426,7 +427,7 @@ namespace WXSS
v14.push_back(ch); v14.push_back(ch);
} }
} }
if (a2->offset_24.offset_16 != lit.length()) if (a2->offset_24.offset_16 != v14.length())
{ {
std::shared_ptr<std::string> str(new std::string()); std::shared_ptr<std::string> str(new std::string());
*str = v14; *str = v14;
@ -530,8 +531,11 @@ namespace WXSS
* 00519BB4 - WXSS::CSSTreeLib::RuleChain::MarkGood * 00519BB4 - WXSS::CSSTreeLib::RuleChain::MarkGood
* *
*/ */
int off_519BB4_i = 0;
int off_519BB4(std::shared_ptr<WXSS::CSSTreeLib::Rule>& a1, std::shared_ptr<WXSS::CSSTreeLib::CSSSyntaxTree> &a2) int off_519BB4(std::shared_ptr<WXSS::CSSTreeLib::Rule>& a1, std::shared_ptr<WXSS::CSSTreeLib::CSSSyntaxTree> &a2)
{ {
off_519BB4_i++;
int inner_off_519BB4_i = off_519BB4_i;
int ret = 0; int ret = 0;
for (int i = 0; i < a1->offset_4_vecPtr.size(); i++) for (int i = 0; i < a1->offset_4_vecPtr.size(); i++)
{ {

View File

@ -5,6 +5,7 @@ namespace WXSS
Token::Token(/* args */) Token::Token(/* args */)
{ {
this->offset_28[0] = '\0';
} }
Token::~Token() Token::~Token()

View File

@ -408,7 +408,7 @@ namespace WXSS
} }
sa++; sa++;
} }
int v38 = ((lt & 0x20000) == 0) + v47 - 1; v38 = ((lt & 0x20000) == 0) + v47 - 1;
for (char j = this->offset_0[v43]; sa < v38; j = this->offset_0[v38]) for (char j = this->offset_0[v43]; sa < v38; j = this->offset_0[v38])
{ {
int v21 = j - 10; int v21 = j - 10;
@ -421,8 +421,10 @@ namespace WXSS
} }
v58.offset_12 = sa; v58.offset_12 = sa;
int v39 = v38 - sa + 1; int v39 = v38 - sa + 1;
v58.offset_16 = v39;
std::string str = this->offset_0.substr(sa, v39); std::string str = this->offset_0.substr(sa, v39);
v58.offset_4 = std::make_shared<std::string>(str); v58.offset_4 = std::make_shared<std::string>(str);
} }
if (v58.offset_0 != 1) if (v58.offset_0 != 1)
{ {

View File

@ -516,6 +516,7 @@ namespace WXSS
std::string v33; std::string v33;
auto v29 = k->second; auto v29 = k->second;
this->GenExpr(v29, v37, v33); this->GenExpr(v29, v37, v33);
//
if (v33.length()) if (v33.length())
{ {
this->DealRPX(v33, v37); this->DealRPX(v33, v37);

View File

@ -44689,7 +44689,7 @@ char __stdcall WXSS::CSSTreeLib::MarkHostRule::MarkGood(
std::__shared_ptr<WXSS::CSSTreeLib::CSSSyntaxTree,(__gnu_cxx::_Lock_policy)2>::__shared_ptr(&v18[1], v11); std::__shared_ptr<WXSS::CSSTreeLib::CSSSyntaxTree,(__gnu_cxx::_Lock_policy)2>::__shared_ptr(&v18[1], v11);
v4 = *(struct _Unwind_Exception **)(*(_DWORD *)&v18[1] + 120); v4 = *(struct _Unwind_Exception **)(*(_DWORD *)&v18[1] + 120);
lpuexcpta = v4; lpuexcpta = v4;
v10 = *(_DWORD *)(*(_DWORD *)&v18[1] + 124) - (_DWORD)v4; v10 = *(_DWORD *)(*(_DWORD *)&v18[1] + 124) - (_DWORD)v4; // size
if ( v10 > 8 ) if ( v10 > 8 )
{ {
v12 = *((_DWORD *)v4 + 2); v12 = *((_DWORD *)v4 + 2);
@ -46240,7 +46240,7 @@ char __stdcall WXSS::CSSTreeLib::RewriteSelectorRule::MarkGood(
std::string::basic_string(&v17, Literal, (int)&v20); std::string::basic_string(&v17, Literal, (int)&v20);
while ( (unsigned int)lpuexcpt < v18 ) while ( (unsigned int)lpuexcpt < v18 )
{ {
if ( *((_BYTE *)lpuexcpt + (_DWORD)v17) == 46 if ( *((_BYTE *)lpuexcpt + (_DWORD)v17) == '.'/*46*/
&& (unsigned int)lpuexcpt + 1 < v18 && (unsigned int)lpuexcpt + 1 < v18
&& (unsigned int)(*((char *)lpuexcpt + (_DWORD)v17 + 1) - 48) > 9 ) && (unsigned int)(*((char *)lpuexcpt + (_DWORD)v17 + 1) - 48) > 9 )
{ {
@ -46252,6 +46252,7 @@ char __stdcall WXSS::CSSTreeLib::RewriteSelectorRule::MarkGood(
} }
lpuexcpt = (struct _Unwind_Exception *)((char *)lpuexcpt + 1); lpuexcpt = (struct _Unwind_Exception *)((char *)lpuexcpt + 1);
} }
// v15 -> v14.length()
if ( *((_DWORD *)this + 10) != v15 ) if ( *((_DWORD *)this + 10) != v15 )
{ {
Block = (char *)operator new(0x18u); Block = (char *)operator new(0x18u);