开发者

ListView_GetItem() macro & LV_GETITEMTEXT returns empty STRING while getting another APP listview items

I am fully aware if i try to get buffer of another app listview items that i need to solve memory space boundary so What i am doing is hooking which returns well, no error, success then

enter code here
LVITEM lvi;
lvi.cchTextMax = 552;
lvi.mask = LVIF_TEXT;

_tfreopen(path,_T("w"),stdout);

for (i开发者_StackOverflow社区nt nItem = 0; nItem < nMaxItems; nItem++) {

    // Get the name and position of a ListView item.
    lvi.iSubItem = 0;
    lvi.iItem = nItem;
    lvi.pszText = szName;

    ListView_GetItem(hWndLV, &lvi);
    wprintf(L"%s, ", szName);
    wprintf(L"%s, ", lvi.pszText);
    for ( int subitem = 0; subitem < columns; subitem++)
    {

        lvi.iSubItem = subitem;
        lvi.iItem = nItem;
        lvi.pszText = szName;

        ListView_GetItem(hWndLV, &lvi);

        wprintf(L"%s, ", szName);
        wprintf(L"%s, ", lvi.pszText);

    }  
    wprintf(L"%s", "\n");

}

wprintf(L"%s", GetLastError());
fclose (stdout);

No error with getlasterror and this works perfect on any other listview i tried before except this app, is it possible to still get item text somehow ?


Maybe it is an owner-drawn listview (LVS_OWNERDRAWFIXED)? If this is the case it will not be possible to get the text without private knowledge of the app that owns it.


You don't need to use hooking to get across the process boundary. You can use WriteProcessMemory/ReadProcessMemory as described in the following Code Project article: http://www.codeproject.com/KB/threads/int64_memsteal.aspx

What you have to watch out for is crossing a 32/64 bit boundary. I know of now way to achieve that.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜