Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Copy the entire table as CSV.
- @copy_table:
- mov eax,[fs:0]
- push -1
- push 433480
- push eax
- mov [fs:0],esp
- sub esp,4C
- push esi
- push ebx
- push edi
- mov esi,ecx
- cmp dword[esi+40],-1
- je @out
- lea ecx,[esp+4C]
- call 4327F2 ; CString::CString
- mov dword[esp+0C],4 ; LVCOLUMN.mask = LVCF_TEXT
- lea ebx,[esp+20]
- mov [esp+18],ebx ; LVCOLUMN.pszText
- mov dword[esp+1C],2C ; LVCOLUMN.cchTextMax
- xor edi,edi
- @@: lea eax,[esp+0C]
- push eax ; &LVCOLUMN
- push edi ; iCol
- push 1019 ; LVM_GETCOLUMN
- push dword[esi+20] ; hWndControl
- call dword[@SendMessage]
- push ebx
- lea ecx,[esp+50]
- call @cat_str
- inc edi
- cmp edi,[esi+48]
- je short @f
- push ','
- lea ecx,[esp+50]
- call @cat_chr
- jmp short @b
- @@: push 437A60 ; "\r\n"
- lea ecx,[esp+50]
- call @cat_str
- xor ebx,ebx
- xor edi,edi
- @row: push edi
- lea edx,[esp+54]
- push ebx
- push edx
- mov ecx,esi
- call 4329C0 ; CListCtrl::GetItemText
- test edi,edi
- mov ecx,[eax]
- jnz short @f
- cmp byte[ecx],0
- je short @done
- @@: push eax
- push ','
- lea ecx,[esp+58]
- call @fnd_chr
- cmp eax,-1
- je short @add
- push '"'
- lea ecx,[esp+54]
- call @cat_chr
- lea ecx,[esp+50]
- call @cat_Str
- push '"'
- lea ecx,[esp+50]
- call @cat_chr
- jmp short @f
- @add:
- lea ecx,[esp+50]
- call @cat_Str
- @@: lea ecx,[esp+50]
- call @CString_dtor
- inc edi
- cmp edi,[esi+48]
- mov eax,44F1D2 ; ","
- jne short @f
- inc ebx
- xor edi,edi
- mov eax,437A60 ; "\r\n"
- @@: push eax
- lea ecx,[esp+50]
- call @cat_str
- jmp short @row
- @done:
- lea ecx,[esp+50]
- call @CString_dtor
- mov eax,[esi+20]
- push eax
- call dword[436730] ;; OpenClipboard
- test eax,eax
- jz short @noclip
- push ebp
- call dword[436750] ;; EmptyClipboard
- test eax,eax
- jz short @closeclip
- mov ecx,[esp+50]
- mov eax,[ecx-8]
- inc eax
- push eax
- push 42
- call dword[436028] ;; LocalAlloc
- mov ebp,eax
- test ebp,ebp
- jz short @closeclip
- push ebp
- call dword[436094] ;; LocalLock
- test eax,eax
- jz short @nolock
- mov esi,[esp+50]
- mov edi,eax
- push ebp
- mov ecx,[esi-8]
- mov edx,ecx
- shr ecx,2
- rep movs
- mov ecx,edx
- and ecx,3
- rep movsb
- call dword[43602C] ;; LocalUnlock
- push ebp
- push 1
- call dword[436754] ;; SetClipboardData
- jmp short @closeclip
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement