fix: 逻辑错误

This commit is contained in:
msojocs 2023-08-26 15:31:44 +08:00
parent 72b00f5dff
commit a753d8c3bf
4 changed files with 35 additions and 6 deletions

View File

@ -9,10 +9,12 @@ namespace WXSS
{
namespace CSSTreeLib
{
int off_519A58_i = 0;
// WXSS::CSSTreeLib::MarkHostRule::MarkGood
int off_519A58(std::shared_ptr<WXSS::CSSTreeLib::Rule>& a1, std::shared_ptr<WXSS::CSSTreeLib::CSSSyntaxTree> &a2)
{
off_519A58_i++;
int inner_off_519A58_i = off_519A58_i;
for (auto lt = a2->offset_120.begin(); lt != a2->offset_120.end(); lt++)
{
if ((*lt)->offset_0 == "SELECTORS")
@ -244,7 +246,7 @@ namespace WXSS
int off_519AD0(std::shared_ptr<WXSS::CSSTreeLib::Rule>& a1, std::shared_ptr<WXSS::CSSTreeLib::CSSSyntaxTree> &a2)
{
MarkSelectorRule_i++;
int inner_MarkSelectorRule_i = MarkSelectorRule_i; // TODO: 校对至80
int inner_MarkSelectorRule_i = MarkSelectorRule_i; // 771有问题
// MarkSelectorRule - 0
for (int i = 0; i < a2->offset_120.size(); i++)
{
@ -441,7 +443,7 @@ namespace WXSS
break;
}
// MarkSelectorRule - 20
auto v3 = cur->offset_120[0];
auto v3 = cur->offset_120[1];
std::string lit = v3->offset_24.GetLiteral();
if (v3->offset_0[0] != '$'
|| strcmp(v3->offset_0.data() + 1, "NAME")
@ -487,9 +489,13 @@ namespace WXSS
}
return 0;
}
int off_519B00_i = 0;
// WXSS::CSSTreeLib::RewriteSelectorRule::MarkGood
int off_519B00(std::shared_ptr<WXSS::CSSTreeLib::Rule>& a1, std::shared_ptr<WXSS::CSSTreeLib::CSSSyntaxTree> &a2)
{
off_519B00_i++;
int inner_off_519B00_i = off_519B00_i;
std::string v14;
std::string lit = a2->offset_24.GetLiteral();
if (lit.length())
@ -554,8 +560,15 @@ namespace WXSS
}
// WXSS::CSSTreeLib::AndRules::MarkGood
int off_519B40_i = 0;
int off_519B40(std::shared_ptr<WXSS::CSSTreeLib::Rule>& a1, std::shared_ptr<WXSS::CSSTreeLib::CSSSyntaxTree> &a2)
{
off_519B40_i++;
int inner_off_519B40_i = off_519B40_i;
if (inner_off_519B40_i >= 3611)
{
int a = 0;
}
for (int i=0; i < a1->offset_4_vecPtr.size(); i++)
{
auto cur = a1->offset_4_vecPtr[i];
@ -585,6 +598,10 @@ namespace WXSS
{
off_519B84_i++;
int inner_off_519B84_i = off_519B84_i;
if (inner_off_519B84_i >= 9100)
{
int a = 0;
}
int v8 = 1;
for (int j = 0; j < a2->offset_120.size(); j++)
{
@ -615,6 +632,10 @@ namespace WXSS
{
off_519BB4_i++;
int inner_off_519BB4_i = off_519BB4_i;
if (inner_off_519BB4_i >= 4218)
{
int a = 0;
}
int ret = 0;
for (int i = 0; i < a1->offset_4_vecPtr.size(); i++)
{

View File

@ -70,6 +70,7 @@ namespace WXSS
v9[1].assign(a5);
std::shared_ptr<WXSS::Token> v14(new WXSS::Token());
v14->offset_4.reset(new std::string());
v14->offset_12 = -1;
// Parse - 20
int v75 = 0;

View File

@ -396,10 +396,12 @@ namespace WXSS
{
GetPageCss_i++;
int inner_GetPageCss_i = GetPageCss_i;
// GetPageCss - 0
if (this->offset_0)
{
return 6;
}
// GetPageCss - 5
if (this->offset_32.find(a2) == this->offset_32.end())
{
std::stringstream v38;
@ -411,6 +413,7 @@ namespace WXSS
}
else
{
// GetPageCss - 10
std::string v30;
auto v23 = this->offset_32;

View File

@ -8275,12 +8275,15 @@ int __thiscall WXSS::XCompiler::GetPageCss(char *this, int *a2, _DWORD *a3, int
char v39[4]; // [esp+B8h] [ebp-D0h] BYREF
char v40[204]; // [esp+BCh] [ebp-CCh] BYREF
// GetPageCss - 0
v22 = *(_DWORD *)this;
if ( *(_DWORD *)this )
return 6;
// GetPageCss - 5
v23 = (std::ostream::sentry *)(this + 32);
if ( this + 36 == (char *)std::_Rb_tree<std::string,std::pair<std::string const,zcc::shared_ptr<WXSS::CSSTreeLib::CSSSyntaxTree>>,std::_Select1st<std::pair<std::string const,zcc::shared_ptr<WXSS::CSSTreeLib::CSSSyntaxTree>>>,std::less<std::string>,std::allocator<std::pair<std::string const,zcc::shared_ptr<WXSS::CSSTreeLib::CSSSyntaxTree>>>>::find(
(_DWORD *)this + 8,
if ( this + 36 == (char *)std::_Rb_tree<std::string,std::pair<std::string const,zcc::shared_ptr<WXSS::CSSTreeLib::CSSSyntaxTree>>,std::_Select1st<std::pair<std::string const,zcc::shared_ptr<WXSS::CSSTreeLib::CSSSyntaxTree>>>,std::less<std::string>,std::allocator<std::pair<std::string const,zcc::shared_ptr<WXSS::CSSTreeLib::CSSSyntaxTree>>>>
::find(
(_DWORD *)this + 8, // this->offset_32
(int)a2) )
{
std::basic_stringstream<char,std::char_traits<char>,std::allocator<char>>::basic_stringstream((int)v38);
@ -8300,6 +8303,7 @@ int __thiscall WXSS::XCompiler::GetPageCss(char *this, int *a2, _DWORD *a3, int
}
else
{
// GetPageCss - 10
v30 = (int)&v32; // std::string
v31 = 0;
v32 = 0;
@ -11345,7 +11349,7 @@ int __thiscall WXSS::CSSTreeLib::Parser::Parse(int this, char **a2, int *a3, uns
v109 = v15;
v115 = v18;
std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count(&v115);
*(_DWORD *)(v108 + 12) = -1;
*(_DWORD *)(v108 + 12) = -1; // v14->offset_12
v79 = (char *)operator new(0x18u); // 0x18 -> 24
std::string::basic_string(v79, (int)a3);