Advertisement
Guest User

Untitled

a guest
Apr 30th, 2017
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.53 KB | None | 0 0
  1. char __thiscall CWispHexWnd_OnUpdateClient_sub_B2414(CWispHexWnd *this, WISP_MSG *pMsg)
  2. {
  3. int OffsetMode_v3; // eax@1
  4. bool __v4; // zf@1
  5. int m_ShowLength_v5; // ecx@2
  6. int v6; // eax@2
  7. int __v7; // ebx@2
  8. int XPos___v8; // ebx@2
  9. CWispDC *m_ClientDC_v9; // edi@2
  10. int v10; // edx@2
  11. int v11; // ecx@2
  12. unsigned int Addr_v12; // eax@14
  13. bool v13; // sf@16
  14. int Address_v14; // eax@18
  15. int m_AddressMode_v15; // ecx@18
  16. int m_ItemSpace_0_v16; // ebx@18
  17. int v17; // eax@20
  18. int LEN_v18; // eax@26
  19. int ______v19; // edx@26
  20. int LEN_v20; // ST0C_4@26
  21. int ____________v21; // ecx@26
  22. int v22; // ecx@26
  23. int __v23; // ST04_4@26
  24. int v24; // eax@26
  25. unsigned int m_nByte_Line_v25; // eax@26
  26. int _v26; // ecx@26
  27. unsigned int AsciiLen; // ebx@26
  28. int m_ShowLength_v28; // ecx@28
  29. int i; // eax@34
  30. char v30; // dl@35
  31. int v31; // ecx@35
  32. int v32; // eax@36
  33. unsigned __int32 Selv33; // eax@37
  34. int Selv34; // eax@38
  35. int color_v35; // eax@40
  36. int v36; // eax@41
  37. int color_v37; // eax@43
  38. unsigned __int32 Sel_v38; // eax@52
  39. int m_BSelColor_v39; // eax@54
  40. int __v40; // eax@54
  41. CWispBase *m_pWispBase_v41; // eax@55
  42. int __v42; // eax@55
  43. __int16 Buffer[512]; // [esp+Ch] [ebp-414h]@6
  44. __int16 szSpace[32]; // [esp+40Ch] [ebp-14h]@28
  45. char DataBuffer[32]; // [esp+44Ch] [ebp+2Ch]@16
  46. int OffsetMode_v47; // [esp+46Ch] [ebp+4Ch]@1
  47. int YLine; // [esp+470h] [ebp+50h]@26
  48. int GroupLen; // [esp+474h] [ebp+54h]@2
  49. int GroupX; // [esp+478h] [ebp+58h]@31
  50. int HexIt; // [esp+47Ch] [ebp+5Ch]@30
  51. int Address___v52; // [esp+480h] [ebp+60h]@3
  52. int nLine; // [esp+484h] [ebp+64h]@16
  53. int HexLen; // [esp+488h] [ebp+68h]@3
  54. int *AR_v55; // [esp+48Ch] [ebp+6Ch]@3
  55. int XStart; // [esp+490h] [ebp+70h]@6
  56. int _n_; // [esp+49Ch] [ebp+7Ch]@4
  57. unsigned int AsciiIt; // [esp+49Ch] [ebp+7Ch]@48
  58. char bSame; // [esp+49Fh] [ebp+7Fh]@32
  59.  
  60. CWispWnd_OnUpdateClient_sub_A13A4(&this->_, pMsg);
  61. OffsetMode_v3 = this->_._.vtbl->GetOffsetMode(this);
  62. this->m_Size1 = 0;
  63. __v4 = this->m_bShowOffset == 0;
  64. OffsetMode_v47 = OffsetMode_v3;
  65. if ( !__v4 )
  66. {
  67. m_ShowLength_v5 = this->m_ShowLength;
  68. v6 = this->m_nByte_Line / m_ShowLength_v5;
  69. __v7 = this->m_ItemSpace[1];
  70. this->_.m_ClientDC.m_TextStyle = 0;
  71. XPos___v8 = this->m_ItemSpace[0] + __v7;
  72. m_ClientDC_v9 = &this->_.m_ClientDC;
  73. v10 = this->_.m_ClientDC.m_TextColor;
  74. GroupLen = 3 * m_ShowLength_v5;
  75. v11 = this->m_ItemColor[1];
  76. m_ClientDC_v9->m_OldTextColor = v10;
  77. m_ClientDC_v9->m_TextColor = v11;
  78. if ( v6 > 0 )
  79. {
  80. HexLen = 0;
  81. AR_v55 = 1;
  82. Address___v52 = v6;
  83. do
  84. {
  85. _n_ = 0;
  86. if ( this->m_ShowOffset )
  87. {
  88. if ( this->m_ShowLength > 0 )
  89. {
  90. XStart = Buffer;
  91. do
  92. {
  93. TSPrintf_2_sub_1B9A8(XStart, L"+%X", AR_v55 * this->m_ShowLength - _n_ - 1);
  94. XStart += 4;
  95. ++_n_;
  96. }
  97. while ( _n_ < this->m_ShowLength );
  98. }
  99. }
  100. else if ( this->m_ShowLength > 0 )
  101. {
  102. XStart = Buffer;
  103. do
  104. {
  105. TSPrintf_2_sub_1B9A8(
  106. XStart,
  107. L"%X ",
  108. (AR_v55 * this->m_ShowLength - _n_ + this->m_CurAddr - 1) % this->m_nByte_Line);
  109. XStart += 4;
  110. ++_n_;
  111. }
  112. while ( _n_ < this->m_ShowLength );
  113. }
  114. CWispDC_DrawString_CLIP_dw_sub_A57D0(
  115. &this->_.m_ClientDC,
  116. this->m_CharWidth * (XPos___v8 + HexLen - this->m_CharXPos),
  117. 0,
  118. Buffer,
  119. 2 * this->m_ShowLength,
  120. 0,
  121. 0);
  122. AR_v55 = (AR_v55 + 1);
  123. HexLen += GroupLen;
  124. --Address___v52;
  125. }
  126. while ( Address___v52 );
  127. }
  128. }
  129. if ( this->m_bFloatMode )
  130. {
  131. Addr_v12 = this->_._.vtbl->GetAddress(this, &this->m_StringAddr);
  132. if ( Addr_v12 != this->m_CurAddr )
  133. CWispHexWnd_ViewAddressMsg_sub_B16C6(this, Addr_v12, 0);
  134. }
  135. nLine = 0;
  136. memset(this->m_LenArray, 0, sizeof(this->m_LenArray));
  137. __v4 = this->m_nLines_Page == 0;
  138. v13 = this->m_nLines_Page < 0;
  139. memset(DataBuffer, 0, sizeof(DataBuffer));
  140. if ( !v13 && !__v4 )
  141. {
  142. AR_v55 = this->m_LenArray[2].field_0;
  143. while ( 1 )
  144. {
  145. Address_v14 = this->m_CurAddr + nLine * this->m_nByte_Line;
  146. m_AddressMode_v15 = this->m_AddressMode;
  147. m_ItemSpace_0_v16 = this->m_ItemSpace[0];
  148. Address___v52 = this->m_CurAddr + nLine * this->m_nByte_Line;
  149. if ( m_AddressMode_v15 )
  150. {
  151. if ( m_AddressMode_v15 == 1 )
  152. {
  153. v17 = Address_v14 - this->m_AddressModeOffs;
  154. if ( v17 <= 0 )
  155. {
  156. if ( v17 )
  157. TSPrintf_2_sub_1B9A8(Buffer, L"$-%X", -v17);
  158. else
  159. STR_TStrCpy_sub_13840(Buffer, "$ ==>");
  160. }
  161. else
  162. {
  163. TSPrintf_2_sub_1B9A8(Buffer, L"$+%X", v17);
  164. }
  165. }
  166. }
  167. else
  168. {
  169. TSPrintf_2_sub_1B9A8(Buffer, L"%08X:", Address_v14);
  170. }
  171. LEN_v18 = STR_TStrLen_2_sub_110B0(Buffer);
  172. AR_v55[-0x100u] = LEN_v18;
  173. this->_.m_ClientDC.m_TextStyle = 0;
  174. ______v19 = this->_.m_ClientDC.m_TextColor;
  175. LEN_v20 = LEN_v18;
  176. this->_.m_ClientDC.m_TextColor = this->m_ItemColor[1];
  177. ____________v21 = nLine;
  178. this->_.m_ClientDC.m_OldTextColor = ______v19;
  179. v22 = OffsetMode_v47 + ____________v21;
  180. __v23 = v22 * this->m_LineHeight;
  181. v24 = m_ItemSpace_0_v16 - this->m_CharXPos;
  182. YLine = v22;
  183. CWispDC_DrawString_CLIP_dw_sub_A57D0(&this->_.m_ClientDC, this->m_CharWidth * v24, __v23, Buffer, LEN_v20, 0, 0);
  184. m_nByte_Line_v25 = this->m_nByte_Line;
  185. _v26 = nLine * this->m_nByte_Line;
  186. XStart = this->m_ItemSpace[1] + m_ItemSpace_0_v16;
  187. AsciiLen = this->m_ImageBase + this->m_ImageSize - _v26 - this->m_CurAddr;
  188. if ( AsciiLen > m_nByte_Line_v25 )
  189. AsciiLen = m_nByte_Line_v25;
  190. STR_TStrCpy_2_2_sub_1389E(szSpace, CWispHexWnd::m_Spaces);
  191. m_ShowLength_v28 = this->m_ShowLength;
  192. szSpace[m_ShowLength_v28] = 0;
  193. HexLen = AsciiLen / m_ShowLength_v28;
  194. if ( AsciiLen % m_ShowLength_v28 )
  195. ++HexLen;
  196. GroupLen = 3 * m_ShowLength_v28;
  197. *AR_v55 = HexLen * 3 * m_ShowLength_v28;
  198. HexIt = 0;
  199. if ( HexLen > 0 )
  200. {
  201. GroupX = 0;
  202. while ( 1 )
  203. {
  204. bSame = 0;
  205. if ( this->_._.vtbl->ReadMemory(
  206. this,
  207. Address___v52 + HexIt * this->m_ShowLength,
  208. DataBuffer,
  209. this->m_ShowLength) )
  210. {
  211. STR_THexBytesToStr_sub_23530(DataBuffer, Buffer, AsciiLen, this->m_ShowLength, szSpace);
  212. for ( i = 0; i < this->m_ShowLength; this->m_Array1[v31] = v30 )
  213. {
  214. v30 = DataBuffer[i];
  215. v31 = i++ + this->m_Size1;
  216. }
  217. v32 = this->m_ShowLength;
  218. this->m_Size1 += v32;
  219. bSame = CWispHexWnd_Same_sub_B1212(this, Address___v52 + HexIt * v32, DataBuffer);
  220. }
  221. else
  222. {
  223. STR_TStrCpy_2_2_sub_1389E(Buffer, CWispHexWnd::m_UnReadable[0]);
  224. }
  225. Selv33 = this->_._.vtbl->GetHexByteAttribute(
  226. this,
  227. this->m_CurAddr + nLine * this->m_nByte_Line + HexIt * this->m_ShowLength);
  228. if ( !Selv33 )
  229. break;
  230. Selv34 = Selv33 - 1;
  231. if ( !Selv34 )
  232. {
  233. v36 = this->m_BSelColor;
  234. this->_.m_ClientDC.m_TextStyle = 1;
  235. this->_.m_ClientDC.m_OldTextBKColor = this->_.m_ClientDC.m_TextBKColor;
  236. this->_.m_ClientDC.m_TextBKColor = v36;
  237. if ( !bSame )
  238. {
  239. color_v37 = this->m_TSelColor;
  240. goto LABEL_46;
  241. }
  242. goto LABEL_42;
  243. }
  244. if ( Selv34 == 1 )
  245. {
  246. color_v35 = this->m_BBPXColor;
  247. this->_.m_ClientDC.m_TextStyle = 1;
  248. this->_.m_ClientDC.m_OldTextBKColor = this->_.m_ClientDC.m_TextBKColor;
  249. this->_.m_ClientDC.m_TextBKColor = color_v35;
  250. LABEL_45:
  251. color_v37 = this->m_ItemColor[2];
  252. LABEL_46:
  253. this->_.m_ClientDC.m_OldTextColor = this->_.m_ClientDC.m_TextColor;
  254. this->_.m_ClientDC.m_TextColor = color_v37;
  255. }
  256. LABEL_47:
  257. CWispDC_DrawString_CLIP_dw_sub_A57D0(
  258. &this->_.m_ClientDC,
  259. this->m_CharWidth * (XStart + GroupX - this->m_CharXPos),
  260. YLine * this->m_LineHeight,
  261. Buffer,
  262. 2 * this->m_ShowLength,
  263. 0,
  264. 0);
  265. ++HexIt;
  266. GroupX += GroupLen;
  267. if ( HexIt >= HexLen )
  268. goto START_ASCII_LOOP_LABEL_48;
  269. }
  270. this->_.m_ClientDC.m_TextStyle = 0;
  271. if ( !bSame )
  272. goto LABEL_45;
  273. LABEL_42:
  274. this->_.m_ClientDC.m_OldTextColor = this->_.m_ClientDC.m_TextColor;
  275. this->_.m_ClientDC.m_TextColor = 0xFFFF00;
  276. goto LABEL_47;
  277. }
  278. START_ASCII_LOOP_LABEL_48:
  279. XStart += this->m_ItemSpace[2];
  280. AsciiIt = 0;
  281. AR_v55[0x100] = this->m_nByte_Line;
  282. if ( AsciiLen )
  283. break;
  284. LOOP_LABEL_58:
  285. ++nLine;
  286. ++AR_v55;
  287. if ( nLine >= this->m_nLines_Page )
  288. goto RETURN_LABEL_59;
  289. }
  290. while ( 1 )
  291. {
  292. if ( this->_._.vtbl->ReadMemory(this, Address___v52 + AsciiIt, DataBuffer, 1) )
  293. STR_THexBytesToASCII_sub_5B446(DataBuffer, Buffer, 1);
  294. else
  295. STR_TStrCpy_2_2_sub_1389E(Buffer, CWispHexWnd::m_UnReadableASCII[0]);
  296. Sel_v38 = this->_._.vtbl->GetHexByteAttribute(this, AsciiIt + this->m_CurAddr + nLine * this->m_nByte_Line);
  297. if ( !Sel_v38 )
  298. break;
  299. if ( Sel_v38 == 1 )
  300. {
  301. m_BSelColor_v39 = this->m_BSelColor;
  302. this->_.m_ClientDC.m_TextStyle = 1;
  303. this->_.m_ClientDC.m_OldTextBKColor = this->_.m_ClientDC.m_TextBKColor;
  304. this->_.m_ClientDC.m_TextBKColor = m_BSelColor_v39;
  305. __v40 = this->m_TSelColor;
  306. LABEL_56:
  307. this->_.m_ClientDC.m_OldTextColor = this->_.m_ClientDC.m_TextColor;
  308. this->_.m_ClientDC.m_TextColor = __v40;
  309. }
  310. CWispDC_DrawString_CLIP_dw_sub_A57D0(
  311. &this->_.m_ClientDC,
  312. this->m_CharWidth * (XStart + AsciiIt++ - this->m_CharXPos),
  313. YLine * this->m_LineHeight,
  314. Buffer,
  315. 1,
  316. 0,
  317. 0);
  318. if ( AsciiIt >= AsciiLen )
  319. goto LOOP_LABEL_58;
  320. }
  321. m_pWispBase_v41 = this->_._.m_pWispBase;
  322. this->_.m_ClientDC.m_TextStyle = 0;
  323. __v42 = m_pWispBase_v41->m_pWispDrawObj->m_crSystem[20];
  324. this->_.m_ClientDC.m_OldTextBKColor = this->_.m_ClientDC.m_TextBKColor;
  325. this->_.m_ClientDC.m_TextBKColor = __v42;
  326. __v40 = this->m_ItemColor[3];
  327. goto LABEL_56;
  328. }
  329. RETURN_LABEL_59:
  330. __v4 = this->m_Size2 == 0;
  331. this->m_Offset1 = this->m_CurAddr;
  332. if ( __v4 )
  333. CWispHexWnd_SyncBuffer_sub_B1406(this);
  334. return 0;
  335. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement