Editing desktop icons text

zorro59

Newbie
Joined
Sep 20, 2011
Messages
4
Reaction score
1
So here is what i got (code not 100% mine):
Code:
int main()
{
	HWND task;
	task = FindWindow(NULL, TEXT("Program Manager"));
	task = FindWindowEx(task, NULL, TEXT("SHELLDLL_DefView"), NULL);
	task = FindWindowEx(task, NULL, NULL, TEXT("FolderView"));

	int count=(int)SendMessage(task, LVM_GETITEMCOUNT, 0, 0);
	int i;

	LVITEM lvi, *_lvi;
	char item[512], *_item;

	unsigned long pid;
	HANDLE process;

	GetWindowThreadProcessId(task, &pid);
	process=OpenProcess(PROCESS_VM_OPERATION|PROCESS_VM_READ|
		PROCESS_VM_WRITE|PROCESS_QUERY_INFORMATION, FALSE, pid);

	_lvi=(LVITEM*)VirtualAllocEx(process, NULL, sizeof(LVITEM),
		MEM_COMMIT, PAGE_READWRITE);
	_item=(char*)VirtualAllocEx(process, NULL, 512, MEM_COMMIT,
		PAGE_READWRITE);

	lvi.iSubItem=0;
	lvi.pszText=_item;

	for(i=0; i<count; i++) 
	{
		strcpy(item, "Hacked by zoro59");
		lvi.cchTextMax=NULL;
		WriteProcessMemory(process, _item, &item, sizeof(char[512]), NULL);		
		WriteProcessMemory(process, _lvi, &lvi, sizeof(LVITEM), NULL);
		SendMessage(task, LVM_SETITEMTEXT, (WPARAM)i, (LPARAM)_lvi);

		lvi.cchTextMax=512;
		WriteProcessMemory(process, _lvi, &lvi, sizeof(LVITEM), NULL);
		SendMessage(task, LVM_GETITEMTEXT, (WPARAM)i, (LPARAM)_lvi);
		ReadProcessMemory(process, _item, item, 512, NULL);

		printf("%s\n", item);
	}

	VirtualFreeEx(process, _lvi, 0, MEM_RELEASE);
	VirtualFreeEx(process, _item, 0, MEM_RELEASE);

	return 0;

}
This section works great when it has to read the data, but fails to change it. Things i've tried: adding MEM_RESERVE flag, using lvi.pszText = "smth", writing the data directly into "process", without using another variable, but it all failed.
Can anyone please help me?
 
Have you tried using the PROCESS_ALL_ACCESS flag in your OpenProcess call?
 
Tried that, no success.
Maibe it has something to do with unicode? (i have multi byte set in my project).
 
Last edited:
Maibe it has something to do with unicode?...need for moore researsh I thing.
 
Its because of UIPI.
Works on windows xp perfectly. Anyone knows a way to bypass UIPI?
 
Back
Top