| View previous topic :: View next topic |
| Author |
Message |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8588 Location: 127.0.0.1
|
Posted: Mon May 26, 2008 9:56 am Post subject: |
|
|
Uh.. relook at the params of CreateRemoteThread:
| Code: | HANDLE WINAPI CreateRemoteThread(
__in HANDLE hProcess,
__in LPSECURITY_ATTRIBUTES lpThreadAttributes,
__in SIZE_T dwStackSize,
__in LPTHREAD_START_ROUTINE lpStartAddress,
__in LPVOID lpParameter,
__in DWORD dwCreationFlags,
__out LPDWORD lpThreadId
); |
pThreadId
A pointer to a variable that receives the thread identifier.
If this parameter is NULL, the thread identifier is not returned.
The last param is a storage buffer to hold an ID, not a handle. This should be casted as something like:
| Code: | DWORD dwThreadId = NULL;
CreateRemoteThread( ... , &dwThreadId ); |
_________________
- Retired. |
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Mon May 26, 2008 10:06 am Post subject: |
|
|
Ok, I fixed it. But now errorcode isn't being initialized. So if I initialize it to NULL/0 because it's not being used it says:
| Quote: |
First-chance exception at 0x7c82145e in Dll Injector.exe: 0xC0000005: Access violation writing location 0x00000000.
Unhandled exception at 0x7c82145e in Dll Injector.exe: 0xC0000005: Access violation writing location 0x00000000.
|
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8588 Location: 127.0.0.1
|
Posted: Mon May 26, 2008 10:10 am Post subject: |
|
|
| Code: | if(WaitForSingleObject(hThread, INFINITE) != WAIT_FAILED) {
LPDWORD exitcode;
if(GetExitCodeThread(hThread, exitcode)) {
Inject = (exitcode == NULL) ? FALSE : TRUE;
} |
I assume you mean that. Change it to DWORD exitcode; and put it at the top with the rest of the other variables for the function. Then call GetExitCodeThread using &exitcode instead of just exitcode. _________________
- Retired. |
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Mon May 26, 2008 11:05 am Post subject: |
|
|
Thank you Wiccaan. It finally works now. I do have a question though. How would I make it so that it can detect if that process is still running. So then if you end the process it will take the process name out of my editbox and I can refresh the process list. And mainly, I had another thread that nobody could seem to help with, but with my second editbox displaying the process name selected is supposed to display the process name whenever you click/double click a process name. But it only displays if you hover over a button. My code is:
| Code: |
case WM_NOTIFY:
GetIndexName();
break;
|
But if I filter it it won't work at all:
| Code: |
case WM_NOTIFY:
switch(LOWORD(wParam)) {
case IDC_PROCESS_EDIT:
GetIndexName();
break;
}
break;
|
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8588 Location: 127.0.0.1
|
Posted: Mon May 26, 2008 11:38 am Post subject: |
|
|
Up to you how you want to do it, you could remove the item based on it's index. Or you could clear the full list and refill it. _________________
- Retired. |
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Mon May 26, 2008 12:12 pm Post subject: |
|
|
Nonono, how would I detect that it stopped? _________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
HalfPrime Grandmaster Cheater
Reputation: 0
Joined: 12 Mar 2008 Posts: 532 Location: Right there...On your monitor
|
Posted: Mon May 26, 2008 12:22 pm Post subject: |
|
|
loop createtool32helpsnapshot _________________
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Mon May 26, 2008 12:26 pm Post subject: |
|
|
Somehow I think there is a better way... _________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Mon May 26, 2008 2:04 pm Post subject: |
|
|
example plz o.o I have no idea how to even go about doing that. _________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Mon May 26, 2008 2:29 pm Post subject: |
|
|
Im pretty sure you have to code a driver, but if you don't want to do that, then just loop CreateToolhelp32Snapshot.
Else, here's an example. It's called Process Hunter _________________
|
|
| Back to top |
|
 |
UnLmtD Grandmaster Cheater
Reputation: 0
Joined: 13 Mar 2007 Posts: 894 Location: Canada
|
Posted: Mon May 26, 2008 2:30 pm Post subject: |
|
|
There's no need for you to code a driver for such a task, I believe Wiccaan already answered your question in one of your topics. _________________
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Mon May 26, 2008 2:36 pm Post subject: |
|
|
Yeah I've seen that before. I think I'll just loop CreateToolhelp32Snapshot. But what do I do to compare the snapshots. I can't just do:
| Code: |
if(hSnapshot2 == hSnapshot) {
}
|
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
samuri25404 Grandmaster Cheater
Reputation: 7
Joined: 04 May 2007 Posts: 955 Location: Why do you care?
|
Posted: Mon May 26, 2008 9:10 pm Post subject: |
|
|
That's where your program becomes different from everyone else's.
I, personally, would probably create an array of process name strings, and do some checking via indexes, like so:
| Code: |
//Declared somewhere else:
char *procNames1[10];
char *procNames2[10];
//...
//...
for( int i = 0; i < 10; i++ ) {
if( strcmp( procNames1[i], procNames2[i] ) != 0 ) //do update
}
|
It's your program, though. =P _________________
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Mon May 26, 2008 9:51 pm Post subject: |
|
|
| Code: |
hSnapshot2 = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL);
PROCESSENTRY32 Pe32;
Pe32.dwSize = sizeof(PROCESSENTRY32);
Process32First(hSnapshot2, &Pe32);
do {
if(strcmp(pe32.szExeFile, Pe32.szExeFile) != 0) {
SendMessage(hList, LB_RESETCONTENT, NULL, NULL);
ListProcess();
}
} while(Process32Next(hSnapshot2, &Pe32));
CloseHandle(hSnapshot2);
|
And I could put that in a timer or something that does that like every 3 seconds. But of course then I guess I would have to make my hSnapshot and pe32 variables global... _________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
|