| View previous topic :: View next topic |
| Author |
Message |
Cheat Engine User Something epic
Reputation: 60
Joined: 22 Jun 2007 Posts: 2071
|
Posted: Sun Mar 09, 2008 4:05 pm Post subject: DEV C++ Error 1 |
|
|
| Code: | #include "dll.h"
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
//Define variables
DWORD ThreadID;
int *time = (int*)0x0100579C; //Offset for time.
DWORD WINAPI changeTime(LPVOID lParam) {
while(1)
*time = 0;
ExitThread(0);
}
//DllMain
BOOL APIENTRY DllMain(HINSTANCE hDll, DWORD callReason, LPVOID lpReserved) {
if(callReason == DLL_PROCESS_ATTACH) {
MessageBox(0, "Dll Injection Successful! ", "Dll Injector", MB_ICONEXCLAMATION | MB_OK);
CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)&changeTime, 0, 0, &ThreadID);
}
return 1;
} |
Makes me get the error:
| Quote: | | C:\Dev-Cpp\Makefile.win [Build Error] ["Project] Error 1 |
What did I do wrong? |
|
| Back to top |
|
 |
Noz3001 I'm a spammer
Reputation: 26
Joined: 29 May 2006 Posts: 6220 Location: /dev/null
|
Posted: Sun Mar 09, 2008 4:25 pm Post subject: |
|
|
| changeTime() isn't returning a value. |
|
| Back to top |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
Posted: Sun Mar 09, 2008 5:04 pm Post subject: |
|
|
| noz3001 wrote: | | changeTime() isn't returning a value. |
Doesn't need to, ExitThread(0);.
After a little bit go searching for that error, it just means that a general compiling error occurred. Most people complain that it is because their path environmental variable is wrong.
Also:
| Code: | void __declspec(noreturn) changeTime() {
for(;; Sleep(10)) *((int*)0x0100579C) = 0;
ExitThread(0); // Won't get here, oh well.
} |
|
|
| Back to top |
|
 |
Cheat Engine User Something epic
Reputation: 60
Joined: 22 Jun 2007 Posts: 2071
|
Posted: Mon Mar 10, 2008 5:22 am Post subject: |
|
|
| Flyte wrote: | | noz3001 wrote: | | changeTime() isn't returning a value. |
Doesn't need to, ExitThread(0);.
After a little bit go searching for that error, it just means that a general compiling error occurred. Most people complain that it is because their path environmental variable is wrong.
Also:
| Code: | void __declspec(noreturn) changeTime() {
for(;; Sleep(10)) *((int*)0x0100579C) = 0;
ExitThread(0); // Won't get here, oh well.
} |
|
I already searched before I posted (I rarely post threads like this), and I found out what you're saying.
But I dont understand the solutions. Could you tell me how to fix it? |
|
| Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Mon Mar 10, 2008 5:55 am Post subject: |
|
|
I always got this error with dev-cpp too, I use VC 2008 now.
Not sure if thats the problem, but the DLL is probably in use already, close any process this dll is injected and any injector you opened it with.
And instead of an infinite loop, simply nop the address that incrases the time. |
|
| Back to top |
|
 |
Cheat Engine User Something epic
Reputation: 60
Joined: 22 Jun 2007 Posts: 2071
|
Posted: Mon Mar 10, 2008 7:43 am Post subject: |
|
|
| meh I got VC 2008 too but it's too complicated. Maybe you could help me over MSN? |
|
| Back to top |
|
 |
|