From fc4f2347f2088747ccbfbe2645b0a75d713cde94 Mon Sep 17 00:00:00 2001 From: msojocs Date: Sat, 8 Jul 2023 22:33:59 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 4 +- src/include/wxml.h | 54 +++-- src/utils/file.cpp | 9 +- src/wxml/compiler.cpp | 2 + src/wxml/dom_lib/parser.cpp | 2 +- src/wxml/dom_lib/wxml_dom.cpp | 242 ++++++++++++++++++++-- src/wxml/expr_lib/common.cpp | 30 +++ src/wxml/expr_lib/expr_syntax_tree.cpp | 148 +++++++++++++ src/wxml/expr_lib/token.cpp | 23 ++- test/wcc.disassembly.cpp | 274 ++++++++++++++++--------- 10 files changed, 652 insertions(+), 136 deletions(-) create mode 100644 src/wxml/expr_lib/common.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 2e4a6b5..604990f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,8 +30,10 @@ add_executable(wcc src/night/ns_stream.cpp src/night/ns_token.cpp src/night/ns_god/ns_god.cpp - src/wxml/expr_lib/parser.cpp + src/wxml/expr_lib/common.cpp src/wxml/expr_lib/expr_syntax_tree.cpp + src/wxml/expr_lib/parser.cpp + src/wxml/expr_lib/token.cpp src/wxml/compiler.cpp src/wxml/dom_lib/str_cache.cpp src/wxml/dom_lib/wxml_dom.cpp diff --git a/src/include/wxml.h b/src/include/wxml.h index 4d36244..6cddafb 100644 --- a/src/include/wxml.h +++ b/src/include/wxml.h @@ -259,7 +259,6 @@ namespace WXML /* 偏移应该不超过0x128u, 296 */ - bool offset_28 = 0; // std::string offset_52; int offset_92 = 0; // pos1 int offset_96 = 0; // pos2 @@ -344,6 +343,7 @@ namespace WXML std::vector const& a3 ); void RecordAllPath(void); + void RewriteTree(void); void Print(int,char const*, std::stringstream *); void PrintMe(int,char const*, std::stringstream *); bool operator==(std::string tag); @@ -520,6 +520,8 @@ namespace WXML namespace EXPRLib { + void OutputAsStringOrKeyWord(std::stringstream &,std::string const&,std::string const&, bool &); + class Parser { private: @@ -546,19 +548,6 @@ namespace WXML ~Tokenizer(); }; - class ExprSyntaxTree - { - private: - /* data */ - public: - ExprSyntaxTree(/* args */); - ~ExprSyntaxTree(); - void RenderAsOps( - std::stringstream & a2, - std::string const& a3, - bool & a4 - ); - }; class Token { @@ -569,15 +558,46 @@ namespace WXML */ private: /* data */ - int type; - std::string tokenName; public: + int offset_0; + std::string offset_4; Token(/* args */); ~Token(); + std::string GetLiteral(void); const char * GetTokenName(); }; - + class ExprSyntaxTree + { + private: + /* data */ + public: + std::string offset_0; + WXML::EXPRLib::Token offset_24; + // offset_52 + ExprSyntaxTree(/* args */); + ~ExprSyntaxTree(); + void RenderAsOps( + std::stringstream & a2, + std::string const& a3, + bool & a4 + ); + }; + enum OPShort + { + AOP = 2, + CONST = 1, + CON_LIST = 5, + CS_GLOBAL = 11, + DO_FUNC = 12, + EX_DICT = 10, + GET_FROM_ENV = 7, + GET_NAME = 6, + MAKE_KV = 8, + MAKE_LIST = 4, + NAME = 3, + UNION_KV = 9 + }; } // namespace EXPRLib diff --git a/src/utils/file.cpp b/src/utils/file.cpp index 601184c..2fccbb1 100644 --- a/src/utils/file.cpp +++ b/src/utils/file.cpp @@ -17,7 +17,7 @@ int readFile (const char* fileName, std::string &result) { char buf[1024]; unsigned int len; - result = "\0"; + result = ""; if (fileName) f = fopen(fileName, "r"); if (!f) { @@ -29,7 +29,12 @@ int readFile (const char* fileName, std::string &result) { while (fgets(buf, 1024, f)) { len = strlen(buf); - result.append(buf, len); + for (int i = 0; i < len; i++) + { + if (buf[i] != '\r') + result.push_back(buf[i]); + } + } if (f) { fclose(f); diff --git a/src/wxml/compiler.cpp b/src/wxml/compiler.cpp index 6e09938..b8c84cb 100644 --- a/src/wxml/compiler.cpp +++ b/src/wxml/compiler.cpp @@ -235,6 +235,7 @@ namespace WXML{ v311, // ??? a11 (mark & 4) != 0, // a11 -> mark a12 (mark & 0x20) != 0); // a13 + // printf("parse result: %d", parseResult); } // mark - 5 std::shared_ptr v301_localCommonStream1(new std::stringstream()); // v301 @@ -325,6 +326,7 @@ namespace WXML{ // mark - 45 for (auto i = v304.begin(); i != v304.end(); i++) { + i->second->RewriteTree(); std::string v328 = "ALL"; auto v51 = componentListMap[v328]; auto v282 = i->second; diff --git a/src/wxml/dom_lib/parser.cpp b/src/wxml/dom_lib/parser.cpp index 6e3110f..9607e94 100644 --- a/src/wxml/dom_lib/parser.cpp +++ b/src/wxml/dom_lib/parser.cpp @@ -125,7 +125,7 @@ namespace WXML if (token.IsMatch("<")) { this->peekIndex++; - auto token = this->Peek(); + token = this->Peek(); auto tag = token.ToString(); if (!WXML::DOMLib::Parser::IsValidTag(tag)) { diff --git a/src/wxml/dom_lib/wxml_dom.cpp b/src/wxml/dom_lib/wxml_dom.cpp index 249dcee..6daf066 100644 --- a/src/wxml/dom_lib/wxml_dom.cpp +++ b/src/wxml/dom_lib/wxml_dom.cpp @@ -245,7 +245,7 @@ namespace WXML { } else { - for (auto i = this->offset_48.begin(); i != this->offset_48.end(); i++) + for (auto i = this->offset_48.rbegin(); i != this->offset_48.rend(); i++) { if ( i->second.offset_20 @@ -254,8 +254,8 @@ namespace WXML { ) { if ( - this->offset_0 == "wx-template" && i->first == "data" - || this->offset_0 == "wx-scope" && i->first == "wx:scope-data" + (this->offset_0 == "wx-template" && i->first == "data") + || (this->offset_0 == "wx-scope" && i->first == "wx:scope-data") ) { this->DealSingleTokenToOps(a2, a3, a4, a5, &i->second, 1, 1, 0, a6, a7, a8); @@ -272,6 +272,7 @@ namespace WXML { } } + return; } void WXMLDom::RenderMeAsFunction( std::string const& a2, @@ -358,6 +359,174 @@ namespace WXML { } + } + void WXMLDom::RewriteTree(void) + { + // RewriteTree - 0 + for (int i = 0; i < this->offset_72.size(); i++) + { + auto cur = this->offset_72[i]; + auto forItem = cur->offset_48.find("wx:for"); + if (forItem != cur->offset_48.end()) + { + WXML::DOMLib::Token v4 = forItem->second; + // token.offset_0 = "wx:for-items"; + cur->offset_48.emplace("wx:for-items", v4); + cur->offset_48.erase("wx:for"); + } + } + + // RewriteTree - 5 + for (int i = 0; i < this->offset_72.size(); i++) + { + auto cur = this->offset_72[i]; + auto forItems = cur->offset_48.find("wx:for-items"); + if (forItems == cur->offset_48.end() && cur->offset_0 != "block") + { + const char **v38 = WXML::DOMLib::szWXIFControlAttrs; + while (*v38) + { + std::string v101 = *v38; + auto v9 = cur->offset_48.find(v101); + ++v38; + if (v9 != cur->offset_48.end()) + { + std::shared_ptr v98(new WXML::DOMLib::WXMLDom()); + auto v11 = v9->second; + v98->offset_48.emplace(v101, v9->second); + v98->offset_0 = "block"; + v98->offset_24.assign(cur->offset_24); + v98->offset_84 = cur->offset_84; + cur->offset_48.erase(v101); + v98->offset_72.push_back(cur); + this->offset_72[i] = v98; + break; + } + } + + } + } + + // RewriteTree - 10 + for (int i = 0; i < this->offset_72.size(); i++) + { + std::string v35; + bool v52 = false; + auto cur = this->offset_72[i]; + if (cur->offset_0 != "template") + { + continue; + } + if (cur->offset_48.end() == cur->offset_48.find("is")) + { + v52 = false; + } + else + { + v52 = cur->offset_48.end() == cur->offset_48.find("name"); + } + if (v52) + { + v35 = "wx-template"; + } + else + { + v35 = "wx-define"; + } + this->offset_72[i]->offset_0 = v35; + } + + // RewriteTree - 15 + for (int i = 0; i < this->offset_72.size(); i++) + { + auto cur = this->offset_72[i]; + if (cur->offset_0 == "block") + { + // TODO... + } + } + + // RewriteTree - 20 + for (int i = 0; i < this->offset_72.size(); i++) + { + auto cur = this->offset_72[i]; + if (cur->offset_0 != "wx-repeat") + { + if (cur->offset_0 != "wx-define") + { + if (cur->offset_0 != "wx-import") + { + if (cur->offset_0 != "import") + { + auto v19 = cur->offset_48.find("wx:for-items"); + if (v19 != cur->offset_48.end()) + { + std::shared_ptr v91(new WXML::DOMLib::WXMLDom()); + v91->offset_0 = "wx-repeat"; + v91->offset_24.assign(cur->offset_24); + v91->offset_84 = cur->offset_84; + v91->offset_72.push_back(cur); + WXML::DOMLib::Token v21 = cur->offset_48["wx:for-items"]; + v91->offset_48.emplace("wx:for-items", v21); + cur->offset_48.erase("wx:for-items"); + auto v59 = cur->offset_48.find("wx:for-item"); + if (cur->offset_48.end() != v59) + { + WXML::DOMLib::Token v22 = v59->second; + v91->offset_48.emplace("wx:for-item", v22); + cur->offset_48.erase("wx:for-item"); + } + + //////////////////////////////"wx:for-index" + auto v63 = cur->offset_48.find("wx:for-index"); + if (v63 != cur->offset_48.end()) + { + WXML::DOMLib::Token v102 = v63->second; + v91->offset_48.emplace("wx:for-index", v102); + cur->offset_48.erase("wx:for-index"); + } + + ///////////////////////////////"wx:key" + auto v67 = cur->offset_48.find("wx:key"); + if (cur->offset_48.end() != v67) + { + WXML::DOMLib::Token v24 = v67->second; + v91->offset_48.emplace("wx:key", v24); + cur->offset_48.erase("wx:key"); + } + this->offset_72[i] = v91; + } + } + } + } + } + } + + // RewriteTree - 25 + for (int i = 0; i < this->offset_72.size(); i++) + { + auto cur = this->offset_72[i]; + auto v28 = cur->offset_48.find("wx:scope-data"); + if (v28 != cur->offset_48.end()) + { + std::shared_ptr v71(new WXML::DOMLib::WXMLDom()); + v71->offset_0 = "wx-scope"; + v71->offset_24.assign(cur->offset_24); + v71->offset_84 = cur->offset_84; + v71->offset_72.push_back(cur); + WXML::DOMLib::Token v30 = cur->offset_48["wx:scope-data"]; + v71->offset_48.emplace("wx:scope-data", v30); + cur->offset_48.erase("wx:scope-data"); + this->offset_72[i] = v71; + } + } + + // RewriteTree - 30 + for (int i = 0; i < this->offset_72.size(); i++) + { + this->offset_72[i]->RewriteTree(); + } + } /** * 有点问题 @@ -672,7 +841,7 @@ namespace WXML { std::map * a15 ) { - if (a13 && this->offset_28) + if (a13 && this->offset_24.size()) { a6 << "cs.push(\""; std::string sc = WXML::Rewrite::ToStringCode(a2); @@ -697,7 +866,7 @@ namespace WXML { a6 << a12; // goto LABEL_169; - if (a13 && this->offset_28) + if (a13 && this->offset_24.size()) { a6 << "cs.pop()" << a12; } @@ -705,12 +874,12 @@ namespace WXML { } // TEXTNODE end if (this->offset_0 == "wx-define" - ||this->offset_0 == "wx-import" - ||this->offset_0 == "import" - ||this->offset_0 == "template") + || this->offset_0 == "wx-import" + || this->offset_0 == "import" + || this->offset_0 == "template") { - if (a13 && this->offset_28) + if (a13 && this->offset_24.size()) { a6 << "cs.pop()" << a12; } @@ -784,6 +953,15 @@ namespace WXML { throw "RenderException" + err; } + if (target2_1.size() == 0) + { + target2_1 = "index"; + } + if (target3_1.size() == 0) + { + target3_1 = "item"; + } + std::string name1; a7->GetNextName(name1); @@ -850,10 +1028,9 @@ namespace WXML { { goto LABEL_57; } + v336 = t->second.ToAttrContent(); v47 = v336.find('.', 0); - - if (v47 != -1) { auto Str = v336.substr(0, v47); @@ -907,7 +1084,36 @@ namespace WXML { } } } - // if (WXML::DOMLib::Token::IsValidVariableNam(v336)) + if (!WXML::DOMLib::Token::IsValidVariableName(v336)) + { + if (v336.length()) + { + if (v336 == "0") + goto LABEL_56; + if (v336[0] != '0') + { + for (int i_0 = 0; i_0 < v336.length(); i_0++) + { + if (v336[i_0] - '0' > 9u) + { + goto LABEL_189; + } + } + + goto LABEL_56; + } + } + LABEL_189: + if (v336 != "*this") + { + a6 << "_wp('" << WXML::Rewrite::ToStringCode(a2) << ":"; + a6 << this->offset_24 << ":" << this->offset_92 << ":" << this->offset_96; + a6 << ": wx:key=\"" << WXML::Rewrite::ToStringCode(v336); + a6 << "\" does not look like a valid key name.')" << a12; + + goto LABEL_56; + } + } LABEL_56: //... LABEL_57: //... if (this->offset_256) @@ -925,7 +1131,7 @@ namespace WXML { a6 << target3_1 << "," << target2_1 << ","; a6 << this->offset_48[wxKey].ToAttrContent() << ")" << a12; goto LABEL_84; - } + } // wx-repeat end if (this->offset_0 == "block") { @@ -957,13 +1163,13 @@ namespace WXML { a6 << this->offset_248.GetStrID(a2); a6 << "]," << a8 << "," << a9 << "," << a5 << "," << a10 << ");" << a12; // goto LABEL_68; - if (a13 && this->offset_28) + if (a13 && this->offset_24.size()) { a6 << "cs.pop()" << a12; } return; } - if (this->offset_0 == "ex-template") + if (this->offset_0 == "wx-template") { v281 = this->offset_48.find("is"); if (v281 == this->offset_48.end()) @@ -983,7 +1189,7 @@ namespace WXML { a6 << a12; // goto LABEL_169; - if (a13 && this->offset_28) + if (a13 && this->offset_24.size()) { a6 << "cs.pop()" << a12; } @@ -1156,7 +1362,7 @@ namespace WXML { // if ((a14 & 1) != 0) // this->AddTestAttr(a5, a6, '\n'/*10*/); LABEL_169: - if (a13 && this->offset_28) + if (a13 && this->offset_24.size()) { a6 << "cs.pop()" << a12; } @@ -1452,7 +1658,7 @@ namespace WXML { } bool WXMLDom::operator==(std::string tag) { - return this->offset_0.compare(tag) == 0; + return this->offset_0 == tag; } std::string WXMLDom::Error( std::string const& a2, diff --git a/src/wxml/expr_lib/common.cpp b/src/wxml/expr_lib/common.cpp new file mode 100644 index 0000000..78ecb12 --- /dev/null +++ b/src/wxml/expr_lib/common.cpp @@ -0,0 +1,30 @@ +#include "../../include/wxml.h" + +namespace WXML +{ + + namespace EXPRLib + { + void OutputAsStringOrKeyWord( + std::stringstream & a1, + std::string const& a2, + std::string const& a3, + bool &a4) + { + if (a2 == "true") + { + a1 << WXML::EXPRLib::OPShort::CONST << ",true"; + return; + } + if (a2 == "false") + { + a1 << WXML::EXPRLib::OPShort::CONST << ",false"; + } + if (a2 != "$global") + { + a1 << WXML::EXPRLib::OPShort::NAME << ",'" << a2 << "'"; + } + a1 << WXML::EXPRLib::OPShort::CS_GLOBAL; + } + } +} \ No newline at end of file diff --git a/src/wxml/expr_lib/expr_syntax_tree.cpp b/src/wxml/expr_lib/expr_syntax_tree.cpp index 3459b12..d268920 100644 --- a/src/wxml/expr_lib/expr_syntax_tree.cpp +++ b/src/wxml/expr_lib/expr_syntax_tree.cpp @@ -20,7 +20,155 @@ namespace WXML bool & a4 ) { + // RenderAsOps - 0 + a2 << "["; + if (this->offset_0[0] == '$') + { + if (this->offset_0 == "$VAR") + { + std::string v47 = this->offset_24.GetLiteral(); + WXML::EXPRLib::OutputAsStringOrKeyWord(a2, v47, a3, a4); + } + else if(this->offset_0 == "$STRING") + { + a2 << WXML::EXPRLib::OPShort::CONST << ",'"; + std::string v6 = this->offset_24.GetLiteral(); + // WXML::Rewrite::ToStringCode(v6.size(), ,a2); + const char off_5542FA[] = {'\'','\0','[','\0'}; + a2 << off_5542FA; + } + else + { + a2 << WXML::EXPRLib::OPShort::CONST << ",'"; + std::string v33 = this->offset_24.GetLiteral(); + a2 << v33; + } + a2 << "]"; + return ; + + } + // RenderAsOps - 5 + if ( + this->offset_0[0] == 'O' + && this->offset_0[0] == 'P' + && this->offset_0[0] == '_' + ) + { + if (this->offset_0 == "OP_PATH") + { + // if (this->offset_52.size() != 1) + // { + // a2 << "]"; + // return; + // } + a2 << "[" << WXML::EXPRLib::OPShort::GET_FROM_ENV << "],"; + + WXML::EXPRLib::ExprSyntaxTree::RenderAsOps(a2, a3, a4); + a2 << "]"; + return; + } + if (this->offset_0 == "OP_LIST") + { + a2 << "[" << WXML::EXPRLib::OPShort::MAKE_LIST << "],"; + // if (this->offset_52.size() == 0) + // { + // a2 << "]"; + // return; + // } + WXML::EXPRLib::ExprSyntaxTree::RenderAsOps(a2, a3, a4); + a2 << "]"; + return; + + } + if (this->offset_0 == "OP_LIST_CONCAT") + { + a2 << "[" << WXML::EXPRLib::OPShort::CON_LIST << "]"; + // for (int i = 0; i < this->offset_52.size(); i++) + // { + // a2 << ","; + // WXML::EXPRLib::ExprSyntaxTree::RenderAsOps(a2, a3, a4); + // } + + } + else if (this->offset_0 == "OP_DICT_CONCAT") + { + a2 << "[" << WXML::EXPRLib::OPShort::UNION_KV << "]"; + // for (int i = 0; i < this->offset_52.size(); i++) + // { + // a2 << ","; + // WXML::EXPRLib::ExprSyntaxTree::RenderAsOps(a2, a3, a4); + // } + } + else if (this->offset_0 == "OP_MAKE_DICT") + { + a2 << "[" << WXML::EXPRLib::OPShort::MAKE_KV << "],'"; + // this->offset_52.offset_24; + // a2 << ; + a2 << "',"; + // if (this->offset_52.size() == 0) + // { + // a2 << "[" << "[7],"; + // WXML::EXPRLib::ExprSyntaxTree::RenderAsOps(a2, a3, a4); + // a2 << "]"; + // } + // else + // { + // WXML::EXPRLib::ExprSyntaxTree::RenderAsOps(a2, a3, a4); + // } + } + else + { + if (this->offset_0 == "OP_EXPAND") + { + a2 << "[" << WXML::EXPRLib::OPShort::EX_DICT << "],"; + WXML::EXPRLib::ExprSyntaxTree::RenderAsOps(a2, a3, a4); + + a2 << "]"; + return; + + } + if (this->offset_0 == "OP_DICT") + { + a2 << "[" << WXML::EXPRLib::OPShort::GET_NAME << "]"; + // for (int i = 0; i < this->offset_52.size(); i++) + // { + // a2 << ","; + // WXML::EXPRLib::ExprSyntaxTree::RenderAsOps(a2, a3, a4); + + // } + } + else if (this->offset_0 == "OP_FUNC") + { + a2 << "[" << WXML::EXPRLib::OPShort::DO_FUNC << "]"; + // for (int i = 0; i < this->offset_52.size(); i++) + // { + // a2 << ","; + // WXML::EXPRLib::ExprSyntaxTree::RenderAsOps(a2, a3, a4); + + // } + + } + } + + } + // RenderAsOps - 10 + else + { + a2 << "[" << WXML::EXPRLib::OPShort::AOP; + a2 << ",'" << this->offset_0 << "'],"; + // for (int i = 0; i < this->offset_52.size(); i++) + // { + // if (i) + // { + // a2 << ","; + // } + // WXML::EXPRLib::ExprSyntaxTree::RenderAsOps(a2, a3, a4); + // } + + } + // RenderAsOps - 15 + a2 << "]"; } } } \ No newline at end of file diff --git a/src/wxml/expr_lib/token.cpp b/src/wxml/expr_lib/token.cpp index 282b4a4..275a3bb 100644 --- a/src/wxml/expr_lib/token.cpp +++ b/src/wxml/expr_lib/token.cpp @@ -15,10 +15,10 @@ namespace WXML const char * Token::GetTokenName() { const char *result; - switch ( this->type ) + switch ( this->offset_0 ) { case 0u: - result = this->tokenName.c_str(); + result = this->offset_4.data(); break; case 1u: result = "$DECIMAL"; @@ -37,7 +37,24 @@ namespace WXML } return result; } - + + + std::string Token::GetLiteral(void) + { + std::string result = this->offset_4; + if (this->offset_0) + { + result = "$"; + if (this->offset_0 != 5) + { + if (this->offset_4.size()) + { + // return + } + } + } + return ""; + } } } \ No newline at end of file diff --git a/test/wcc.disassembly.cpp b/test/wcc.disassembly.cpp index d4d627d..71ef55d 100644 --- a/test/wcc.disassembly.cpp +++ b/test/wcc.disassembly.cpp @@ -14045,7 +14045,7 @@ struct _Unwind_Exception *__cdecl WXML::Compiler::CompileLazy( break; WXML::DOMLib::WXMLDom::RewriteTree(*(_DWORD *)(jj + 40)); v282 = *((_DWORD *)lpuexcptj + 10); - std::string::basic_string((void **)&v328, (char *)off_550B3F); + std::string::basic_string((void **)&v328, (char *)off_550B3F); // "ALL" v51 = std::map>::operator[](a6, &v328); WXML::DOMLib::WXMLDom::MarkIfHasDescendant(v282, v51); std::string::_M_dispose((void **)&v328); @@ -22719,7 +22719,8 @@ int __fastcall WXML::DOMLib::WXMLDom::RewriteTree(int a1) void *v100[6]; // [esp+F4h] [ebp-94h] BYREF const char *v101; // [esp+10Ch] [ebp-7Ch] BYREF char v102[120]; // [esp+110h] [ebp-78h] BYREF - + + // RewriteTree - 0 for ( Str = 0; ; ++Str ) { v1 = *(_DWORD *)(a1 + 72); @@ -22727,33 +22728,40 @@ int __fastcall WXML::DOMLib::WXMLDom::RewriteTree(int a1) break; v74 = *(_DWORD *)(v1 + 8 * (_DWORD)Str); std::string::basic_string((void **)&v101, "wx:for"); - v2 = std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::find( - (_DWORD *)(v74 + 48), - (int)&v101); + v2 = std::_Rb_tree,std::_Select1st>,std::less,std::allocator>> + ::find( + (_DWORD *)(v74 + 48), // cur->offset_48 + (int)&v101); // "wx:for" v34 = v3; Block = v2; std::string::_M_dispose((void **)&v101); if ( Block != (void *)(v74 + 52) ) { - v75 = *(_DWORD *)(*(_DWORD *)(a1 + 72) + 8 * (_DWORD)Str); + v75 = *(_DWORD *)(*(_DWORD *)(a1 + 72) + 8 * (_DWORD)Str); // cur std::string::basic_string(v100, "wx:for"); v4 = std::map::operator[]( - (_DWORD *)(*(_DWORD *)(*(_DWORD *)(a1 + 72) + 8 * (_DWORD)Str) + 48), - v100); + (_DWORD *)(*(_DWORD *)(*(_DWORD *)(a1 + 72) + 8 * (_DWORD)Str) + 48), // cur->offset_48 + v100); // "wx:for" + // cur->offset_48["wx:for"] v101 = "wx:for-items"; + // v4 WXML::DOMLib::Token::Token((int)v102, (WXML::DOMLib::Token *)v4, v36); - std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::_M_emplace_unique>( + std::_Rb_tree,std::_Select1st>,std::less,std::allocator>> + ::_M_emplace_unique>( (_DWORD *)(v75 + 48), - (char **)&v101); + (char **)&v101); // "wx:for-items" WXML::DOMLib::Token::~Token((int)v102); std::string::_M_dispose(v100); v76 = (_DWORD *)(*(_DWORD *)(*(_DWORD *)(a1 + 72) + 8 * (_DWORD)Str) + 48); + // cur->offset_48 std::string::basic_string((void **)&v101, "wx:for"); std::map::erase(v76, (int)&v101); v34 = v5; std::string::_M_dispose((void **)&v101); } } + + // RewriteTree - 5 for ( i = 0; ; ++i ) { v6 = *(_DWORD *)(a1 + 72); @@ -22762,12 +22770,15 @@ int __fastcall WXML::DOMLib::WXMLDom::RewriteTree(int a1) v50 = (char *)(8 * i); Strg = *(char **)(v6 + 8 * i); std::string::basic_string((void **)&v101, "wx:for-items"); - v7 = (char *)std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::find( + v7 = (char *)std::_Rb_tree,std::_Select1st>,std::less,std::allocator>> + ::find( (_DWORD *)Strg + 12, (int)&v101); v34 = v8; Blocka = v7; std::string::_M_dispose((void **)&v101); + // cur->offset_52 + // char *Strg if ( Blocka == Strg + 52 && !std::operator==(*(_DWORD *)(*(_DWORD *)(a1 + 72) + 8 * i), "block") ) { v38 = WXML::DOMLib::szWXIFControlAttrs; @@ -22776,9 +22787,10 @@ int __fastcall WXML::DOMLib::WXMLDom::RewriteTree(int a1) Stra = *v38; if ( !*v38 ) break; - Blockb = *(_DWORD **)(*(_DWORD *)(a1 + 72) + 8 * i); + Blockb = *(_DWORD **)(*(_DWORD *)(a1 + 72) + 8 * i); // cur std::string::basic_string((void **)&v101, Stra); - v9 = std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::find( + v9 = std::_Rb_tree,std::_Select1st>,std::less,std::allocator>> + ::find( Blockb + 12, (int)&v101); v34 = v10; @@ -22789,25 +22801,28 @@ int __fastcall WXML::DOMLib::WXMLDom::RewriteTree(int a1) { std::__shared_ptr::__shared_ptr( &v96, - &v50[*(_DWORD *)(a1 + 72)]); + &v50[*(_DWORD *)(a1 + 72)]); // cur Blockc = operator new(0x128u); WXML::DOMLib::WXMLDom::WXMLDom((int)Blockc); zcc::shared_ptr::shared_ptr(Blockc); Blockd = v98; std::string::basic_string(v100, Stra); + // v96 + 12 -> cur->offset_48[*v38] v11 = std::map::operator[](v96 + 12, v100); - v101 = Stra; + v101 = Stra; // *v38 WXML::DOMLib::Token::Token((int)v102, (WXML::DOMLib::Token *)v11, v36); - std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::_M_emplace_unique>( - Blockd + 12, + std::_Rb_tree,std::_Select1st>,std::less,std::allocator>> + ::_M_emplace_unique>( + Blockd + 12, // cur->offset_48 (char **)&v101); WXML::DOMLib::Token::~Token((int)v102); std::string::_M_dispose(v100); std::string::operator=(v98, "block"); + // v96 -> cur WXML::DOMLib::Token::operator=((int)(v98 + 21), (int)(v96 + 21)); std::string::_M_assign((int)(v98 + 6), (int)(v96 + 6)); Blocke = v96 + 12; - std::string::basic_string((void **)&v101, Stra); + std::string::basic_string((void **)&v101, Stra); // *v38 std::map::erase(Blocke, (int)&v101); std::string::_M_dispose((void **)&v101); std::vector>::push_back(v98 + 18, &v96); @@ -22822,6 +22837,8 @@ int __fastcall WXML::DOMLib::WXMLDom::RewriteTree(int a1) } } } + + // RewriteTree - 10 for ( Strb = 0; ; ++Strb ) { v14 = *(_DWORD *)(a1 + 72); @@ -22829,9 +22846,11 @@ int __fastcall WXML::DOMLib::WXMLDom::RewriteTree(int a1) break; if ( !std::operator==(*(_DWORD *)(v14 + 8 * (_DWORD)Strb), "template") ) goto LABEL_23; - v51 = *(_DWORD **)(*(_DWORD *)(a1 + 72) + 8 * (_DWORD)Strb); + v51 = *(_DWORD **)(*(_DWORD *)(a1 + 72) + 8 * (_DWORD)Strb); // cur std::string::basic_string(v100, "is"); - if ( v51 + 13 == std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::find( + // 13 * 4 = 52 + if ( v51 + 13 == std::_Rb_tree,std::_Select1st>,std::less,std::allocator>> + ::find( v51 + 12, (int)v100) ) { @@ -22849,12 +22868,12 @@ int __fastcall WXML::DOMLib::WXMLDom::RewriteTree(int a1) std::string::_M_dispose(v100); if ( v52 ) { - v15 = *(unsigned int **)(*(_DWORD *)(a1 + 72) + 8 * (_DWORD)Strb); + v15 = *(unsigned int **)(*(_DWORD *)(a1 + 72) + 8 * (_DWORD)Strb); // cur v35 = "wx-template"; } else { -LABEL_23: + LABEL_23: if ( !std::operator==(*(_DWORD *)(*(_DWORD *)(a1 + 72) + 8 * (_DWORD)Strb), "template") ) continue; v15 = *(unsigned int **)(*(_DWORD *)(a1 + 72) + 8 * (_DWORD)Strb); @@ -22862,6 +22881,8 @@ LABEL_23: } v34 = std::string::operator=(v15, v35); } + + // RewriteTree - 15 for ( Strc = 0; ; ++Strc ) { v16 = *(_DWORD *)(a1 + 72); @@ -22873,12 +22894,15 @@ LABEL_23: v34 = v17; } } + + // RewriteTree - 20 for ( j = 0; ; ++j ) { v18 = *(_DWORD *)(a1 + 72); if ( (*(_DWORD *)(a1 + 76) - v18) >> 3 <= j ) break; Strd = (char *)(8 * j); + // cur->offset_0 if ( (unsigned __int8)std::operator!=(*(_DWORD *)(v18 + 8 * j), "wx-repeat") ) { if ( (unsigned __int8)std::operator!=(*(_DWORD *)(*(_DWORD *)(a1 + 72) + 8 * j), "wx-define") ) @@ -22887,11 +22911,12 @@ LABEL_23: { if ( (unsigned __int8)std::operator!=(*(_DWORD *)(*(_DWORD *)(a1 + 72) + 8 * j), "import") ) { - v54 = *(_DWORD **)(*(_DWORD *)(a1 + 72) + 8 * j); + v54 = *(_DWORD **)(*(_DWORD *)(a1 + 72) + 8 * j); // cur std::string::basic_string((void **)&v101, "wx:for-items"); - v19 = (char *)std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::find( + v19 = (char *)std::_Rb_tree,std::_Select1st>,std::less,std::allocator>> + ::find( v54 + 12, - (int)&v101); + (int)&v101); // "wx:for-items" v34 = v20; Blockf = v19; std::string::_M_dispose((void **)&v101); @@ -22900,31 +22925,37 @@ LABEL_23: std::__shared_ptr::__shared_ptr( &v89, &Strd[*(_DWORD *)(a1 + 72)]); + // cur v55 = operator new(0x128u); WXML::DOMLib::WXMLDom::WXMLDom((int)v55); zcc::shared_ptr::shared_ptr(v55); std::string::operator=(v91, "wx-repeat"); + // cur->offset_24 std::string::_M_assign((int)(v91 + 6), *(_DWORD *)(*(_DWORD *)(a1 + 72) + 8 * j) + 24); WXML::DOMLib::Token::operator=((int)(v91 + 21), (int)(v89 + 21)); std::vector>::push_back(v91 + 18, &v89); v56 = v91; std::string::basic_string(v100, "wx:for-items"); + // cur->offset_48["wx:for-items"] v21 = std::map::operator[](v89 + 12, v100); v101 = "wx:for-items"; WXML::DOMLib::Token::Token((int)v102, (WXML::DOMLib::Token *)v21, v36); - std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::_M_emplace_unique>( + std::_Rb_tree,std::_Select1st>,std::less,std::allocator>> + ::_M_emplace_unique>( v56 + 12, (char **)&v101); WXML::DOMLib::Token::~Token((int)v102); std::string::_M_dispose(v100); v57 = v89 + 12; + // v89 -> cur std::string::basic_string(v93, "wx:for-items"); std::map::erase(v57, (int)v93); std::string::_M_dispose(v93); - v58 = v89; - Blockg = v89 + 13; + v58 = v89; // cur + Blockg = v89 + 13; // cur->offset_52 end std::string::basic_string(v94, "wx:for-item"); - v59 = std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::find( + v59 = std::_Rb_tree,std::_Select1st>,std::less,std::allocator>> + ::find( v58 + 12, (int)v94); std::string::_M_dispose(v94); @@ -22932,34 +22963,41 @@ LABEL_23: { v60 = v91; std::string::basic_string(v100, "wx:for-item"); + // cur->offset_48["wx:for-item"] v22 = std::map::operator[](v89 + 12, v100); v101 = "wx:for-item"; WXML::DOMLib::Token::Token((int)v102, (WXML::DOMLib::Token *)v22, v36); - std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::_M_emplace_unique>( + std::_Rb_tree,std::_Select1st>,std::less,std::allocator>> + ::_M_emplace_unique>( v60 + 12, - (char **)&v101); + (char **)&v101); // "wx:for-item" WXML::DOMLib::Token::~Token((int)v102); std::string::_M_dispose(v100); - v61 = v89 + 12; + v61 = v89 + 12; // cur->offset_48 std::string::basic_string(v95, "wx:for-item"); std::map::erase(v61, (int)v95); std::string::_M_dispose(v95); } - v62 = v89; - Blockh = v89 + 13; + + //////////////////////////////////////"wx:for-index" + v62 = v89; // cur + Blockh = v89 + 13; // cur->offset_48.end() std::string::basic_string((void **)&v96, "wx:for-index"); - v63 = std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::find( - v62 + 12, - (int)&v96); + v63 = std::_Rb_tree,std::_Select1st>,std::less,std::allocator>> + ::find( + v62 + 12, // cur->offset_48 + (int)&v96); // "wx:for-index" std::string::_M_dispose((void **)&v96); if ( v63 != Blockh ) { v64 = v91; std::string::basic_string(v100, "wx:for-index"); + // cur->offset_48 v23 = std::map::operator[](v89 + 12, v100); v101 = "wx:for-index"; WXML::DOMLib::Token::Token((int)v102, (WXML::DOMLib::Token *)v23, v36); - std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::_M_emplace_unique>( + std::_Rb_tree,std::_Select1st>,std::less,std::allocator>> + ::_M_emplace_unique>( v64 + 12, (char **)&v101); WXML::DOMLib::Token::~Token((int)v102); @@ -22969,7 +23007,9 @@ LABEL_23: std::map::erase(v65, (int)&v98); std::string::_M_dispose((void **)&v98); } - v66 = v89; + + ////////////////////////////////////////"wx:key" + v66 = v89; // cur Blocki = v89 + 13; std::string::basic_string(v100, "wx:key"); v67 = std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::find( @@ -22984,8 +23024,8 @@ LABEL_23: v101 = "wx:key"; WXML::DOMLib::Token::Token((int)v102, (WXML::DOMLib::Token *)v24, v36); std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::_M_emplace_unique>( - v68 + 12, - (char **)&v101); + v68 + 12, // v91->offset_48 + (char **)&v101); // "wx:key" WXML::DOMLib::Token::~Token((int)v102); std::string::_M_dispose(v100); v69 = v89 + 12; @@ -22993,7 +23033,9 @@ LABEL_23: std::map::erase(v69, (int)&v101); std::string::_M_dispose((void **)&v101); } + // Strd = (char *)(8 * j); v25 = (volatile signed __int32 **)&Strd[*(_DWORD *)(a1 + 72) + 4]; + // cur->offset_16 *(v25 - 1) = (volatile signed __int32 *)v91; std::__shared_count<(__gnu_cxx::_Lock_policy)2>::operator=(v25, (int)v92); v34 = v26; @@ -23005,17 +23047,20 @@ LABEL_23: } } } + + // RewriteTree - 25 for ( Stre = 0; ; ++Stre ) { v27 = *(_DWORD *)(a1 + 72); if ( (*(_DWORD *)(a1 + 76) - v27) >> 3 <= (unsigned int)Stre ) break; - v79 = 8 * (_DWORD)Stre; - v70 = *(_DWORD **)(v27 + 8 * (_DWORD)Stre); + v79 = 8 * (_DWORD)Stre; // index offset + v70 = *(_DWORD **)(v27 + 8 * (_DWORD)Stre); // cur std::string::basic_string((void **)&v101, "wx:scope-data"); - v28 = (char *)std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::find( - v70 + 12, - (int)&v101); + v28 = (char *)std::_Rb_tree,std::_Select1st>,std::less,std::allocator>> + ::find( + v70 + 12, // cur->offset_48 + (int)&v101); // "wx:scope-data" v34 = v29; Blockj = v28; std::string::_M_dispose((void **)&v101); @@ -23023,22 +23068,26 @@ LABEL_23: { std::__shared_ptr::__shared_ptr( &v96, - (_DWORD *)(*(_DWORD *)(a1 + 72) + v79)); + (_DWORD *)(*(_DWORD *)(a1 + 72) + v79)); // cur v71 = operator new(0x128u); WXML::DOMLib::WXMLDom::WXMLDom((int)v71); zcc::shared_ptr::shared_ptr(v71); std::string::operator=(v98, "wx-scope"); + // cur->offset_96 + // int *v98 std::string::_M_assign((int)(v98 + 6), *(_DWORD *)(*(_DWORD *)(a1 + 72) + 8 * (_DWORD)Stre) + 24); WXML::DOMLib::Token::operator=((int)(v98 + 21), (int)(v96 + 21)); + // 18 * 4 = 72 std::vector>::push_back(v98 + 18, &v96); v72 = v98; std::string::basic_string(v100, "wx:scope-data"); v30 = std::map::operator[](v96 + 12, v100); v101 = "wx:scope-data"; WXML::DOMLib::Token::Token((int)v102, (WXML::DOMLib::Token *)v30, v36); - std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::_M_emplace_unique>( + std::_Rb_tree,std::_Select1st>,std::less,std::allocator>> + ::_M_emplace_unique>( v72 + 12, - (char **)&v101); + (char **)&v101);// "wx:scope-data" WXML::DOMLib::Token::~Token((int)v102); std::string::_M_dispose(v100); v73 = v96 + 12; @@ -23053,6 +23102,8 @@ LABEL_23: std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count(v97); } } + + // RewriteTree - 30 for ( Strf = 0; (*(_DWORD *)(a1 + 76) - *(_DWORD *)(a1 + 72)) >> 3 > (unsigned int)Strf; ++Strf ) WXML::DOMLib::WXMLDom::RewriteTree((WXML::DOMLib::WXMLDom *)v34); return 0; @@ -24626,20 +24677,20 @@ LABEL_69: v275 = (std::ostream::sentry *)(this + 52); if ( (_DWORD *)(this + 52) == std::_Rb_tree,std::_Select1st>,std::less,std::allocator>> ::find( - (_DWORD *)(this + 48), - (int)v312) ) + (_DWORD *)(this + 48), // this->offset_48 + (int)v312) ) // "items" std::string::operator=((unsigned int *)v312, "wx:for-items"); std::string::basic_string(v313, "index"); // target2 if ( v275 == (std::ostream::sentry *)std::_Rb_tree,std::_Select1st>,std::less,std::allocator>> ::find( - v295, - (int)v313) ) + v295, // this->offset_48 + (int)v313) ) // "index" std::string::operator=((unsigned int *)v313, "wx:for-index"); std::string::basic_string(v314, "item"); // target3 if ( v275 == (std::ostream::sentry *)std::_Rb_tree,std::_Select1st>,std::less,std::allocator>> ::find( - v295, - (int)v314) ) + v295, // this->offset_48 + (int)v314) ) // "item" std::string::operator=((unsigned int *)v314, "wx:for-item"); std::string::basic_string(v315, "wx:key"); v316[0] = &v317; @@ -24670,10 +24721,12 @@ LABEL_69: v295, // this + 48 (int)v313) ) // target2 { + // target2_1 std::string::operator=((unsigned int *)&v318, "index"); } else { + // this->offset_48[v313] v32 = std::map::operator[](v295, (int)v313); v33 = WXML::DOMLib::Token::ToAttrContent[abi:cxx11]((int)v32); std::string::_M_assign((int)&v318, v33); @@ -24683,10 +24736,12 @@ LABEL_69: v295, // this + 48 (int)v314) ) // target3 { + // target3_1 std::string::operator=((unsigned int *)&v321, "item"); } else { + // this->offset_48[v314] v34 = std::map::operator[](v295, (int)v314); v35 = WXML::DOMLib::Token::ToAttrContent[abi:cxx11]((int)v34); std::string::_M_assign((int)&v321, v35); @@ -24713,8 +24768,8 @@ LABEL_69: if ( v275 != (std::ostream::sentry *)std::_Rb_tree,std::_Select1st>,std::less,std::allocator>> ::find( - v295, - (int)v315) + v295, // this->offset_48 + (int)v315) // "wx:key" && *((_DWORD *)std::map::operator[](v295, (int)v315) + 14) == -3 && (a14 & 1) == 0 ) { @@ -24748,8 +24803,8 @@ LABEL_69: v334 = 0; v335[0] = 0; WXML::NameAllocator::GetNextName(a7, (int)&v333); - std::string::basic_string((void **)v347, (char *)&byte_5537CA); - std::string::basic_string((void **)&Str, (char *)&byte_5537CA); + std::string::basic_string((void **)v347, (char *)&byte_5537CA); // "\0" + std::string::basic_string((void **)&Str, (char *)&byte_5537CA); // "\0" WXML::DOMLib::WXMLDom::RenderMeAsFunction( a2, a3, @@ -24802,8 +24857,8 @@ LABEL_69: goto LABEL_57; if ( v275 == (std::ostream::sentry *)std::_Rb_tree,std::_Select1st>,std::less,std::allocator>> ::find( - v295, - (int)v315) ) + v295, // this->offset_48 + (int)v315) ) // "wx:key" { Str = v346; v345 = 0; @@ -24824,9 +24879,11 @@ LABEL_69: std::string::_M_dispose((void **)v347); std::string::_M_dispose((void **)&Str); } - v45 = (std::ostream::sentry *)std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::find( - v295, - (int)v315); + + v45 = (std::ostream::sentry *)std::_Rb_tree,std::_Select1st>,std::less,std::allocator>> + ::find( + v295, // this->offset_48 + (int)v315); // "wx:key" if ( v45 == v275 ) goto LABEL_57; v46 = WXML::DOMLib::Token::ToAttrContent[abi:cxx11]((int)v45 + 40); @@ -24834,7 +24891,7 @@ LABEL_69: v339 = (int)v341; v340 = 0; LOBYTE(v341[0]) = 0; - v47 = std::string::find(&v336, 46, 0); + v47 = std::string::find(&v336, '.'/*46*/, 0); v276 = (std::ostream::sentry *)v47; if ( v47 != (char *)-1 ) { @@ -24863,7 +24920,7 @@ LABEL_69: { if ( Str1 == 1 || WXML::DOMLib::Token::IsValidVariableName((char **)&v339) ) goto LABEL_181; - v48 = std::string::find(&v339, 46, 0); + v48 = std::string::find(&v339, '.'/*46*/, 0); v277 = (std::ostream::sentry *)v48; if ( v48 != (char *)-1 ) { @@ -24881,7 +24938,7 @@ LABEL_69: std::string::substr(v347, &v339, (unsigned int)v277 + 1, 0xFFFFFFFF); std::string::operator=((unsigned __int8 **)&v339, (int)v347); std::string::_M_dispose((void **)v347); -LABEL_181: + LABEL_181: v289 = std::operator<<>((std::ostream::sentry *)(a6 + 8), "_wp('"); WXML::Rewrite::ToStringCode((int)v342, a2); v223 = std::operator<<(v289, v342); @@ -24904,7 +24961,7 @@ LABEL_181: std::string::_M_dispose((void **)v347); std::string::_M_dispose((void **)&Str); p_Str = (void **)v342; -LABEL_191: + LABEL_191: std::string::_M_dispose(p_Str); goto LABEL_56; } @@ -24917,7 +24974,7 @@ LABEL_191: { if ( std::operator==((int)&v336, "0") ) goto LABEL_56; - if ( *(_BYTE *)v336 != 48 ) + if ( *(_BYTE *)v336 != '0'/*48*/ ) { for ( i = 0; v337 != i; ++i ) { @@ -24927,6 +24984,24 @@ LABEL_191: goto LABEL_56; } } + + /* + int this, + int *a2, + int *a3, + int a4, + int *a5, + int a6, + int *a7, + int *a8, + int *a9, + int *a10, + int *a11, + char a12, + unsigned __int8 a13, + int a14, + int a15) + */ LABEL_189: if ( !std::operator==((int)&v336, "*this") ) { @@ -24946,7 +25021,7 @@ LABEL_191: std::operator<<>(v239, a12); std::string::_M_dispose((void **)v347); p_Str = (void **)&Str; - goto LABEL_191; + goto LABEL_191; // LABEL_56 } } LABEL_56: @@ -25028,7 +25103,7 @@ LABEL_57: Str1a = (char *)(this + 52); if ( std::operator==(this, "include") ) { - std::string::basic_string((void **)v347, (char *)off_5539C8); + std::string::basic_string((void **)v347, (char *)off_5539C8); // "src" v279 = (std::ostream::sentry *)std::_Rb_tree,std::_Select1st>,std::less,std::allocator>> ::find( v296, @@ -25037,17 +25112,17 @@ LABEL_57: // == end if ( v279 == (std::ostream::sentry *)Str1a ) goto LABEL_169; - std::string::basic_string((void **)v347, (char *)off_5539C8); + std::string::basic_string((void **)v347, (char *)off_5539C8); // "src" v280 = (std::ostream::sentry *)*((_DWORD *)std::map::operator[](v296, v347) + 14); std::string::_M_dispose((void **)v347); if ( v280 == (std::ostream::sentry *)-3 ) { v251 = __cxa_allocate_exception(0x18u); - std::string::basic_string((void **)&Str, (char *)off_5539C8); + std::string::basic_string((void **)&Str, (char *)off_5539C8); // "src" // v296 this.offset_48 lpuexcptd = (int *)(std::map::operator[](v296, &Str) + 60); - std::string::basic_string((void **)v347, (char *)off_5539C8); - std::string::basic_string((void **)v342, (char *)off_5539C8); + std::string::basic_string((void **)v347, (char *)off_5539C8); // "src" + std::string::basic_string((void **)v342, (char *)off_5539C8); // "src" v73 = std::map::operator[](v296, v342); // v296["src"] WXML::DOMLib::WXMLDom::Error((int)v251, a2, (int)v73, v347, lpuexcptd); @@ -27129,10 +27204,12 @@ int __thiscall WXML::DOMLib::Machine::Feed( lpuexcpt = this; LOBYTE(v46) = a2; - if ( a2 == 10 ) + if ( a2 == '\n'/*10*/ ) { v6 = lpuexcpt; + // this->offset_8(lineCount) ++*((_DWORD *)lpuexcpt + 2); + // this->offset_12(lineLength) *((_DWORD *)v6 + 3) = 0; } // v44 喂入的字符 @@ -27188,6 +27265,7 @@ LABEL_12: v15 = lpuexcpt; v16 = _bittest(&v46, 0x15u); // v46 从TT中取出的 + // this->offset_24 *((_DWORD *)lpuexcpt + 6) = (unsigned __int16)v46; if ( v16 ) // if(_bittest(&v46, 0x15u)) { @@ -27256,8 +27334,8 @@ LABEL_12: // v46 从TT中取出的 if ( _bittest(&v46, 0x11u) ) { - v22 = *(_DWORD *)lpuexcpt; // offset_0 - v23 = *((_DWORD *)lpuexcpt + 1); // offset_4 + v22 = *(_DWORD *)lpuexcpt; // this->offset_0 + v23 = *((_DWORD *)lpuexcpt + 1); // this->offset_4 // offset_1 < offset_0 if ( v23 < *(_DWORD *)lpuexcpt ) { @@ -27272,18 +27350,17 @@ LABEL_12: v25 = *((_DWORD *)lpuexcpt + 4); v67[0] = 0; v58 = 0; - // v51 -> v49.offset_8 + // v51 -> v49.offset_8 = this.offset_16 v51 = v25; v59[0] = 0; // this.offset_20 v26 = *((_DWORD *)lpuexcpt + 5); v63[0] = 0; v62 = 0; - // v52 -> v49.offset_12 + // v52 -> v49.offset_12 = this.offset_20 v52 = v26; v66 = 0; - // v54 = this.offset_0(fileLength) - this.offset_4 - // v54 -> v49.offset_20 + // v54 -> v49.offset_20 = this.offset_0(fileLength) - this.offset_4 v54 = v22 - v23; v27 = lpuexcpt; // v56 -> v49.offset_28 @@ -27299,7 +27376,7 @@ LABEL_12: v64 = 0; // v45 offset_24 v29 = WXML::DOMLib::Machine::STT[v45]; - // v53 -> v49.offset_16 + // v53 -> v49.offset_16 = this->offset_4 修改之前的 v53 = v23; v60 = -1; // v55 -> v49.offset_24 @@ -27343,11 +27420,11 @@ LABEL_12: v52 = v36; // v37 = this.offset_4 v37 = *((_DWORD *)v31 + 1); - // this.offset_4 = this.offset_0 + 1 = this->fileLength + // this.offset_4 = this.offset_0 + 1 = this->fileLength 加一之后的值 *((_DWORD *)v31 + 1) = v32; // this.offset_8(lineCount) v38 = *((_DWORD *)v31 + 2); - // this.offset_20 = this.offset_12(lineLength) + // this.offset_20 = this.offset_12(lineLength) 加一之后的值 *((_DWORD *)v31 + 5) = v33; // this.offset_16 = this.offset_8(lineCount) *((_DWORD *)v31 + 4) = v38; @@ -27362,7 +27439,7 @@ LABEL_12: v56 = 0; v64 = 0; v60 = -1; - // token.offset_16 = this->offset_4 + // token.offset_16 = this->offset_4 修改之前的值 v53 = v37; // v49.offset_20 = (this->offset_0 + 1)fileLength - this->offset_4 v54 = v34 - v37; @@ -27692,11 +27769,14 @@ int __thiscall WXML::EXPRLib::ExprSyntaxTree::RenderAsOps(int *this, int a2, int struct _Unwind_Exception *lpuexcpta; // [esp+18h] [ebp-60h] void *v47[8]; // [esp+58h] [ebp-20h] BYREF + // RenderAsOps - 0 v36 = (std::ostream::sentry *)*this; v44 = (WXML::EXPRLib::Token *)(a2 + 8); std::operator<<>((std::ostream::sentry *)(a2 + 8), (char *)&off_5542FA[2]); - if ( *(_BYTE *)v36 == 36 ) + // v36 this + if ( *(_BYTE *)v36 == '$'/*36*/ ) { + // this->offset_24 v37 = (std::ostream::sentry *)(this + 6); if ( std::operator==((int)this, "$VAR") ) { @@ -27721,22 +27801,25 @@ int __thiscall WXML::EXPRLib::ExprSyntaxTree::RenderAsOps(int *this, int a2, int v33 = (char *)WXML::EXPRLib::Token::GetLiteral(v37); std::operator<<>(v44, v33); } - goto LABEL_46; + goto LABEL_46; // << "]"; return } - if ( *(_BYTE *)v36 == 79 && *((_BYTE *)v36 + 1) == 80 && *((_BYTE *)v36 + 2) == 95 ) + + // RenderAsOps - 5 + // v36 -> this + if ( *(_BYTE *)v36 == 'O'/*79*/ && *((_BYTE *)v36 + 1) == 'P'/*80*/ && *((_BYTE *)v36 + 2) == '_'/*95*/ ) { if ( std::operator==((int)this, "OP_PATH") ) { if ( this[14] - this[13] != 8 ) - goto LABEL_46; + goto LABEL_46; // << "]"; return v8 = std::operator<<>(v44, (char *)&off_5542FA[2]); v9 = std::operator<<>(v8, WXML::EXPRLib::OPShort::GET_FROM_ENV); std::operator<<>(v9, "],"); v35 = a4; v34 = a3; -LABEL_16: + LABEL_16: WXML::EXPRLib::ExprSyntaxTree::RenderAsOps(a2, v34, v35); - goto LABEL_46; + goto LABEL_46; // << "]"; return } if ( std::operator==((int)this, "OP_LIST") ) { @@ -27745,7 +27828,7 @@ LABEL_16: std::operator<<>(v11, "]"); std::operator<<>(v44, ","); if ( this[13] == this[14] ) - goto LABEL_46; + goto LABEL_46; // << "]"; return goto LABEL_15; } if ( std::operator==((int)this, "OP_LIST_CONCAT") ) @@ -27798,7 +27881,7 @@ LABEL_16: v20 = std::operator<<>(v44, (char *)&off_5542FA[2]); v21 = std::operator<<>(v20, WXML::EXPRLib::OPShort::EX_DICT); std::operator<<>(v21, "],"); -LABEL_15: + LABEL_15: v35 = a4; v34 = a3; goto LABEL_16; @@ -27827,6 +27910,7 @@ LABEL_15: } } } + // RenderAsOps - 10 else { v26 = std::operator<<>(v44, (char *)&off_5542FA[2]); @@ -27837,6 +27921,7 @@ LABEL_15: v31 = std::operator<<>(v30, (char *)off_5542FA); std::operator<<>(v31, "]"); std::operator<<>(v44, ","); + // 13 * 4 = 52 for ( n = 0; (this[14] - this[13]) >> 3 > (unsigned int)n; n = (std::ostream::sentry *)((char *)n + 1) ) { if ( n ) @@ -27844,6 +27929,7 @@ LABEL_15: WXML::EXPRLib::ExprSyntaxTree::RenderAsOps(a2, a3, a4); } } + // RenderAsOps - 15 LABEL_46: std::operator<<>(v44, "]"); return 0;