Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


DEV C++ Error 1

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Cheat Engine User
Something epic
Ban
Reputation: 60

Joined: 22 Jun 2007
Posts: 2071

PostPosted: Sun Mar 09, 2008 4:05 pm    Post subject: DEV C++ Error 1 Reply with quote

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
View user's profile Send private message
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Sun Mar 09, 2008 4:25 pm    Post subject: Reply with quote

changeTime() isn't returning a value.
Back to top
View user's profile Send private message MSN Messenger
Flyte
Peanuts!!!!
Reputation: 6

Joined: 19 Apr 2006
Posts: 1887
Location: Canada

PostPosted: Sun Mar 09, 2008 5:04 pm    Post subject: Reply with quote

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
View user's profile Send private message
Cheat Engine User
Something epic
Ban
Reputation: 60

Joined: 22 Jun 2007
Posts: 2071

PostPosted: Mon Mar 10, 2008 5:22 am    Post subject: Reply with quote

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
View user's profile Send private message
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Mon Mar 10, 2008 5:55 am    Post subject: Reply with quote

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
View user's profile Send private message
Cheat Engine User
Something epic
Ban
Reputation: 60

Joined: 22 Jun 2007
Posts: 2071

PostPosted: Mon Mar 10, 2008 7:43 am    Post subject: Reply with quote

meh I got VC 2008 too but it's too complicated. Maybe you could help me over MSN?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites