diff --git a/src/include/wxml.h b/src/include/wxml.h index 8e8f1ae..736a8bb 100644 --- a/src/include/wxml.h +++ b/src/include/wxml.h @@ -62,11 +62,22 @@ namespace WXML { class Token { + + /* + Token + 00(起点) B6 BF 00(文件内容) 80 CC BF 00 01 00 00 00(行数?) 01 00 00 00(行长度?) // 15 + 01 00 00 00(pos) 04 00 00 00(size) 00 00 00 00 00(布尔值) F6 97 00 // 31 + 38 F0 97 00 00 00 00 00 00 CC FA 00 CC F0 97 00 // 47(40是32字符串的 缓冲区起点) + 00 00 BF 00 00 00 00 00 FF FF FF FF 54 F0 97 00 // 63 + 00 00 00 00 00 3A 53 00 00 00 00 00 78 F0 97 00 // 79 + 00 00 00 00 00(?) F2 97 00 70 F0 97 00 00 00 00 00 + 00 00 00 00 62 00 00 40 F8 F1 97 00 7A 15 46 00 + */ private: /* data */ - std::string offset_0; // content - bool offset_28; // hasCache toString - std::string offset_32; // chcheData toString + std::string offset_0 = ""; // content + bool offset_28 = false; // hasCache toString + std::string offset_32 = ""; // chcheData toString bool offset_84; // hasCache attrContent std::string offset_88; // chcheData attrContent public: @@ -324,6 +335,7 @@ namespace WXML int offset_44; std::deque> dequeDom; // offset_48 int a1 + 48, _DWORD * a1 + 12 int peekIndex = 0; // offset_100 + WXML::DOMLib::Token offset_104; int offset_128; std::string filePath; public: diff --git a/src/wxml/dom_lib/machine.cpp b/src/wxml/dom_lib/machine.cpp index 8754815..c194380 100644 --- a/src/wxml/dom_lib/machine.cpp +++ b/src/wxml/dom_lib/machine.cpp @@ -378,18 +378,23 @@ namespace WXML { if (this->offset_4 < this->fileLength) { + + WXML::DOMLib::Token token; + token.offset_8 = this->offset_16; + token.offset_12 = this->offset_20; + token.offset_16 = this->offset_4; + token.offset_20 = this->fileLength - this->offset_4; + this->offset_4 = this->fileLength; this->offset_20 = this->lineLength; this->offset_16 = this->lineCount; - - if(WXML::DOMLib::Machine::STT[v45] == 3) + token.offset_24 = WXML::DOMLib::Machine::STT[v45]; + if(token.offset_24 == 3) { - WXML::DOMLib::Token token; a5.push_back(token); } else { - WXML::DOMLib::Token token; a3.push_back(token); } } @@ -433,7 +438,7 @@ namespace WXML this->fileLength = 0; this->offset_4 = 0; this->lineCount = 1; - this->lineLength = 1; + this->lineLength = 0; this->offset_16 = 1; this->offset_20 = 1; this->offset_24 = 1; diff --git a/src/wxml/dom_lib/parser.cpp b/src/wxml/dom_lib/parser.cpp index 683b2de..5503c63 100644 --- a/src/wxml/dom_lib/parser.cpp +++ b/src/wxml/dom_lib/parser.cpp @@ -184,7 +184,7 @@ namespace WXML this->peekIndex++; this->dequeStr.pop_back(); this->dequeDom.pop_back(); - auto v47 = this->Peek(); + v47 = this->Peek(); if (!v47.IsMatch(">")) { throw this->Error("unexpected token", 0); @@ -237,7 +237,9 @@ namespace WXML WXML::DOMLib::Token Parser::Peek() { - return tokenList[this->peekIndex]; + if (this->peekIndex < tokenList.size()) + return tokenList[this->peekIndex]; + return this->offset_104; } WXML::DOMLib::ParseException Parser::Error(char const*, WXML::DOMLib::Token *) diff --git a/src/wxml/dom_lib/token.cpp b/src/wxml/dom_lib/token.cpp index 27f09b3..a74da4e 100644 --- a/src/wxml/dom_lib/token.cpp +++ b/src/wxml/dom_lib/token.cpp @@ -5,16 +5,6 @@ namespace WXML { namespace DOMLib { - /* - Token - 00(起点) B6 BF 00(文件内容) 80 CC BF 00 01 00 00 00(行数?) 01 00 00 00(行长度?) // 15 - 01 00 00 00(pos) 04 00 00 00(size) 00 00 00 00 00(布尔值) F6 97 00 // 31 - 38 F0 97 00 00 00 00 00 00 CC FA 00 CC F0 97 00 // 47 - 00 00 BF 00 00 00 00 00 FF FF FF FF 54 F0 97 00 // 63 - 00 00 00 00 00 3A 53 00 00 00 00 00 78 F0 97 00 // 79 - 00 00 00 00 00(?) F2 97 00 70 F0 97 00 00 00 00 00 - 00 00 00 00 62 00 00 40 F8 F1 97 00 7A 15 46 00 - */ Token::Token() { } @@ -25,18 +15,18 @@ namespace WXML } Token::Token(WXML::DOMLib::Token&& token): - offset_0(token.offset_0), - offset_8(token.offset_8), - offset_12(token.offset_12), - offset_16(token.offset_16), - offset_20(token.offset_20), - offset_28(token.offset_28), - offset_32(token.offset_32), - offset_40(token.offset_40), - offset_56(token.offset_56), - offset_60(token.offset_60), - offset_84(token.offset_84), - offset_88(token.offset_88) + offset_0(token.offset_0), + offset_8(token.offset_8), + offset_12(token.offset_12), + offset_16(token.offset_16), + offset_20(token.offset_20), + offset_28(token.offset_28), + offset_32(token.offset_32), + offset_40(token.offset_40), + offset_56(token.offset_56), + offset_60(token.offset_60), + offset_84(token.offset_84), + offset_88(token.offset_88) { } Token::Token(WXML::DOMLib::Token const& token) diff --git a/test/wcc.disassembly.cpp b/test/wcc.disassembly.cpp index bb11bcb..42dd261 100644 --- a/test/wcc.disassembly.cpp +++ b/test/wcc.disassembly.cpp @@ -10916,12 +10916,14 @@ int __cdecl WXML::Compiler::DealWxsTag( std::string::basic_string(v56, v11); v37 = v12; std::string::_M_dispose(v67); + // a2[2] = a2.offset_8 for ( lpuexcpt = 1; (int)a2[2] > lpuexcpt; ++lpuexcpt ) { std::operator+((int)v57, "\n", (int)v56); v37 = std::string::operator=((unsigned __int8 **)v56, (int)v57); std::string::_M_dispose((void **)v57); } + // a2[3] = a2.offset_12 for ( lpuexcpta = 1; (int)a2[3] > lpuexcpta; ++lpuexcpta ) { std::operator+((int)v58, " ", (int)v56); @@ -10934,7 +10936,10 @@ int __cdecl WXML::Compiler::DealWxsTag( if ( !lpuexcptb ) { WXML::DOMLib::Parser::GetParsed(&v48, (WXML::DOMLib::Parser *)v67); + // a2[2] = a2.offset_8 *a6 = a2[2]; + // a2[5] = a2.offset_20 size + // a2[4] = a2.offset_16 pos if ( (int)((int)a2[5] + (_DWORD)a2[4] - v40) <= 0 ) std::string::basic_string(v59, (char *)&byte_547B7C); else @@ -10942,6 +10947,8 @@ int __cdecl WXML::Compiler::DealWxsTag( std::string::operator=((unsigned __int8 **)a5, (int)v59); std::string::_M_dispose(v59); v41 = 1; + // a5 -> int + // a5 + 4 => offset_4 for ( i = 0; i != *(_DWORD *)(a5 + 4); ++i ) { v14 = *(_BYTE *)(*(_DWORD *)a5 + i) - 9; @@ -10958,6 +10965,10 @@ int __cdecl WXML::Compiler::DealWxsTag( v41 = v15; } } + // for end + + // v48 int + // v48 + 72 => v48.offset_72 v38 = (_DWORD *)(**(_DWORD **)(v48 + 72) + 48); std::string::basic_string(v60, (char *)off_547B7D); v39 = std::map::count(v38, (int)v60); @@ -13630,6 +13641,8 @@ struct _Unwind_Exception *__cdecl WXML::Compiler::CompileLazy( int a21, // "$gdwx" int *a22) // "f_" */ + + // splitedData for ( i = *a7; (WXML::EXPRLib::Parser *)i != v237; i += 24 ) { v222 = operator new(0xD0u); @@ -13647,14 +13660,18 @@ struct _Unwind_Exception *__cdecl WXML::Compiler::CompileLazy( std::string::basic_string((char *)Block + 16, i); Block[10] = 0; Block[11] = 0; - lpuexcpta = (struct _Unwind_Exception *)std::_Rb_tree,std::allocator>>>,std::_Select1st,std::allocator>>>>,std::less,std::allocator,std::allocator>>>>> + lpuexcpta = (struct _Unwind_Exception *)std::_Rb_tree< + std::string, + std::pair,std::allocator>>>, + std::_Select1st,std::allocator>>>>,std::less,std::allocator,std::allocator>>>>> ::_M_get_insert_hint_unique_pos( &v301, lpuexcpta, (int)(Block + 4)); if ( v25 ) { - lpuexcpta = (struct _Unwind_Exception *)std::_Rb_tree,std::allocator>>>,std::_Select1st,std::allocator>>>>,std::less,std::allocator,std::allocator>>>>>::_M_insert_node( + lpuexcpta = (struct _Unwind_Exception *)std::_Rb_tree,std::allocator>>>,std::_Select1st,std::allocator>>>>,std::less,std::allocator,std::allocator>>>>> + ::_M_insert_node( &v301, (int)lpuexcpta, v25, @@ -13689,10 +13706,13 @@ struct _Unwind_Exception *__cdecl WXML::Compiler::CompileLazy( std::string::_M_dispose((void **)&v328); std::string::_M_dispose((void **)&jj); } + // for end + v238 = (WXML::EXPRLib::Parser *)a7[1]; // v238 - end? // a7 splitedData lpuexcptb = (struct _Unwind_Exception *)*a7; std::_Rb_tree_header::_Rb_tree_header(v314); + // 是否splitedData结尾 while ( v238 != lpuexcptb ) { insert_hint_unique_pos = std::_Rb_tree,std::less,std::allocator> @@ -13711,11 +13731,16 @@ struct _Unwind_Exception *__cdecl WXML::Compiler::CompileLazy( std::_Rb_tree_insert_and_rebalance(v259, v221, v275, v314); ++v315; } + + // 下一个 lpuexcptb = (struct _Unwind_Exception *)((char *)lpuexcptb + 24); } + // while end + for ( j = v306; j != v305; - std::_Rb_tree_iterator>>::operator++((int *)&j) ) + std::_Rb_tree_iterator>> + ::operator++((int *)&j) ) { v260 = (char *)j + 16; std::string::substr(&jj, (_DWORD *)j + 4, 2u, *((_DWORD *)j + 5) - 7); @@ -13739,7 +13764,7 @@ struct _Unwind_Exception *__cdecl WXML::Compiler::CompileLazy( { std::string::basic_string((void **)&v328, "__COMMON__"); v34 = std::map>::operator[](&v307, &v328); - // v307[v328].push_back(v260) + // v307[v328].push_back(v260) = v307["__COMMON__"].push_back(v260) std::vector::push_back((int)v34, (int)v260); std::string::_M_dispose((void **)&v328); } @@ -14584,6 +14609,8 @@ LABEL_187: std::_Rb_tree,std::allocator>>>,std::_Select1st,std::allocator>>>>,std::less,std::allocator,std::allocator>>>>>::_M_erase(v302[1]); return v258; } + +// CompileLazy End // 40A40B: variable 'v24' is possibly undefined // 40A5A0: variable 'v25' is possibly undefined // 40A726: variable 'v28' is possibly undefined @@ -21582,6 +21609,9 @@ int __cdecl night::writefile(char *FileName, int a2) //----- (0041EB4C) -------------------------------------------------------- bool __cdecl WXML::DOMLib::AttrsCompartor(int a1, int a2) { + // v298 + 4 -> v298.offset_16; j->first + // v298 + 10 -> v298.offset_40; j->second + // v298 + 25 -> v298.offset_100; j->second.offset_60 return *(_DWORD *)(a1 + 80) < *(_DWORD *)(a2 + 80); } @@ -21751,11 +21781,11 @@ _DWORD *__fastcall WXML::DOMLib::Parser::Peek(_DWORD *a1) int v2; // esi unsigned int v3; // ebx - result = a1 + 26; - v2 = a1[22]; - v3 = a1[25]; - if ( v3 < -1227133513 * ((a1[23] - v2) >> 4) ) - return (_DWORD *)(v2 + 112 * v3); // 112 ascii -> 'p' + result = a1 + 26; // + v2 = a1[22]; // offset_88 + v3 = a1[25]; // offset_100 + if ( v3 < -1227133513 * ((a1[23]/*offset_92*/ - v2) >> 4) ) + return (_DWORD *)(v2 + 112 * v3); return result; } @@ -21777,8 +21807,10 @@ int __cdecl WXML::DOMLib::WXMLDom::Error(int a1, int *a2, int a3, int *a4, int * std::basic_stringstream,std::allocator>::basic_stringstream((int)v14); v5 = std::operator<<((std::ostream::sentry *)v15, a2); std::operator<<>(v5, ":"); + // WXML::DOMLib::Token v6 = (std::ostream::sentry *)std::ostream::operator<<(*(_DWORD *)(a3 + 8)); std::operator<<>(v6, ":"); + // WXML::DOMLib::Token v7 = (std::ostream::sentry *)std::ostream::operator<<(*(_DWORD *)(a3 + 12)); std::operator<<>(v7, ":"); if ( a4[1] ) @@ -22169,6 +22201,7 @@ int __thiscall WXML::DOMLib::WXMLDom::AddTestAttr(_DWORD *this, int *a2, int a3, v6 = std::operator<<>(v5, ","); v7 = std::ostream::_M_insert(v6, 1); v8 = std::operator<<>(v7, ","); + // 66 * 4 = 264; 67 * 4 = 268 v9 = std::ostream::_M_insert(v8, this[66], this[67]); } else @@ -22317,7 +22350,7 @@ void __fastcall WXML::DOMLib::Parser::ATTR(WXML::DOMLib::Parser *a1) && !WXML::DOMLib::Token::IsMatch((int)v19, (WXML::DOMLib::Token *)"/>", v13) ) { if ( !v19[0] ) - goto LABEL_12; + goto LABEL_12; // 抛异常 for ( i = 0; v20 > i; ++i ) { v3 = *(_BYTE *)(v19[4] + *(_DWORD *)v19[0] + i); @@ -23011,9 +23044,11 @@ void __usercall WXML::DOMLib::Parser::DOM(_DWORD *a1@, WXML::DOMLib::Parser WXML::DOMLib::ParseException::~ParseException); } ++a1[25]; + // v5 = v4 v5 = WXML::DOMLib::Token::ToString[abi:cxx11]((int)v43); + // offset_32 v6 = (char *)a1[8]; - v35 = a1 + 2; + v35 = a1 + 2; // offset_8 if ( v6 == (char *)(a1[10] - 24) ) { std::deque::_M_push_back_aux((int)v35, (int)v5); @@ -23026,11 +23061,14 @@ void __usercall WXML::DOMLib::Parser::DOM(_DWORD *a1@, WXML::DOMLib::Parser Blocka = operator new(0x128u); WXML::DOMLib::WXMLDom::WXMLDom((int)Blocka); zcc::shared_ptr::shared_ptr(Blocka); + // v4 v7 = WXML::DOMLib::Token::ToString[abi:cxx11]((int)v43); std::string::_M_assign((int)v47, (int)v7); + // 4 * 6 = 24 std::string::_M_assign((int)(v47 + 6), (int)v47); + // 21 * 4 = 84 WXML::DOMLib::Token::operator=((int)(v47 + 21), (int)v43); - Block = a1 + 12; + Block = a1 + 12; // offset_48 v8 = std::deque>::back(a1 + 12); std::vector>::push_back((_DWORD *)(*(_DWORD *)v8 + 72), &v47); std::deque>::push_back((int)(a1 + 12), &v47); @@ -23141,6 +23179,7 @@ LABEL_27: if ( v16 ) { v17 = 0; + // *v16 content buf ptr v18 = *v16 + v43[4]; while ( v43[5] > v17 ) { @@ -23233,25 +23272,34 @@ int __userpurge WXML::DOMLib::Parser::Parse@( volatile signed __int32 *v16; // [esp+78h] [ebp-50h] BYREF void *v17; // [esp+98h] [ebp-30h] BYREF + // 清空deque while ( *(_DWORD *)(a1 + 16) != *(_DWORD *)(a1 + 32) ) std::deque::pop_back((_DWORD *)(a1 + 8)); while ( *(_DWORD *)(a1 + 72) != *(_DWORD *)(a1 + 56) ) std::deque>::pop_back((_DWORD *)(a1 + 48)); + + // a1后偏移 100个字节 *(_DWORD *)(a1 + 100) = 0; + // a1后偏移 88个字节 begin v10 = *(char **)(a1 + 88); + // a1后偏移 92个字节 end v7 = *(char **)(a1 + 92); if ( v10 != v7 ) { Block = *(char **)(a1 + 88); do { + // 销毁? WXML::DOMLib::Token::~Token((int)Block); Block += 112; } + // v7 end != Block current while ( v7 != Block ); *(_DWORD *)(a1 + 92) = v10; } + // a1后偏移128字节 *(_DWORD *)(a1 + 128) = 4; + // a1后偏移328字节 std::string::_M_assign(a1 + 328, a5); WXML::DOMLib::Tokenizer::Tokenizer(&v15, Str, a5); Tokens = WXML::DOMLib::Tokenizer::GetTokens(&v15, (_DWORD *)(a1 + 88), a4, a6); @@ -24301,16 +24349,39 @@ int __thiscall WXML::DOMLib::WXMLDom::RenderNonDefine( char v349[12]; // [esp+2BCh] [ebp-CCh] BYREF _DWORD v350[47]; // [esp+2C8h] [ebp-C0h] BYREF + /* + 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) + */ + // this int + // this + 28 => this.offset_28 if ( a13 && *(_DWORD *)(this + 28) ) { + // a6 + 8 => a6.offset_8 v294 = std::operator<<>((std::ostream::sentry *)(a6 + 8), "cs.push(\""); WXML::Rewrite::ToStringCode((int)v347, a2); v15 = std::operator<<(v294, v347); v16 = std::operator<<>(v15, ":"); + // this + 24 => this.offset_24 v17 = std::operator<<(v16, (int *)(this + 24)); std::operator<<>(v17, ":"); + // this + 92 => this.offset_92 v18 = (std::ostream::sentry *)std::ostream::operator<<(*(_DWORD *)(this + 92)); std::operator<<>(v18, ":"); + // this + 96 => this.offset_96 v19 = (std::ostream::sentry *)std::ostream::operator<<(*(_DWORD *)(this + 96)); v20 = std::operator<<>(v19, "\")"); std::operator<<>(v20, a12); @@ -24319,6 +24390,8 @@ int __thiscall WXML::DOMLib::WXMLDom::RenderNonDefine( Str1 = std::operator==(this, "TEXTNODE"); if ( Str1 ) { + // this int + // this.offset_140 v21 = *(_DWORD *)(this + 140); if ( v21 == -3 ) { @@ -24356,7 +24429,7 @@ LABEL_68: LABEL_69: std::operator<<>(v87, a12); goto LABEL_169; - } + } // TEXTNODE end if ( !(unsigned __int8)std::operator!=(this, "wx-define") || !(unsigned __int8)std::operator!=(this, "wx-import") || !(unsigned __int8)std::operator!=(this, "import") @@ -24364,22 +24437,28 @@ LABEL_69: { goto LABEL_169; } + + if ( std::operator==(this, "wx-repeat") ) { - std::string::basic_string(v312, "items"); + std::string::basic_string(v312, "items"); // target1 + // this int v295 = (std::ostream::sentry *)(this + 48); v275 = (std::ostream::sentry *)(this + 52); - if ( (_DWORD *)(this + 52) == std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::find( + if ( (_DWORD *)(this + 52) == std::_Rb_tree,std::_Select1st>,std::less,std::allocator>> + ::find( (_DWORD *)(this + 48), (int)v312) ) std::string::operator=((unsigned int *)v312, "wx:for-items"); - std::string::basic_string(v313, "index"); - if ( v275 == (std::ostream::sentry *)std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::find( + 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) ) std::string::operator=((unsigned int *)v313, "wx:for-index"); - std::string::basic_string(v314, "item"); - if ( v275 == (std::ostream::sentry *)std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::find( + 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) ) std::string::operator=((unsigned int *)v314, "wx:for-item"); @@ -24393,9 +24472,10 @@ LABEL_69: v320 = 0; v322 = 0; v323 = 0; - if ( v275 == (std::ostream::sentry *)std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::find( - v295, - (int)v312) ) + if ( v275 == (std::ostream::sentry *)std::_Rb_tree,std::_Select1st>,std::less,std::allocator>> + ::find( + v295, // this + 48 + (int)v312) ) // target1 { std::string::_M_dispose((void **)&v321); std::string::_M_dispose((void **)&v318); @@ -24406,9 +24486,10 @@ LABEL_69: std::string::_M_dispose(v312); return 0; } - if ( v275 == (std::ostream::sentry *)std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::find( - v295, - (int)v313) ) + if ( v275 == (std::ostream::sentry *)std::_Rb_tree,std::_Select1st>,std::less,std::allocator>> + ::find( + v295, // this + 48 + (int)v313) ) // target2 { std::string::operator=((unsigned int *)&v318, "index"); } @@ -24418,9 +24499,10 @@ LABEL_69: v33 = WXML::DOMLib::Token::ToAttrContent[abi:cxx11]((int)v32); std::string::_M_assign((int)&v318, v33); } - if ( v275 == (std::ostream::sentry *)std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::find( - v295, - (int)v314) ) + if ( v275 == (std::ostream::sentry *)std::_Rb_tree,std::_Select1st>,std::less,std::allocator>> + ::find( + v295, // this + 48 + (int)v314) ) // target3 { std::string::operator=((unsigned int *)&v321, "item"); } @@ -24430,53 +24512,60 @@ LABEL_69: v35 = WXML::DOMLib::Token::ToAttrContent[abi:cxx11]((int)v34); std::string::_M_assign((int)&v321, v35); } - if ( v275 != (std::ostream::sentry *)std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::find( + + if ( v275 != (std::ostream::sentry *)std::_Rb_tree,std::_Select1st>,std::less,std::allocator>> + ::find( v295, - (int)v313) + (int)v313) //target2 + // +14 -> offset_14 * 4 -> offset_56 && *((_DWORD *)std::map::operator[](v295, (int)v313) + 14) == -3 && (a14 & 1) == 0 ) { v250 = __cxa_allocate_exception(0x18u); + // char * + 60 -> offset 60 lpuexcpta = (int *)(std::map::operator[](v295, (int)v313) + 60); v36 = std::map::operator[](v295, (int)v313); WXML::DOMLib::WXMLDom::Error((int)v250, a2, (int)v36, (int *)v313, lpuexcpta); __cxa_throw( v250, - (struct type_info *)&`typeinfo for'WXML::DOMLib::RenderException, + (struct type_info *)&`typeinfo for WXML::DOMLib::RenderException, WXML::DOMLib::RenderException::~RenderException); } - if ( v275 != (std::ostream::sentry *)std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::find( + + if ( v275 != (std::ostream::sentry *)std::_Rb_tree,std::_Select1st>,std::less,std::allocator>> + ::find( v295, (int)v315) && *((_DWORD *)std::map::operator[](v295, (int)v315) + 14) == -3 && (a14 & 1) == 0 ) { v249 = __cxa_allocate_exception(0x18u); + // char * + 60 -> offset 60 lpuexcptb = (int *)(std::map::operator[](v295, (int)v315) + 60); v37 = std::map::operator[](v295, (int)v315); WXML::DOMLib::WXMLDom::Error((int)v249, a2, (int)v37, (int *)v315, lpuexcptb); __cxa_throw( v249, - (struct type_info *)&`typeinfo for'WXML::DOMLib::RenderException, + (struct type_info *)&`typeinfo for WXML::DOMLib::RenderException, WXML::DOMLib::RenderException::~RenderException); } if ( !v319 ) - std::string::operator=((unsigned int *)&v318, "index"); + std::string::operator=((unsigned int *)&v318, "index"); // target2_1 if ( !v322 ) - std::string::operator=((unsigned int *)&v321, "item"); + std::string::operator=((unsigned int *)&v321, "item"); // target3_1 v325 = 0; - v324 = (int)&v326; + v324 = (int)&v326; // name1 LOBYTE(v326) = 0; WXML::NameAllocator::GetNextName(a7, (int)&v324); - v327 = (int)v329; + v327 = (int)v329; // name2 v328 = 0; v329[0] = 0; WXML::NameAllocator::GetNextName(a7, (int)&v327); - v330 = v332; + v330 = v332; // name3 v331 = 0; LOBYTE(v332[0]) = 0; WXML::NameAllocator::GetNextName(a7, (int)&v330); - v333 = (int)v335; + v333 = (int)v335; // name4 v334 = 0; v335[0] = 0; WXML::NameAllocator::GetNextName(a7, (int)&v333); @@ -24502,6 +24591,11 @@ LABEL_69: v347); std::string::_M_dispose((void **)&Str); std::string::_M_dispose((void **)v347); + + //---------- + // v295 -> this + 48 + // v312 target1 + // 14 * 4 = 56 if ( *((_DWORD *)std::map::operator[](v295, (int)v312) + 14) == -3 ) { v247 = __cxa_allocate_exception(0x18u); @@ -24510,23 +24604,25 @@ LABEL_69: WXML::DOMLib::WXMLDom::Error((int)v247, a2, (int)v38, (int *)v312, lpuexcptc); __cxa_throw( v247, - (struct type_info *)&`typeinfo for'WXML::DOMLib::RenderException, + (struct type_info *)&`typeinfo for WXML::DOMLib::RenderException, WXML::DOMLib::RenderException::~RenderException); } if ( *((_DWORD *)std::map::operator[](v295, (int)v312) + 14) == -1 ) { v248 = __cxa_allocate_exception(0x18u); std::string::basic_string((void **)v347, "value not set"); + // this int WXML::DOMLib::WXMLDom::Error((int)v248, a2, this + 84, (int *)v312, v347); std::string::_M_dispose((void **)v347); __cxa_throw( v248, - (struct type_info *)&`typeinfo for'WXML::DOMLib::RenderException, + (struct type_info *)&`typeinfo for WXML::DOMLib::RenderException, WXML::DOMLib::RenderException::~RenderException); } if ( !a13 ) goto LABEL_57; - if ( v275 == (std::ostream::sentry *)std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::find( + if ( v275 == (std::ostream::sentry *)std::_Rb_tree,std::_Select1st>,std::less,std::allocator>> + ::find( v295, (int)v315) ) { @@ -24536,7 +24632,7 @@ LABEL_69: v256 = std::operator<<>((std::ostream::sentry *)(a6 + 8), "_wp('"); WXML::Rewrite::ToStringCode((int)v347, a2); v39 = std::operator<<(v256, v347); - v40 = std::operator<<>(v39, ":"); + v40 = std::operator<<>(v39, ":"); // v41 = std::operator<<(v40, (int *)(this + 24)); std::operator<<>(v41, ":"); v42 = (std::ostream::sentry *)std::ostream::operator<<(*(_DWORD *)(this + 92)); @@ -24635,6 +24731,7 @@ LABEL_191: } } } + // else end if ( !WXML::DOMLib::Token::IsValidVariableName((char **)&v336) ) { if ( v337 ) @@ -24651,7 +24748,7 @@ LABEL_191: goto LABEL_56; } } -LABEL_189: + LABEL_189: if ( !std::operator==((int)&v336, "*this") ) { v292 = std::operator<<>((std::ostream::sentry *)(a6 + 8), "_wp('"); @@ -24676,6 +24773,24 @@ LABEL_189: LABEL_56: std::string::_M_dispose((void **)&v339); std::string::_M_dispose((void **)&v336); + + /* + 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_57: v241 = (std::ostream::sentry *)(a6 + 8); if ( *(_BYTE *)(this + 256) ) @@ -24693,7 +24808,7 @@ LABEL_57: v52 = std::map::operator[](v295, (int)v312); v53 = (std::ostream::sentry *)std::ostream::operator<<(*((_DWORD *)v52 + 14)); v54 = std::operator<<>(v53, ","); - v55 = std::operator<<(v54, &v324); + v55 = std::operator<<(v54, &v324); // name1 v56 = std::operator<<>(v55, ","); v57 = std::operator<<(v56, a8); v58 = std::operator<<>(v57, ","); @@ -24703,11 +24818,11 @@ LABEL_57: v62 = std::operator<<>(v61, ","); v63 = std::operator<<(v62, a5); v64 = std::operator<<>(v63, ",'"); - v65 = std::operator<<(v64, &v321); + v65 = std::operator<<(v64, &v321); // target3_1 v66 = std::operator<<>(v65, "','"); - v67 = std::operator<<(v66, &v318); + v67 = std::operator<<(v66, &v318); // target2_1 v278 = std::operator<<>(v67, "','"); - v68 = std::map::operator[](v295, (int)v315); + v68 = std::map::operator[](v295, (int)v315); // v315 wxKey v69 = (int *)WXML::DOMLib::Token::ToAttrContent[abi:cxx11]((int)v68); v70 = std::operator<<(v278, v69); v71 = std::operator<<>(v70, "')"); @@ -24724,7 +24839,7 @@ LABEL_57: std::string::_M_dispose(v313); v72 = v312; goto LABEL_84; - } + } // wx-repeat end if ( std::operator==(this, "block") ) { WXML::DOMLib::WXMLDom::RenderChildren(a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); @@ -24735,10 +24850,12 @@ LABEL_57: if ( std::operator==(this, "include") ) { std::string::basic_string((void **)v347, (char *)off_5539C8); - v279 = (std::ostream::sentry *)std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::find( + v279 = (std::ostream::sentry *)std::_Rb_tree,std::_Select1st>,std::less,std::allocator>> + ::find( v296, (int)v347); std::string::_M_dispose((void **)v347); + // == end if ( v279 == (std::ostream::sentry *)Str1a ) goto LABEL_169; std::string::basic_string((void **)v347, (char *)off_5539C8); @@ -24748,10 +24865,12 @@ LABEL_57: { v251 = __cxa_allocate_exception(0x18u); std::string::basic_string((void **)&Str, (char *)off_5539C8); + // 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); v73 = std::map::operator[](v296, v342); + // v296["src"] WXML::DOMLib::WXMLDom::Error((int)v251, a2, (int)v73, v347, lpuexcptd); std::string::_M_dispose((void **)v342); std::string::_M_dispose((void **)v347); @@ -24760,7 +24879,7 @@ LABEL_57: LABEL_9: __cxa_throw( v22, - (struct type_info *)&`typeinfo for'WXML::DOMLib::RenderException, + (struct type_info *)&`typeinfo for WXML::DOMLib::RenderException, WXML::DOMLib::RenderException::~RenderException); } std::operator<<>((std::ostream::sentry *)(a6 + 8), "_ic(x["); @@ -24796,7 +24915,8 @@ LABEL_9: if ( v270 ) { std::string::basic_string((void **)v347, "is"); - v281 = (std::ostream::sentry *)std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::find( + v281 = (std::ostream::sentry *)std::_Rb_tree,std::_Select1st>,std::less,std::allocator>> + ::find( v296, (int)v347); std::string::_M_dispose((void **)v347); @@ -24881,7 +25001,8 @@ LABEL_9: LOBYTE(v341[0]) = 0; WXML::NameAllocator::GetNextName(a7, (int)&v339); std::string::basic_string((void **)&Str, "data"); - if ( Str1a != (char *)std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::find( + if ( Str1a != (char *)std::_Rb_tree,std::_Select1st>,std::less,std::allocator>> + ::find( v296, (int)&Str) ) { @@ -24917,7 +25038,7 @@ LABEL_9: std::string::_M_dispose((void **)&Str); __cxa_throw( v252, - (struct type_info *)&`typeinfo for'WXML::DOMLib::RenderException, + (struct type_info *)&`typeinfo for WXML::DOMLib::RenderException, WXML::DOMLib::RenderException::~RenderException); } v122 = std::operator<<>(v282, "var "); @@ -24954,6 +25075,7 @@ LABEL_9: v146 = std::operator<<(v145, a10); v147 = std::operator<<>(v146, ")"); std::operator<<>(v147, a12); + // v148 = std::operator<<(v282, a10); v149 = std::operator<<>(v148, ".f=cur_globalf"); std::operator<<>(v149, a12); @@ -24989,24 +25111,30 @@ LABEL_84: v324 = 0; v325 = 0; v326 = 0; + // int j; for ( j = *(_DWORD *)(this + 60); ; j = std::_Rb_tree_increment((int)v298) ) { v298 = (int *)j; if ( (char *)j == Str1a ) break; + // offset_96 v160 = *(_DWORD *)(j + 96); if ( v160 == -3 ) { if ( (a14 & 1) == 0 ) { v254 = __cxa_allocate_exception(0x18u); + // v298 + 4 -> v298.offset_16; j->first + // v298 + 10 -> v298.offset_40; j->second + // v298 + 25 -> v298.offset_100; j->second.offset_60 WXML::DOMLib::WXMLDom::Error((int)v254, a2, (int)(v298 + 10), v298 + 4, v298 + 25); __cxa_throw( v254, - (struct type_info *)&`typeinfo for'WXML::DOMLib::RenderException, + (struct type_info *)&`typeinfo for WXML::DOMLib::RenderException, WXML::DOMLib::RenderException::~RenderException); } } + // v298[15] -> v298.offset_60 else if ( v160 == -1 && v298[15] > 0 ) { v253 = __cxa_allocate_exception(0x18u); @@ -25015,24 +25143,33 @@ LABEL_84: std::string::_M_dispose((void **)v347); __cxa_throw( v253, - (struct type_info *)&`typeinfo for'WXML::DOMLib::RenderException, + (struct type_info *)&`typeinfo for WXML::DOMLib::RenderException, WXML::DOMLib::RenderException::~RenderException); } + // v298[4] -> v298.offset_16; j->first v161 = v298[4]; - if ( *(_BYTE *)v161 != 119 - || *(_BYTE *)(v161 + 1) != 120 - || (v162 = *(_BYTE *)(v161 + 2), v162 != 58) && v162 != 45 + if ( *(_BYTE *)v161 != 'w'/*119*/ + || *(_BYTE *)(v161 + 1) != 'x'/*120*/ + || (v162 = *(_BYTE *)(v161 + 2), v162 != ':'/*58*/) && v162 != '-'/*45*/ || !__stricmp((const char *)v161, "wx:scope-data") ) { - std::string::basic_string((char *)v347, (int)(v298 + 4)); - WXML::DOMLib::Token::Token((int)v350, (WXML::DOMLib::Token *)(v298 + 10), v243); + // v298 + 4 -> v298.offset_16; j->first + // v298 + 10 -> v298.offset_40; j->second + // v298 + 25 -> v298.offset_100; j->second.offset_60 + std::string::basic_string((char *)v347, (int)(v298 + 4)); // j->first + WXML::DOMLib::Token::Token((int)v350, (WXML::DOMLib::Token *)(v298 + 10)/*j->second*/, v243); std::vector>::emplace_back>( &v324, v347); std::pair::~pair((void **)v347); } } - std::sort<__gnu_cxx::__normal_iterator *,std::vector>>,bool (*)(std::pair const&,std::pair const&)>( + std::sort< + __gnu_cxx::__normal_iterator *, + std::vector>>, + bool (*)( + std::pair const&, + std::pair const&)>( (char *)v324, v325, (int (__cdecl *)(int, int))WXML::DOMLib::AttrsCompartor); @@ -25071,20 +25208,25 @@ LABEL_84: std::string::substr(&v336, Str1b, 6u, 0xFFFFFFFF); v284 = (std::ostream::sentry *)v332[0]; v303 = &v331; + while ( v284 ) { + // (int)v284 + 16 -> (int)v284 offset_16 v167 = (unsigned __int8)std::operator<((int)v284 + 16, (int)&v336) == 0; v168 = v303; + // (_DWORD *)v284 + 3 -> v284 offset_12 v169 = (std::ostream::sentry *)*((_DWORD *)v284 + 3); if ( v167 ) { + // (_DWORD *)v284 + 2 -> v284 offset_8 v169 = (std::ostream::sentry *)*((_DWORD *)v284 + 2); if ( v167 ) v168 = (int *)v284; } v284 = v169; v303 = v168; - } + } // end while + if ( v303 != &v331 ) { v167 = (unsigned __int8)std::operator<((int)&v336, (int)(v303 + 4)) == 0; @@ -25138,7 +25280,8 @@ LABEL_84: std::string::_M_dispose((void **)&v339); } std::basic_stringstream,std::allocator>::~basic_stringstream((int)v347); - std::_Rb_tree,std::less,std::allocator>::_M_erase(v332[0]); + std::_Rb_tree,std::less,std::allocator> + ::_M_erase(v332[0]); v305 = (std::ostream::sentry *)(a6 + 8); if ( (unsigned int)&v325[-v324] <= 0x88 ) { @@ -25156,12 +25299,13 @@ LABEL_84: Str = v346; v345 = 0; v346[0] = 0; - if ( !strncmp(Str1e, "data-", 5u) || std::string::find((int *)ii, 58, 0) != (char *)-1 ) + if ( !strncmp(Str1e, "data-", 5u) || std::string::find((int *)ii, ':'/*58*/, 0) != (char *)-1 ) { std::string::_M_assign((int)&Str, (int)ii); if ( !strncmp(Str1e, "generic:", 8u) ) { std::operator<<>(v305, "var $tmp="); + // (_DWORD *)ii + 11 -> ii.offset_44 if ( *((_DWORD *)ii + 11) ) { std::operator<<>(v305, "grb(z["); @@ -25250,7 +25394,7 @@ LABEL_158: v342[0] = (int)&v343; v342[1] = 0; v343 = 0; - if ( !strncmp(Str1c, "data-", 5u) || std::string::find(jj, 58, 0) != (char *)-1 ) + if ( !strncmp(Str1c, "data-", 5u) || std::string::find(jj, ':'/*58*/, 0) != (char *)-1 ) { std::string::_M_assign((int)v342, (int)jj); if ( !strncmp(Str1c, "generic:", 8u) ) @@ -25291,6 +25435,7 @@ LABEL_158: std::string::_M_dispose((void **)v342); v259 = ","; } + // a6 << "],["; std::operator<<>(v305, (char *)off_553DC7); v287 = 0; v181 = (char *)&byte_5537CA; @@ -26115,6 +26260,7 @@ int __thiscall WXML::DOMLib::WXMLDom::RenderMeAsFunction( { v18 = std::operator<<(lpuexcpt, a12); std::operator<<>(v18, (char *)off_553FDC); + // 4 * 62 = 248 v75 = (_DWORD *)this[62]; std::string::basic_string((char *)&v79, (int)a2); StrID = WXML::DOMLib::StrCache::GetStrID(v75, (int)&v79); @@ -26290,13 +26436,20 @@ int __fastcall WXML::DOMLib::Machine::Reset(_DWORD *a1) { int result; // eax + // this.offset_4 a1[1] = 0; result = 0; + // this.offset_0 *a1 = 0; + // this.offset_8 a1[2] = 1; + // this.offset_12 a1[3] = 0; + // this.offset_16 a1[4] = 1; + // this.offset_20 a1[5] = 1; + // this.offset_24 a1[6] = 1; return result; } @@ -26780,11 +26933,13 @@ int __thiscall WXML::DOMLib::Machine::Feed( ++*((_DWORD *)lpuexcpt + 2); *((_DWORD *)v6 + 3) = 0; } - // 喂入的字符 + // v44 喂入的字符 v44 = (unsigned __int8)v46; do { + // offset_24 v45 = *((_DWORD *)lpuexcpt + 6); + // v44 喂入的字符 v46 = WXML::DOMLib::Machine::TT[257 * v45 + v44]; if ( !v46 ) { @@ -26793,7 +26948,7 @@ int __thiscall WXML::DOMLib::Machine::Feed( { std::basic_stringstream,std::allocator>::basic_stringstream((int)&v49); std::operator<<>((std::ostream::sentry *)&v51, "BAD STATE MACHINE! AT INPUT "); - v7 = (std::ostream::sentry *)std::ostream::operator<<(*((_DWORD *)lpuexcpt + 6)); + v7 = (std::ostream::sentry *)std::ostream::operator<<(*((_DWORD *)lpuexcpt + 6)); // offset 4 * 6 = 24 v8 = std::operator<<>(v7, " "); std::operator<<>(v8, a2); std::stringbuf::str((int)v48, (int)&v52); @@ -26807,18 +26962,18 @@ LABEL_12: if ( v46 < 0 ) { std::basic_stringstream,std::allocator>::basic_stringstream((int)&v49); - v9 = std::operator<<((std::ostream::sentry *)&v51, (int *)lpuexcpt + 7); + v9 = std::operator<<((std::ostream::sentry *)&v51, (int *)lpuexcpt + 7); // 文件路径,偏移:4 * 7 = 28 std::operator<<>(v9, ":"); // inc - v10 = (std::ostream::sentry *)std::ostream::operator<<(*((_DWORD *)lpuexcpt + 2)); + v10 = (std::ostream::sentry *)std::ostream::operator<<(*((_DWORD *)lpuexcpt + 2)); // 行数,偏移:4 * 2 = 8 std::operator<<>(v10, ":"); // lineLength - v11 = (std::ostream::sentry *)std::ostream::operator<<(*((_DWORD *)lpuexcpt + 3)); + v11 = (std::ostream::sentry *)std::ostream::operator<<(*((_DWORD *)lpuexcpt + 3)); // 行长度,偏移:4 * 3 = 12 v12 = std::operator<<>(v11, ": "); if ( a2 ) { v13 = std::operator<<>(v12, "unexpected character `"); - v14 = std::operator<<>(v13, a2); + v14 = std::operator<<>(v13, a2); // 喂入的字符 std::operator<<>(v14, "`"); } else @@ -26826,26 +26981,36 @@ LABEL_12: std::operator<<>(v12, "unexpected end"); } std::stringbuf::str((int)v48, (int)&v52); - goto LABEL_12; + goto LABEL_12; // 错误,返回 } v15 = lpuexcpt; v16 = _bittest(&v46, 0x15u); + // v46 从TT中取出的 *((_DWORD *)lpuexcpt + 6) = (unsigned __int16)v46; - if ( v16 ) + if ( v16 ) // if(_bittest(&v46, 0x15u)) { + // v15 this 基址 + // this->offset_4 v17 = *((_DWORD *)v15 + 1); + // fileLength > (v17 offset_4) if ( *(_DWORD *)v15 > v17 ) { + // offset_4存起来,有用;偏移 4 * 1 = 4 v53 = *((_DWORD *)v15 + 1); v57 = v59; v61 = v63; v65 = v67; + // v18 外面不会用;偏移 4 * 4 = 16 v18 = *((_DWORD *)v15 + 4); + // offset_4++; v17是offset_4的值 *((_DWORD *)v15 + 1) = v17 + 1; + // v18是offset_16的值 v51 = v18; + // offset_20 暂存,有用;偏移 4 * 5 = 20 v19 = *((_DWORD *)v15 + 5); v49 = 0; v52 = v19; + // offset_20++ *((_DWORD *)v15 + 5) = v19 + 1; v50 = 0; v58 = 0; @@ -26860,60 +27025,82 @@ LABEL_12: v54 = 1; v55 = 0; std::vector::push_back(a3, (WXML::DOMLib::Token *)&v49); + // a3.push_back(); WXML::DOMLib::Token::~Token((int)&v49); } } + // v46 从TT中取出的 if ( _bittest(&v46, 0x16u) ) { - //112 ascii -> 'p' + // int a5; a5+4 -> a5.offset_4 end WXML::DOMLib::Token::Token((int)&v49, (WXML::DOMLib::Token *)(*(_DWORD *)(a5 + 4) - 112), v43); + // 4 a5.offset_4 v20 = *(_DWORD *)(a5 + 4) - 112; + // 4 a5.offset_4 *(_DWORD *)(a5 + 4) = v20; WXML::DOMLib::Token::~Token(v20); v21 = lpuexcpt; + // offset 4 * 4 = offset_16 *((_DWORD *)lpuexcpt + 4) = v51; + // offset 4 * 5 = offset_20 *((_DWORD *)v21 + 5) = v52; + // offset 4 * 1 = offset_4 *((_DWORD *)v21 + 1) = v53; WXML::DOMLib::Token::~Token((int)&v49); } } while ( _bittest(&v46, 0x14u) ); + + // v46 从TT中取出的 if ( _bittest(&v46, 0x11u) ) { - v22 = *(_DWORD *)lpuexcpt; - v23 = *((_DWORD *)lpuexcpt + 1); + v22 = *(_DWORD *)lpuexcpt; // offset_0 + v23 = *((_DWORD *)lpuexcpt + 1); // offset_4 // offset_1 < offset_0 if ( v23 < *(_DWORD *)lpuexcpt ) { - // lineLength + // lineLength this.offset_12 v24 = *((_DWORD *)lpuexcpt + 3); - v49 = 0; + v49 = 0; // v49.offset_0 v57 = v59; v61 = v63; v65 = v67; - v50 = 0; + v50 = 0; // v50 -> v49.offset_4 + // this.offset_16 v25 = *((_DWORD *)lpuexcpt + 4); v67[0] = 0; v58 = 0; + // v51 -> v49.offset_8 v51 = v25; v59[0] = 0; + // this.offset_20 v26 = *((_DWORD *)lpuexcpt + 5); v63[0] = 0; v62 = 0; + // v52 -> v49.offset_12 v52 = v26; v66 = 0; + // v54 = this.offset_0(fileLength) - this.offset_4 + // v54 -> v49.offset_20 v54 = v22 - v23; v27 = lpuexcpt; + // v56 -> v49.offset_28 v56 = 0; + // this.offset_4 = this.offset_0(fileLength) *((_DWORD *)lpuexcpt + 1) = v22; + // this.offset_8 v28 = *((_DWORD *)v27 + 2); + // this.offset_20 = this.offset_12(lineLength) *((_DWORD *)v27 + 5) = v24; + // this.offset_16 = this.offset_8(lineCount) *((_DWORD *)v27 + 4) = v28; v64 = 0; - // v45 offset_6 + // v45 offset_24 v29 = WXML::DOMLib::Machine::STT[v45]; + // v53 -> v49.offset_16 v53 = v23; v60 = -1; + // v55 -> v49.offset_24 v55 = v29; if ( v29 == 3 ) v30 = a5; @@ -26926,7 +27113,9 @@ LABEL_12: // this v31 = lpuexcpt; + // offset_0 + 1 v32 = *(_DWORD *)lpuexcpt + 1; + // offset_12 + 1 v33 = *((_DWORD *)lpuexcpt + 3) + 1; v16 = _bittest(&v46, 0x12u); *(_DWORD *)lpuexcpt = v32; @@ -26938,21 +27127,23 @@ LABEL_12: v57 = v59; v61 = v63; v65 = v67; - // offset_4 + // offset_16 v35 = *((_DWORD *)v31 + 4); v49 = 0; v51 = v35; - // offset_5 + // offset_20 v36 = *((_DWORD *)v31 + 5); v50 = 0; v52 = v36; - v37 = *((_DWORD *)v31 + 1); - // offset_1 - *((_DWORD *)v31 + 1) = v32; - v38 = *((_DWORD *)v31 + 2); - // offset_5 - *((_DWORD *)v31 + 5) = v33; // offset_4 + v37 = *((_DWORD *)v31 + 1); + // offset_4 + *((_DWORD *)v31 + 1) = v32; + // offset_8 + v38 = *((_DWORD *)v31 + 2); + // offset_20 + *((_DWORD *)v31 + 5) = v33; + // offset_16 *((_DWORD *)v31 + 4) = v38; v58 = 0; v39 = WXML::DOMLib::Machine::STT[v45]; @@ -27027,11 +27218,14 @@ int __thiscall WXML::DOMLib::Tokenizer::GetTokens(_DWORD *this, _DWORD *a2, int { v7 = 0; v6 = 0; + // v7在递增 while ( *(_DWORD *)(*this + 4) > v7 ) { + // v6 Feed失败 if ( v6 ) return v6; v13 = v7; + // v14 没用; v5 machine v14 = v5; v8 = WXML::DOMLib::Machine::Feed( v5, @@ -27041,13 +27235,18 @@ int __thiscall WXML::DOMLib::Tokenizer::GetTokens(_DWORD *this, _DWORD *a2, int (int)a4, 0); v5 = v14; + // v8 中转 v6 = v8; v7 = v13 + 1; } if ( !v6 ) { + // 上面Feed是成功的 v9 = 0; + // 喂了一个0 v15 = WXML::DOMLib::Machine::Feed(v5, 0, (int)a2, (unsigned __int8 **)a3, (int)a4, 0); + // std::vector a2 a4 + // a2[1] - *a2 = a2[1] - a2[0] = 起点与终点地址差 while ( -1227133513 * ((a2[1] - *a2) >> 4) > v9 ) { v10 = 112 * v9++; @@ -28252,8 +28451,8 @@ int __thiscall WXML::EXPRLib::Parser::Parse(int this, char **a2, int a3, int a4, std::deque>::pop_back((_DWORD *)this); while ( *(_DWORD *)(this + 64) != *(_DWORD *)(this + 48) ) std::deque>::pop_back((_DWORD *)(this + 40)); - if ( !(_BYTE)`guard variable for'WXML::EXPRLib::TransitTable::GetInstance(void)::ret - && __cxa_guard_acquire(&`guard variable for'WXML::EXPRLib::TransitTable::GetInstance(void)::ret) ) + if ( !(_BYTE)`guard variable for WXML::EXPRLib::TransitTable::GetInstance(void)::ret + && __cxa_guard_acquire(&`guard variable for WXML::EXPRLib::TransitTable::GetInstance(void)::ret) ) { dword_53FCE0 = 0; dword_53FCE4 = 0; @@ -52071,13 +52270,15 @@ int __fastcall WXML::DOMLib::Token::ToAttrContent[abi:cxx11](int a1) if ( !*(_DWORD *)a1 || *(_BYTE *)(a1 + 84) ) return a1 + 88; + // *(_DWORD *)(a1 + 16) pos v6 = (_BYTE *)(**(_DWORD **)a1 + *(_DWORD *)(a1 + 16)); + // size v8 = *(_DWORD *)(a1 + 20); - v7 = *v6 == 39 || *v6 == 34; + v7 = *v6 == '\''/*39*/ || *v6 == '"'/*34*/; if ( v8 > 0 ) { v1 = v6[v8 - 1]; - if ( v1 == 34 || v1 == 39 ) + if ( v1 == '"'/*34*/ || v1 == '\''/*39*/ ) --v8; } v2 = 0; @@ -52085,7 +52286,7 @@ int __fastcall WXML::DOMLib::Token::ToAttrContent[abi:cxx11](int a1) while ( v8 > v7 ) { v4 = v6[v7]; - if ( v4 == 92 ) + if ( v4 == '\\'/*92*/ ) { if ( !v2 ) { @@ -52098,13 +52299,13 @@ int __fastcall WXML::DOMLib::Token::ToAttrContent[abi:cxx11](int a1) switch ( v4 ) { case 'n': - Src[v3] = 10; + Src[v3] = 10; // \n goto LABEL_20; case 't': - Src[v3] = 9; + Src[v3] = 9; // \t goto LABEL_20; case 'r': - Src[v3] = 13; + Src[v3] = 13; // \r goto LABEL_20; } } @@ -52113,7 +52314,7 @@ LABEL_20: ++v3; v2 = 0; Src[v3] = 0; - if ( v3 == 30 ) + if ( v3 == 30 ) // 记录分隔符 { v10[0] = v11; std::string::_M_construct(v10, Src, (size_t)&Size); @@ -52151,34 +52352,36 @@ int __cdecl WXML::DOMLib::Token::GetTemplateContent(int *a1, unsigned __int8 **a void *v11[12]; // [esp+28h] [ebp-30h] BYREF v2 = 0; - v10 = a1[1]; + v10 = a1[1]; // a1字符串长度 v3 = v10 - 1; - while ( v2 < v10 && *(_BYTE *)(*a1 + v2) == 32 ) + // a1 std::string地址(内容,长度) + // *a1 std::string内容的地址 + while ( v2 < v10 && *(_BYTE *)(*a1 + v2) == ' '/*32*/ ) ++v2; - while ( v3 >= 0 && *(_BYTE *)(*a1 + v3) == 32 ) + while ( v3 >= 0 && *(_BYTE *)(*a1 + v3) == ' '/*32*/ ) --v3; v4 = v2 + 2; if ( v2 + 2 >= v10 ) return -1; v5 = *a1; v6 = -1; - if ( *(_BYTE *)(*a1 + v2) != 123 ) + if ( *(_BYTE *)(*a1 + v2) != '{'/*123*/ ) return v6; - if ( *(_BYTE *)(v5 + v2 + 1) != 123 || v3 <= 1 ) + if ( *(_BYTE *)(v5 + v2 + 1) != '{'/*123*/ || v3 <= 1 ) return -1; - if ( *(_BYTE *)(v5 + v3) == 125 && *(_BYTE *)(v5 + v3 - 1) == 125 ) + if ( *(_BYTE *)(v5 + v3) == '}'/*125*/ && *(_BYTE *)(v5 + v3 - 1) == '}'/*125*/ ) { v7 = v3 - 2; do { - if ( *(_BYTE *)(v5 + v4) != 32 ) + if ( *(_BYTE *)(v5 + v4) != ' '/*32*/ ) break; ++v4; } while ( v10 != v4 ); do { - if ( *(_BYTE *)(v5 + v7) != 32 ) + if ( *(_BYTE *)(v5 + v7) != ' '/*32*/ ) break; } while ( v7-- != 0 ); @@ -52205,36 +52408,37 @@ char __cdecl WXML::DOMLib::Token::IsValidVariableName(char **a1) bool v6; // cc bool v7; // zf - v1 = **a1; - if ( v1 == 95 || v1 == 36 || (v2 = (v1 & 0xDF) - 65, result = 0, v2 <= 0x19u) ) + v1 = **a1; // v1 字符串缓冲区第一个字符 + if ( v1 == '_'/*95*/ || v1 == '$'/*36*/ || (v2 = (v1 & 0xDF) - 'A'/*65*/, result = 0, v2 <= 0x19u) ) // 0x19u 25 { for ( i = 1; ; ++i ) { + // a1[1] a1字符长度 if ( (unsigned int)a1[1] <= i ) return 1; v5 = (*a1)[i]; - if ( v5 <= 96 ) + if ( v5 <= '`'/*96*/ ) { - if ( v5 > 64 ) + if ( v5 > '@'/*64*/ ) { - if ( v5 <= 90 ) + if ( v5 <= 'Z'/*90*/ ) continue; - v7 = v5 == 95; + v7 = v5 == '_'/*95*/; goto LABEL_13; } - if ( v5 <= 47 ) + if ( v5 <= '/'/*47*/ ) { - v7 = v5 == 36; + v7 = v5 == '$'/*36*/; LABEL_13: if ( !v7 ) return 0; continue; } - v6 = v5 <= 57; + v6 = v5 <= '9'/*57*/; } else { - v6 = v5 <= 122; + v6 = v5 <= 'z'/*122*/; } if ( !v6 ) return 0; @@ -52253,11 +52457,13 @@ bool __userpurge WXML::DOMLib::Token::IsMatch@(int a1@, WXML::DOMLib::T result = 0; if ( *(_DWORD *)a1 ) { + // a1.offset_20 size v4 = *(_DWORD *)(a1 + 20); for ( i = 0; ; ++i ) { if ( v4 <= i ) return *((_BYTE *)this + v4) == 0; + // a1.offset_16 pos if ( *(_BYTE *)(**(_DWORD **)a1 + *(_DWORD *)(a1 + 16) + i) != *((_BYTE *)this + i) ) break; } @@ -52272,7 +52478,9 @@ unsigned __int8 **__fastcall WXML::DOMLib::Token::ToString[abi:cxx11](int a1) unsigned __int8 **v1; // edi void *v4[12]; // [esp+18h] [ebp-30h] BYREF + // offset 32 v1 = (unsigned __int8 **)(a1 + 32); + // offset 28 if ( *(_DWORD *)a1 && !*(_BYTE *)(a1 + 28) ) { std::string::substr(v4, *(_DWORD **)a1, *(_DWORD *)(a1 + 16), *(_DWORD *)(a1 + 20)); @@ -52343,7 +52551,7 @@ void __userpurge WXML::DOMLib::Token::Token(int a1@, WXML::DOMLib::Token *t *(_DWORD *)(a1 + 12) = *((_DWORD *)this + 3); *(_DWORD *)(a1 + 16) = *((_DWORD *)this + 4); *(_DWORD *)(a1 + 20) = *((_DWORD *)this + 5); - *(_DWORD *)(a1 + 24) = *((_DWORD *)this + 6); + *(_DWORD *)(a1 + 24) = *((_DWORD *)this + 6); // *(_BYTE *)(a1 + 28) = *((_BYTE *)this + 28); std::string::basic_string((char *)(a1 + 32), (int)this + 32); *(_DWORD *)(a1 + 56) = *((_DWORD *)this + 14); @@ -52539,22 +52747,22 @@ int __cdecl WXML::DOMLib::WXMLDom::ToCamelStyle(int a1, int a2) v2 = *i; if ( !*i ) break; - if ( v2 > 46 ) + if ( v2 > '.'/*46*/ ) { - if ( v2 == 58 ) + if ( v2 == ':'/*58*/ ) { LABEL_11: lpuexcpt = 1; continue; } } - else if ( v2 > 44 ) + else if ( v2 > ','/*44*/ ) { goto LABEL_11; } - if ( (unsigned __int8)(v2 - 97) <= 0x19u && lpuexcpt ) + if ( (unsigned __int8)(v2 - 'a'/*97*/) <= 0x19u && lpuexcpt ) { - std::string::push_back((_DWORD *)a1, v2 - 32); + std::string::push_back((_DWORD *)a1, v2 - ' '/*32*/); lpuexcpt = 0; } else