Помогите идентифицировать алгоритм.

Тема в разделе "WASM.ASSEMBLER", создана пользователем ktoto, 23 июл 2008.

  1. ktoto

    ktoto New Member

    Публикаций:
    0
    Регистрация:
    12 мар 2008
    Сообщения:
    21
    Собственно говоря встретил вот такую конструкцию, Но мозгов чтото не хватает у меня разобрать,
    может ктото видел уже подобное.

    Код (Text):
    1. .text:004663D3 mb_chtoto_dohera_schitaem proc near     ; CODE XREF: sub_4628D2+54p
    2. .text:004663D3                                         ; sub_464063+D0p ...
    3. .text:004663D3
    4. .text:004663D3 var_10          = dword ptr -10h
    5. .text:004663D3 var_C           = dword ptr -0Ch
    6. .text:004663D3 var_8           = dword ptr -8
    7. .text:004663D3 var_4           = dword ptr -4
    8. .text:004663D3 arg_0           = dword ptr  8
    9. .text:004663D3 arg_4           = dword ptr  0Ch
    10. .text:004663D3
    11. .text:004663D3                 push    ebp
    12. .text:004663D4                 mov     ebp, esp
    13. .text:004663D6                 sub     esp, 10h
    14. .text:004663D9                 mov     ecx, [ebp+arg_0]
    15. .text:004663DC                 push    ebx
    16. .text:004663DD                 push    esi
    17. .text:004663DE                 mov     esi, [ebp+arg_4]
    18. .text:004663E1                 mov     eax, [ecx+10h]
    19. .text:004663E4                 push    edi
    20. .text:004663E5                 mov     edi, esi
    21. .text:004663E7                 add     esi, 0FFFFFFFCh
    22. .text:004663EA                 sub     edi, [ecx+0Ch]
    23. .text:004663ED                 shr     edi, 0Fh
    24. .text:004663F0                 mov     ecx, edi
    25. .text:004663F2                 imul    ecx, 204h
    26. .text:004663F8                 lea     ecx, [ecx+eax+144h]
    27. .text:004663FF                 mov     [ebp+var_10], ecx
    28. .text:00466402                 mov     ecx, [esi]
    29. .text:00466404                 dec     ecx
    30. .text:00466405                 test    cl, 1
    31. .text:00466408                 mov     [ebp+var_4], ecx
    32. .text:0046640B                 jnz     loc_4666F7
    33. .text:00466411                 mov     edx, [ecx+esi]
    34. .text:00466414                 lea     ebx, [ecx+esi]
    35. .text:00466417                 mov     [ebp+var_C], edx
    36. .text:0046641A                 mov     edx, [esi-4]
    37. .text:0046641D                 mov     [ebp+var_8], edx
    38. .text:00466420                 mov     edx, [ebp+var_C]
    39. .text:00466423                 test    dl, 1
    40. .text:00466426                 mov     [ebp+arg_4], ebx
    41. .text:00466429                 jnz     short loc_4664A9
    42. .text:0046642B                 sar     edx, 4
    43. .text:0046642E                 dec     edx
    44. .text:0046642F                 cmp     edx, 3Fh
    45. .text:00466432                 jbe     short loc_466437
    46. .text:00466434                 push    3Fh
    47. .text:00466436                 pop     edx
    48. .text:00466437
    49. .text:00466437 loc_466437:                             ; CODE XREF: mb_chtoto_dohera_schitaem+5Fj
    50. .text:00466437                 mov     ecx, [ebx+4]
    51. .text:0046643A                 cmp     ecx, [ebx+8]
    52. .text:0046643D                 jnz     short loc_46648B
    53. .text:0046643F                 cmp     edx, 20h
    54. .text:00466442                 jnb     short loc_466462
    55. .text:00466444                 mov     ebx, 80000000h
    56. .text:00466449                 mov     ecx, edx
    57. .text:0046644B                 shr     ebx, cl
    58. .text:0046644D                 lea     ecx, [edx+eax+4]
    59. .text:00466451                 not     ebx
    60. .text:00466453                 and     [eax+edi*4+44h], ebx
    61. .text:00466457                 dec     byte ptr [ecx]
    62. .text:00466459                 jnz     short loc_466483
    63. .text:0046645B                 mov     ecx, [ebp+arg_0]
    64. .text:0046645E                 and     [ecx], ebx
    65. .text:00466460                 jmp     short loc_466483
    66. .text:00466462 ; ---------------------------------------------------------------------------
    67. .text:00466462
    68. .text:00466462 loc_466462:                             ; CODE XREF: mb_chtoto_dohera_schitaem+6Fj
    69. .text:00466462                 lea     ecx, [edx-20h]
    70. .text:00466465                 mov     ebx, 80000000h
    71. .text:0046646A                 shr     ebx, cl
    72. .text:0046646C                 lea     ecx, [edx+eax+4]
    73. .text:00466470                 not     ebx
    74. .text:00466472                 and     [eax+edi*4+0C4h], ebx
    75. .text:00466479                 dec     byte ptr [ecx]
    76. .text:0046647B                 jnz     short loc_466483
    77. .text:0046647D                 mov     ecx, [ebp+arg_0]
    78. .text:00466480                 and     [ecx+4], ebx
    79. .text:00466483
    80. .text:00466483 loc_466483:                             ; CODE XREF: mb_chtoto_dohera_schitaem+86j
    81. .text:00466483                                         ; mb_chtoto_dohera_schitaem+8Dj ...
    82. .text:00466483                 mov     ecx, [ebp+var_4]
    83. .text:00466486                 mov     ebx, [ebp+arg_4]
    84. .text:00466489                 jmp     short loc_46648E
    85. .text:0046648B ; ---------------------------------------------------------------------------
    86. .text:0046648B
    87. .text:0046648B loc_46648B:                             ; CODE XREF: mb_chtoto_dohera_schitaem+6Aj
    88. .text:0046648B                 mov     ecx, [ebp+var_4]
    89. .text:0046648E
    90. .text:0046648E loc_46648E:                             ; CODE XREF: mb_chtoto_dohera_schitaem+B6j
    91. .text:0046648E                 mov     edx, [ebx+8]
    92. .text:00466491                 mov     ebx, [ebx+4]
    93. .text:00466494                 add     ecx, [ebp+var_C]
    94. .text:00466497                 mov     [edx+4], ebx
    95. .text:0046649A                 mov     edx, [ebp+arg_4]
    96. .text:0046649D                 mov     [ebp+var_4], ecx
    97. .text:004664A0                 mov     ebx, [edx+4]
    98. .text:004664A3                 mov     edx, [edx+8]
    99. .text:004664A6                 mov     [ebx+8], edx
    100. .text:004664A9
    101. .text:004664A9 loc_4664A9:                             ; CODE XREF: mb_chtoto_dohera_schitaem+56j
    102. .text:004664A9                 mov     edx, ecx
    103. .text:004664AB                 sar     edx, 4
    104. .text:004664AE                 dec     edx
    105. .text:004664AF                 cmp     edx, 3Fh
    106. .text:004664B2                 jbe     short loc_4664B7
    107. .text:004664B4                 push    3Fh
    108. .text:004664B6                 pop     edx
    109. .text:004664B7
    110. .text:004664B7 loc_4664B7:                             ; CODE XREF: mb_chtoto_dohera_schitaem+DFj
    111. .text:004664B7                 mov     ebx, [ebp+var_8]
    112. .text:004664BA                 and     ebx, 1
    113. .text:004664BD                 mov     [ebp+var_C], ebx
    114. .text:004664C0                 jnz     loc_46655A
    115. .text:004664C6                 sub     esi, [ebp+var_8]
    116. .text:004664C9                 mov     ebx, [ebp+var_8]
    117. .text:004664CC                 sar     ebx, 4
    118. .text:004664CF                 push    3Fh
    119. .text:004664D1                 mov     [ebp+arg_4], esi
    120. .text:004664D4                 dec     ebx
    121. .text:004664D5                 pop     esi
    122. .text:004664D6                 cmp     ebx, esi
    123. .text:004664D8                 jbe     short loc_4664DC
    124. .text:004664DA                 mov     ebx, esi
    125. .text:004664DC
    126. .text:004664DC loc_4664DC:                             ; CODE XREF: mb_chtoto_dohera_schitaem+105j
    127. .text:004664DC                 add     ecx, [ebp+var_8]
    128. .text:004664DF                 mov     edx, ecx
    129. .text:004664E1                 mov     [ebp+var_4], ecx
    130. .text:004664E4                 sar     edx, 4
    131. .text:004664E7                 dec     edx
    132. .text:004664E8                 cmp     edx, esi
    133. .text:004664EA                 jbe     short loc_4664EE
    134. .text:004664EC                 mov     edx, esi
    135. .text:004664EE
    136. .text:004664EE loc_4664EE:                             ; CODE XREF: mb_chtoto_dohera_schitaem+117j
    137. .text:004664EE                 cmp     ebx, edx
    138. .text:004664F0                 jz      short loc_466555
    139. .text:004664F2                 mov     ecx, [ebp+arg_4]
    140. .text:004664F5                 mov     esi, [ecx+4]
    141. .text:004664F8                 cmp     esi, [ecx+8]
    142. .text:004664FB                 jnz     short loc_46653D
    143. .text:004664FD                 cmp     ebx, 20h
    144. .text:00466500                 jnb     short loc_46651E
    145. .text:00466502                 mov     esi, 80000000h
    146. .text:00466507                 mov     ecx, ebx
    147. .text:00466509                 shr     esi, cl
    148. .text:0046650B                 not     esi
    149. .text:0046650D                 and     [eax+edi*4+44h], esi
    150. .text:00466511                 dec     byte ptr [ebx+eax+4]
    151. .text:00466515                 jnz     short loc_46653D
    152. .text:00466517                 mov     ecx, [ebp+arg_0]
    153. .text:0046651A                 and     [ecx], esi
    154. .text:0046651C                 jmp     short loc_46653D
    155. .text:0046651E ; ---------------------------------------------------------------------------
    156. .text:0046651E
    157. .text:0046651E loc_46651E:                             ; CODE XREF: mb_chtoto_dohera_schitaem+12Dj
    158. .text:0046651E                 lea     ecx, [ebx-20h]
    159. .text:00466521                 mov     esi, 80000000h
    160. .text:00466526                 shr     esi, cl
    161. .text:00466528                 not     esi
    162. .text:0046652A                 and     [eax+edi*4+0C4h], esi
    163. .text:00466531                 dec     byte ptr [ebx+eax+4]
    164. .text:00466535                 jnz     short loc_46653D
    165. .text:00466537                 mov     ecx, [ebp+arg_0]
    166. .text:0046653A                 and     [ecx+4], esi
    167. .text:0046653D
    168. .text:0046653D loc_46653D:                             ; CODE XREF: mb_chtoto_dohera_schitaem+128j
    169. .text:0046653D                                         ; mb_chtoto_dohera_schitaem+142j ...
    170. .text:0046653D                 mov     ecx, [ebp+arg_4]
    171. .text:00466540                 mov     esi, [ecx+8]
    172. .text:00466543                 mov     ecx, [ecx+4]
    173. .text:00466546                 mov     [esi+4], ecx
    174. .text:00466549                 mov     ecx, [ebp+arg_4]
    175. .text:0046654C                 mov     esi, [ecx+4]
    176. .text:0046654F                 mov     ecx, [ecx+8]
    177. .text:00466552                 mov     [esi+8], ecx
    178. .text:00466555
    179. .text:00466555 loc_466555:                             ; CODE XREF: mb_chtoto_dohera_schitaem+11Dj
    180. .text:00466555                 mov     esi, [ebp+arg_4]
    181. .text:00466558                 jmp     short loc_46655D
    182. .text:0046655A ; ---------------------------------------------------------------------------
    183. .text:0046655A
    184. .text:0046655A loc_46655A:                             ; CODE XREF: mb_chtoto_dohera_schitaem+EDj
    185. .text:0046655A                 mov     ebx, [ebp+arg_0]
    186. .text:0046655D
    187. .text:0046655D loc_46655D:                             ; CODE XREF: mb_chtoto_dohera_schitaem+185j
    188. .text:0046655D                 cmp     [ebp+var_C], 0
    189. .text:00466561                 jnz     short loc_46656B
    190. .text:00466563                 cmp     ebx, edx
    191. .text:00466565                 jz      loc_4665EC
    192. .text:0046656B
    193. .text:0046656B loc_46656B:                             ; CODE XREF: mb_chtoto_dohera_schitaem+18Ej
    194. .text:0046656B                 mov     ecx, [ebp+var_10]
    195. .text:0046656E                 mov     ebx, [ecx+edx*8+4]
    196. .text:00466572                 lea     ecx, [ecx+edx*8]
    197. .text:00466575                 mov     [esi+4], ebx
    198. .text:00466578                 mov     [esi+8], ecx
    199. .text:0046657B                 mov     [ecx+4], esi
    200. .text:0046657E                 mov     ecx, [esi+4]
    201. .text:00466581                 mov     [ecx+8], esi
    202. .text:00466584                 mov     ecx, [esi+4]
    203. .text:00466587                 cmp     ecx, [esi+8]
    204. .text:0046658A                 jnz     short loc_4665EC
    205. .text:0046658C                 mov     cl, [edx+eax+4]
    206. .text:00466590                 cmp     edx, 20h
    207. .text:00466593                 mov     byte ptr [ebp+arg_4+3], cl
    208. .text:00466596                 inc     cl
    209. .text:00466598                 mov     [edx+eax+4], cl
    210. .text:0046659C                 jnb     short loc_4665C3
    211. .text:0046659E                 cmp     byte ptr [ebp+arg_4+3], 0
    212. .text:004665A2                 jnz     short loc_4665B2
    213. .text:004665A4                 mov     ebx, 80000000h
    214. .text:004665A9                 mov     ecx, edx
    215. .text:004665AB                 shr     ebx, cl
    216. .text:004665AD                 mov     ecx, [ebp+arg_0]
    217. .text:004665B0                 or      [ecx], ebx
    218. .text:004665B2
    219. .text:004665B2 loc_4665B2:                             ; CODE XREF: mb_chtoto_dohera_schitaem+1CFj
    220. .text:004665B2                 mov     ebx, 80000000h
    221. .text:004665B7                 mov     ecx, edx
    222. .text:004665B9                 shr     ebx, cl
    223. .text:004665BB                 lea     eax, [eax+edi*4+44h]
    224. .text:004665BF                 or      [eax], ebx
    225. .text:004665C1                 jmp     short loc_4665EC
    226. .text:004665C3 ; ---------------------------------------------------------------------------
    227. .text:004665C3
    228. .text:004665C3 loc_4665C3:                             ; CODE XREF: mb_chtoto_dohera_schitaem+1C9j
    229. .text:004665C3                 cmp     byte ptr [ebp+arg_4+3], 0
    230. .text:004665C7                 jnz     short loc_4665D9
    231. .text:004665C9                 lea     ecx, [edx-20h]
    232. .text:004665CC                 mov     ebx, 80000000h
    233. .text:004665D1                 shr     ebx, cl
    234. .text:004665D3                 mov     ecx, [ebp+arg_0]
    235. .text:004665D6                 or      [ecx+4], ebx
    236. .text:004665D9
    237. .text:004665D9 loc_4665D9:                             ; CODE XREF: mb_chtoto_dohera_schitaem+1F4j
    238. .text:004665D9                 lea     ecx, [edx-20h]
    239. .text:004665DC                 mov     edx, 80000000h
    240. .text:004665E1                 shr     edx, cl
    241. .text:004665E3                 lea     eax, [eax+edi*4+0C4h]
    242. .text:004665EA                 or      [eax], edx
    243. .text:004665EC
    244. .text:004665EC loc_4665EC:                             ; CODE XREF: mb_chtoto_dohera_schitaem+192j
    245. .text:004665EC                                         ; mb_chtoto_dohera_schitaem+1B7j ...
    246. .text:004665EC                 mov     eax, [ebp+var_4]
    247. .text:004665EF                 mov     [esi], eax
    248. .text:004665F1                 mov     [eax+esi-4], eax
    249. .text:004665F5                 mov     eax, [ebp+var_10]
    250. .text:004665F8                 dec     dword ptr [eax]
    251. .text:004665FA                 jnz     loc_4666F7
    252. .text:00466600                 mov     eax, Dst
    253. .text:00466605                 test    eax, eax
    254. .text:00466607                 jz      loc_4666E9
    255. .text:0046660D                 mov     ecx, dword_488B10
    256. .text:00466613                 mov     esi, ds:VirtualFree
    257. .text:00466619                 shl     ecx, 0Fh
    258. .text:0046661C                 add     ecx, [eax+0Ch]
    259. .text:0046661F                 mov     ebx, 8000h
    260. .text:00466624                 push    4000h           ; dwFreeType
    261. .text:00466629                 push    ebx             ; dwSize
    262. .text:0046662A                 push    ecx             ; lpAddress
    263. .text:0046662B                 call    esi ; VirtualFree
    264. .text:0046662D                 mov     ecx, dword_488B10
    265. .text:00466633                 mov     eax, Dst
    266. .text:00466638                 mov     edx, 80000000h
    267. .text:0046663D                 shr     edx, cl
    268. .text:0046663F                 or      [eax+8], edx
    269. .text:00466642                 mov     eax, Dst
    270. .text:00466647                 mov     ecx, dword_488B10
    271. .text:0046664D                 mov     eax, [eax+10h]
    272. .text:00466650                 and     dword ptr [eax+ecx*4+0C4h], 0
    273. .text:00466658                 mov     eax, Dst
    274. .text:0046665D                 mov     eax, [eax+10h]
    275. .text:00466660                 dec     byte ptr [eax+43h]
    276. .text:00466663                 mov     eax, Dst
    277. .text:00466668                 mov     ecx, [eax+10h]
    278. .text:0046666B                 cmp     byte ptr [ecx+43h], 0
    279. .text:0046666F                 jnz     short loc_46667A
    280. .text:00466671                 and     dword ptr [eax+4], 0FFFFFFFEh
    281. .text:00466675                 mov     eax, Dst
    282. .text:0046667A
    283. .text:0046667A loc_46667A:                             ; CODE XREF: mb_chtoto_dohera_schitaem+29Cj
    284. .text:0046667A                 cmp     dword ptr [eax+8], 0FFFFFFFFh
    285. .text:0046667E                 jnz     short loc_4666E9
    286. .text:00466680                 push    ebx             ; dwFreeType
    287. .text:00466681                 push    0               ; dwSize
    288. .text:00466683                 push    dword ptr [eax+0Ch] ; lpAddress
    289. .text:00466686                 call    esi ; VirtualFree
    290. .text:00466688                 mov     eax, Dst
    291. .text:0046668D                 push    dword ptr [eax+10h] ; lpMem
    292. .text:00466690                 push    0               ; dwFlags
    293. .text:00466692                 push    hHeap           ; hHeap
    294. .text:00466698                 call    ds:HeapFree
    295. .text:0046669E                 mov     eax, dword_488B20
    296. .text:004666A3                 mov     edx, lpMem
    297. .text:004666A9                 lea     eax, [eax+eax*4]
    298. .text:004666AC                 shl     eax, 2
    299. .text:004666AF                 mov     ecx, eax
    300. .text:004666B1                 mov     eax, Dst
    301. .text:004666B6                 sub     ecx, eax
    302. .text:004666B8                 lea     ecx, [ecx+edx-14h]
    303. .text:004666BC                 push    ecx             ; Size
    304. .text:004666BD                 lea     ecx, [eax+14h]
    305. .text:004666C0                 push    ecx             ; Src
    306. .text:004666C1                 push    eax             ; Dst
    307. .text:004666C2                 call    _memcpy_0
    308. .text:004666C7                 mov     eax, [ebp+arg_0]
    309. .text:004666CA                 add     esp, 0Ch
    310. .text:004666CD                 dec     dword_488B20
    311. .text:004666D3                 cmp     eax, Dst
    312. .text:004666D9                 jbe     short loc_4666DF
    313. .text:004666DB                 sub     [ebp+arg_0], 14h
    314. .text:004666DF
    315. .text:004666DF loc_4666DF:                             ; CODE XREF: mb_chtoto_dohera_schitaem+306j
    316. .text:004666DF                 mov     eax, lpMem
    317. .text:004666E4                 mov     dword_488B14, eax
    318. .text:004666E9
    319. .text:004666E9 loc_4666E9:                             ; CODE XREF: mb_chtoto_dohera_schitaem+234j
    320. .text:004666E9                                         ; mb_chtoto_dohera_schitaem+2ABj
    321. .text:004666E9                 mov     eax, [ebp+arg_0]
    322. .text:004666EC                 mov     dword_488B10, edi
    323. .text:004666F2                 mov     Dst, eax
    324. .text:004666F7
    325. .text:004666F7 loc_4666F7:                             ; CODE XREF: mb_chtoto_dohera_schitaem+38j
    326. .text:004666F7                                         ; mb_chtoto_dohera_schitaem+227j
    327. .text:004666F7                 pop     edi
    328. .text:004666F8                 pop     esi
    329. .text:004666F9                 pop     ebx
    330. .text:004666FA                 leave
    331. .text:004666FB                 retn
    332. .text:004666FB mb_chtoto_dohera_schitaem endp
    333. .text:004666FB
     
  2. JCronuz

    JCronuz New Member

    Публикаций:
    0
    Регистрация:
    26 сен 2007
    Сообщения:
    1.240
    Адрес:
    Russia
    1. Options -> Demangled names - установи в names.
    IDA способна идентифицировать функции многих компиляторов.

    2. может файл зальешь
     
  3. JCronuz

    JCronuz New Member

    Публикаций:
    0
    Регистрация:
    26 сен 2007
    Сообщения:
    1.240
    Адрес:
    Russia
  4. diamond

    diamond New Member

    Публикаций:
    0
    Регистрация:
    21 май 2004
    Сообщения:
    507
    Адрес:
    Russia
    Это __sbh_free_block из мелкомягкой Сишной библиотеки - вспомогательная функция для функции освобождения памяти free().
     
  5. ktoto

    ktoto New Member

    Публикаций:
    0
    Регистрация:
    12 мар 2008
    Сообщения:
    21
    Хм. Данке Вел.