Advertisement
Guest User

Untitled

a guest
Feb 18th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.19 KB | None | 0 0
  1. ; Copy the entire table as CSV.
  2. @copy_table:
  3. mov eax,[fs:0]
  4. push -1
  5. push 433480
  6. push eax
  7. mov [fs:0],esp
  8. sub esp,4C
  9. push esi
  10. push ebx
  11. push edi
  12. mov esi,ecx
  13. cmp dword[esi+40],-1
  14. je @out
  15. lea ecx,[esp+4C]
  16. call 4327F2 ; CString::CString
  17. mov dword[esp+0C],4 ; LVCOLUMN.mask = LVCF_TEXT
  18. lea ebx,[esp+20]
  19. mov [esp+18],ebx ; LVCOLUMN.pszText
  20. mov dword[esp+1C],2C ; LVCOLUMN.cchTextMax
  21. xor edi,edi
  22. @@: lea eax,[esp+0C]
  23. push eax ; &LVCOLUMN
  24. push edi ; iCol
  25. push 1019 ; LVM_GETCOLUMN
  26. push dword[esi+20] ; hWndControl
  27. call dword[@SendMessage]
  28. push ebx
  29. lea ecx,[esp+50]
  30. call @cat_str
  31. inc edi
  32. cmp edi,[esi+48]
  33. je short @f
  34. push ','
  35. lea ecx,[esp+50]
  36. call @cat_chr
  37. jmp short @b
  38. @@: push 437A60 ; "\r\n"
  39. lea ecx,[esp+50]
  40. call @cat_str
  41. xor ebx,ebx
  42. xor edi,edi
  43. @row: push edi
  44. lea edx,[esp+54]
  45. push ebx
  46. push edx
  47. mov ecx,esi
  48. call 4329C0 ; CListCtrl::GetItemText
  49. test edi,edi
  50. mov ecx,[eax]
  51. jnz short @f
  52. cmp byte[ecx],0
  53. je short @done
  54. @@: push eax
  55. push ','
  56. lea ecx,[esp+58]
  57. call @fnd_chr
  58. cmp eax,-1
  59. je short @add
  60. push '"'
  61. lea ecx,[esp+54]
  62. call @cat_chr
  63. lea ecx,[esp+50]
  64. call @cat_Str
  65. push '"'
  66. lea ecx,[esp+50]
  67. call @cat_chr
  68. jmp short @f
  69. @add:
  70. lea ecx,[esp+50]
  71. call @cat_Str
  72. @@: lea ecx,[esp+50]
  73. call @CString_dtor
  74. inc edi
  75. cmp edi,[esi+48]
  76. mov eax,44F1D2 ; ","
  77. jne short @f
  78. inc ebx
  79. xor edi,edi
  80. mov eax,437A60 ; "\r\n"
  81. @@: push eax
  82. lea ecx,[esp+50]
  83. call @cat_str
  84. jmp short @row
  85. @done:
  86. lea ecx,[esp+50]
  87. call @CString_dtor
  88. mov eax,[esi+20]
  89. push eax
  90. call dword[436730] ;; OpenClipboard
  91. test eax,eax
  92. jz short @noclip
  93. push ebp
  94. call dword[436750] ;; EmptyClipboard
  95. test eax,eax
  96. jz short @closeclip
  97. mov ecx,[esp+50]
  98. mov eax,[ecx-8]
  99. inc eax
  100. push eax
  101. push 42
  102. call dword[436028] ;; LocalAlloc
  103. mov ebp,eax
  104. test ebp,ebp
  105. jz short @closeclip
  106. push ebp
  107. call dword[436094] ;; LocalLock
  108. test eax,eax
  109. jz short @nolock
  110. mov esi,[esp+50]
  111. mov edi,eax
  112. push ebp
  113. mov ecx,[esi-8]
  114. mov edx,ecx
  115. shr ecx,2
  116. rep movs
  117. mov ecx,edx
  118. and ecx,3
  119. rep movsb
  120. call dword[43602C] ;; LocalUnlock
  121. push ebp
  122. push 1
  123. call dword[436754] ;; SetClipboardData
  124. jmp short @closeclip
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement