fix: IfHasItsElse

This commit is contained in:
msojocs 2023-07-15 15:28:33 +08:00
parent c264fc0d06
commit 6513e930c9
6 changed files with 29 additions and 19 deletions

View File

@ -92,7 +92,7 @@ namespace WXML
int offset_24 = 0; // ??? int offset_24 = 0; // ???
int offset_40 = 0; // AttrsCompartor用到怎么来不知道 int offset_40 = 0; // AttrsCompartor用到怎么来不知道
// ??? -3, -1 // ??? -3, -1
int offset_56 = 1; int offset_56 = -1;
std::string offset_60 = ""; // ??? std::string offset_60 = ""; // ???
Token(); Token();
Token(std::string &); Token(std::string &);
@ -236,9 +236,9 @@ namespace WXML
private: private:
/* data */ /* data */
public: public:
std::string offset_0; int offset_0 = 0;
int offset_4; int offset_4 = 0;
RVMOpCodePosition(std::string); RVMOpCodePosition(int);
RVMOpCodePosition(/* args */); RVMOpCodePosition(/* args */);
~RVMOpCodePosition(); ~RVMOpCodePosition();
}; };

View File

@ -329,7 +329,8 @@ namespace WXML{
i->second->RewriteTree(); i->second->RewriteTree();
std::string v328 = "ALL"; std::string v328 = "ALL";
auto v51 = componentListMap[v328]; auto v51 = componentListMap[v328];
auto v282 = i->second; std::shared_ptr<WXML::DOMLib::WXMLDom> v282 = i->second;
// 标记如果有后代
v282->MarkIfHasDescendant(v51); v282->MarkIfHasDescendant(v51);
if (isLLA) if (isLLA)
{ {

View File

@ -389,6 +389,7 @@ namespace WXML
this->offset_20 = this->lineLength; this->offset_20 = this->lineLength;
this->offset_16 = this->lineCount; this->offset_16 = this->lineCount;
token.offset_24 = WXML::DOMLib::Machine::STT[v45]; token.offset_24 = WXML::DOMLib::Machine::STT[v45];
token.offset_56 = -1;
if(token.offset_24 == 3) if(token.offset_24 == 3)
{ {
a5.push_back(token); a5.push_back(token);
@ -416,6 +417,7 @@ namespace WXML
v49.offset_20 = this->fileLength - t4; v49.offset_20 = this->fileLength - t4;
int stt = WXML::DOMLib::Machine::STT[v45]; int stt = WXML::DOMLib::Machine::STT[v45];
v49.offset_24 = stt; v49.offset_24 = stt;
v49.offset_56 = -1;
if (stt == 3) if (stt == 3)
{ {
a5.push_back(v49); a5.push_back(v49);

View File

@ -2,12 +2,8 @@
namespace WXML namespace WXML
{ {
namespace DOMLib namespace DOMLib
{ {
/** RVMOpCodePosition::RVMOpCodePosition(int a)
*
*/
RVMOpCodePosition::RVMOpCodePosition(std::string a)
{ {
this->offset_0 = a; this->offset_0 = a;
} }

View File

@ -104,7 +104,7 @@ namespace WXML {
v52 = 0; v52 = 0;
if (v77.size() == 1) if (v77.size() == 1)
{ {
v52 = a8 & v77[0].offset_0 == true; v52 = a8 & (v77[0].offset_0 == true);
} }
} }
a3 << "Z("; a3 << "Z(";
@ -163,13 +163,15 @@ namespace WXML {
WXML::Rewrite::ToStringCode(r, a3); WXML::Rewrite::ToStringCode(r, a3);
a3 << "']"; a3 << "']";
} }
int v68 = a9->offset_0;
int v43 = -1; int v43 = -1;
if (v52) if (v52)
{ {
v43 = a9->offset_4; v43 = a9->offset_4;
} }
WXML::DOMLib::RVMOpCodePosition pos; WXML::DOMLib::RVMOpCodePosition pos;
pos.offset_4 = -1; pos.offset_0 = a9->offset_0;
pos.offset_4 = v43;
v80.push_back({v29, pos}); v80.push_back({v29, pos});
} }
else else
@ -213,6 +215,7 @@ namespace WXML {
a3 << "]"; a3 << "]";
if (a5->offset_56 == -1) if (a5->offset_56 == -1)
a5->offset_56 = a9->offset_0; a5->offset_56 = a9->offset_0;
a9->offset_4 = 0;
a9->offset_0++; a9->offset_0++;
for (auto i = v80.begin(); i != v80.end(); i++) for (auto i = v80.begin(); i != v80.end(); i++)
{ {
@ -1599,9 +1602,6 @@ namespace WXML {
} }
} }
/**
* TODO
*/
bool WXMLDom::IfHasItsElse( bool WXMLDom::IfHasItsElse(
int a2, int a2,
std::vector<std::string> const& a3 std::vector<std::string> const& a3
@ -1623,7 +1623,7 @@ namespace WXML {
{ {
int v11 = a2 - 1; int v11 = a2 - 1;
auto v5 = this->offset_72[a2]; auto v5 = this->offset_72[a2];
if(v5->offset_48.begin() == v5->offset_48.end()) if(v5->offset_72.begin() == v5->offset_72.end())
{ {
for (int i = a2 + 1; i < this->offset_72.size(); i++) for (int i = a2 + 1; i < this->offset_72.size(); i++)
{ {

View File

@ -23979,6 +23979,8 @@ int __cdecl WXML::DOMLib::WXMLDom::DealSingleTokenToOps(
std::string::append(v83, v46); // v28 std::string::append(v83, v46); // v28
v57 = (_DWORD *)a4[2]; v57 = (_DWORD *)a4[2];
v63 = a4 + 1; v63 = a4 + 1;
// find
while ( v57 ) while ( v57 )
{ {
v30 = (unsigned __int8)std::operator<<char>((int)(v57 + 4), (int)v83) == 0; v30 = (unsigned __int8)std::operator<<char>((int)(v57 + 4), (int)v83) == 0;
@ -23993,6 +23995,7 @@ int __cdecl WXML::DOMLib::WXMLDom::DealSingleTokenToOps(
v57 = v32; v57 = v32;
v63 = v31; v63 = v31;
} }
if ( a4 + 1 == v63 || (unsigned __int8)std::operator<<char>((int)v83, (int)(v63 + 4)) ) if ( a4 + 1 == v63 || (unsigned __int8)std::operator<<char>((int)v83, (int)(v63 + 4)) )
{ {
if ( *(_DWORD *)(*(_DWORD *)&v77[1] + 28 * v51) ) if ( *(_DWORD *)(*(_DWORD *)&v77[1] + 28 * v51) )
@ -24145,6 +24148,7 @@ LABEL_107:
if ( v52 ) if ( v52 )
std::operator<<<std::char_traits<char>>(lpuexcptd, "]"); std::operator<<<std::char_traits<char>>(lpuexcptd, "]");
v35 = *a9; v35 = *a9;
// a5->offset_56
if ( a5[14] == -1 ) if ( a5[14] == -1 )
a5[14] = v35; a5[14] = v35;
v67 = 0; v67 = 0;
@ -27380,7 +27384,14 @@ LABEL_12:
v29 = WXML::DOMLib::Machine::STT[v45]; v29 = WXML::DOMLib::Machine::STT[v45];
// v53 -> v49.offset_16 = this->offset_4 修改之前的 // v53 -> v49.offset_16 = this->offset_4 修改之前的
v53 = v23; v53 = v23;
v60 = -1; v60 = -1; // offset_56
/*
v49 offset_0
v50
v60 offset_56
*/
// v55 -> v49.offset_24 // v55 -> v49.offset_24
v55 = v29; v55 = v29;
if ( v29 == 3 ) if ( v29 == 3 )
@ -53070,7 +53081,7 @@ char __thiscall WXML::DOMLib::WXMLDom::IfHasItsElse(_DWORD *this, signed int a2,
std::string::_M_dispose(v23); std::string::_M_dispose(v23);
if ( !v18 ) if ( !v18 )
break; break;
v12 = a3[1]; // a3.offset_4 v12 = a3[1]; // a3.end()
if ( v12 != std::find<__gnu_cxx::__normal_iterator<std::string const*,std::vector<std::string>>,std::string>( if ( v12 != std::find<__gnu_cxx::__normal_iterator<std::string const*,std::vector<std::string>>,std::string>(
*a3, // start *a3, // start
v12, // end v12, // end