diff --git a/src/wxml/dom_lib/wxml_dom.cpp b/src/wxml/dom_lib/wxml_dom.cpp index 3d05626..3afd9c8 100644 --- a/src/wxml/dom_lib/wxml_dom.cpp +++ b/src/wxml/dom_lib/wxml_dom.cpp @@ -728,7 +728,7 @@ namespace WXML { { if ( cur->offset_0 == "wx-repeat" - && cur->offset_0 == "wx-template" + || cur->offset_0 == "wx-template" ) { std::string v155; diff --git a/src/wxml/expr_lib/parser.cpp b/src/wxml/expr_lib/parser.cpp index df530a9..1c6b3a7 100644 --- a/src/wxml/expr_lib/parser.cpp +++ b/src/wxml/expr_lib/parser.cpp @@ -55,7 +55,7 @@ namespace WXML // tokenList是空的 if (v74.begin() == v74.end()) { - std::shared_ptr v8; + std::shared_ptr v8(new WXML::EXPRLib::ExprSyntaxTree()); this->offset_80 = v8; return 0; } @@ -69,6 +69,7 @@ namespace WXML std::shared_ptr v68(new WXML::EXPRLib::Base()); v68->offset_0 = off_55F220; v68->offset_4_str = "$"; + v68->offset_32 = 0; this->offset_0.push_back(v68); std::shared_ptr v70(new WXML::EXPRLib::Base()); v70->offset_0 = off_55F1E4; @@ -103,7 +104,7 @@ namespace WXML } ++v49; this->offset_0.pop_back(); - if (v84.offset_0 - 1 <= 3) + if ((uint32_t)v84.offset_0 - 1 <= 3) { std::shared_ptr v80(new WXML::EXPRLib::ExprSyntaxTree()); @@ -141,7 +142,7 @@ namespace WXML return 1002; } auto v21 = this->offset_40.back(); - this->offset_40.push_back(v78); + v21->offset_52.push_back(v78); } /////////////////////// @@ -167,13 +168,20 @@ namespace WXML { if (v78->offset_52.begin() != v78->offset_52.end()) { - auto v51 = v78->offset_52.begin(); - for (auto i = v78->offset_52.rbegin(); i < v78->offset_52.rend(); i++) + // auto v51 = v78->offset_52.begin(); + // for (auto i = v78->offset_52.rbegin(); i > v51; i++) + // { + // auto v80 = *v51; + // *v51 = *i; + // *i = v80; + // v51++; + // } + int len = v78->offset_52.size(); + for (int i = 0; i < len / 2; i++) { - auto v80 = *v51; - *v51 = *i; - *i = v80; - v51++; + auto v80 = v78->offset_52[i]; + v78->offset_52[i] = v78->offset_52[len - 1 - i]; + v78->offset_52[len - 1 - i] = v80; } } diff --git a/src/wxml/expr_lib/token.cpp b/src/wxml/expr_lib/token.cpp index 047bd6d..a6f368d 100644 --- a/src/wxml/expr_lib/token.cpp +++ b/src/wxml/expr_lib/token.cpp @@ -18,7 +18,7 @@ namespace WXML switch ( this->offset_0 ) { case 0u: - result = this->offset_4.data(); + result = this->offset_4; break; case 1u: result = "$DECIMAL"; diff --git a/test/wcc.disassembly.cpp b/test/wcc.disassembly.cpp index 5b0acac..472db3e 100644 --- a/test/wcc.disassembly.cpp +++ b/test/wcc.disassembly.cpp @@ -28984,6 +28984,7 @@ int __thiscall WXML::EXPRLib::Parser::Parse(int this, char **a2, int a3, int a4, } v21 = (int *)std::deque>::back((_DWORD *)(this + 40)); std::__shared_ptr::__shared_ptr((int *)&v80, v21); + // v80.offset_52 std::vector>::push_back(v80 + 13, (int *)&v78); std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count(v81); } @@ -29017,7 +29018,7 @@ int __thiscall WXML::EXPRLib::Parser::Parse(int this, char **a2, int a3, int a4, goto LABEL_72; // 销毁数据,return Tokens } v23 = (int *)std::deque>::back((_DWORD *)(this + 40)); - // v78.offset_52 + // v78.offset_52.push_back(v23) std::vector>::push_back(v78 + 13, v23); std::deque>::pop_back((_DWORD *)(this + 40)); } @@ -29027,13 +29028,14 @@ int __thiscall WXML::EXPRLib::Parser::Parse(int this, char **a2, int a3, int a4, v24 = v78[14]; if ( v78[13] != v24 ) { + // v78->offset_52 v51 = v78[13]; // WXML::EXPRLib::ExprSyntaxTree for ( Blockd = (volatile signed __int32 **)(v24 - 2); Blockd > (volatile signed __int32 **)v51; Blockd -= 2 ) { std::__shared_ptr::__shared_ptr( (int *)&v80, v51); - *v51 = (int)*Blockd; // cur + *v51 = (int)*Blockd; std::__shared_count<(__gnu_cxx::_Lock_policy)2>::operator=( (volatile signed __int32 **)v51 + 1, (int)Blockd[1]); @@ -29048,7 +29050,7 @@ int __thiscall WXML::EXPRLib::Parser::Parse(int this, char **a2, int a3, int a4, std::deque>::push_back(this + 40, (int *)&v78); } v19 = v79; - goto LABEL_37; + goto LABEL_37; // 销毁v19 } // WXML::EXPRLib::Parser::Parse - 20-3 if ( (*(int (__fastcall **)(_DWORD *))(*v72 + 8))(v72) == 2 )