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 


Quick Question

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
iPromise
Grandmaster Cheater
Reputation: -1

Joined: 27 Jun 2009
Posts: 529
Location: Canada

PostPosted: Tue Feb 23, 2010 10:34 pm    Post subject: Quick Question Reply with quote

My first question is I have been reading many articles about Vista with dll injection, and found out that Vista has put a 'hook' on to CreateRemoteThread and can be only used under certain 'privledges'.

Now, I have attempted to run my injector as Administrator, but that didn't do any good. So I thought of using SetWindowsHookEx() dll injection method, but that method sucks balls even though I got it to work on a couple of app's. I'm wondering my Vista is so limited in dll injection compared to XP, can't they just fix XP, because it seems to be its the only good OS. Anyhow, my question is can we possibly get the CreateRemoteThread() dll injection to work, I know it's possible, not denying but what are those 'privledges' you need?
Back to top
View user's profile Send private message MSN Messenger
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Tue Feb 23, 2010 11:59 pm    Post subject: Reply with quote

the problem is your code, not the os.
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Wed Feb 24, 2010 4:40 am    Post subject: Reply with quote

we already determined in the previous thread you made this claim that the problem was your code. post it and perhaps someone will bother to deobfuscate and fix it
Back to top
View user's profile Send private message
iPromise
Grandmaster Cheater
Reputation: -1

Joined: 27 Jun 2009
Posts: 529
Location: Canada

PostPosted: Wed Feb 24, 2010 6:15 pm    Post subject: Reply with quote

I tested the same 'code' in Windows XP and it worked fine.
Back to top
View user's profile Send private message MSN Messenger
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Wed Feb 24, 2010 7:15 pm    Post subject: Reply with quote

I've never had any trouble with DLL injection in vista... post your code
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

Joined: 09 May 2003
Posts: 25840
Location: The netherlands

PostPosted: Wed Feb 24, 2010 8:11 pm    Post subject: Reply with quote

cheat engine's dll injector uses CreateRemoteThread as well
Speedhack makes use of dll injection
And speedhack works fine in vista and win7

Have you tried turning UAC off ?

Given your application the SeDebugging rights ?

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Anden100
Grandmaster Cheater
Reputation: 0

Joined: 20 Apr 2007
Posts: 668

PostPosted: Thu Feb 25, 2010 1:56 am    Post subject: Reply with quote

Dark Byte wrote:
cheat engine's dll injector uses CreateRemoteThread as well
Speedhack makes use of dll injection
And speedhack works fine in vista and win7

Have you tried turning UAC off ?

Given your application the SeDebugging rights ?


Debugging rights is not necessary for CreateRemoteThread or WriteProcessMemory, at least not for me

Make sure you do OpenProcess() with only the necessary privileges, and it should work just fine.
Back to top
View user's profile Send private message
iPromise
Grandmaster Cheater
Reputation: -1

Joined: 27 Jun 2009
Posts: 529
Location: Canada

PostPosted: Thu Feb 25, 2010 11:39 am    Post subject: Reply with quote

Okay, i'll test it out, i'll edit this post with my results.

Hehehe

Turned off UAC, gave my injector rights, but, it fails once again.

Quote:

Cheat Engine 5.6 - Failure enabling Speedhack. (DLL Injection Failed)


Code:

#include <windows.h>
#include <iostream>
#include <string>

using namespace std;

void main()
{
   string DllPath = "C:\\Users\\Al - Homedawy\\Documents\\Visual Studio 2008\\Projects\\Memory Engine (Dll)\\Debug\\Memory Engine (Dll).dll";
   
   HMODULE hKernel32 = GetModuleHandleA("Kernel32");   
   FARPROC hLoadLibrary = GetProcAddress(hKernel32, "LoadLibraryA"); 

   HANDLE hToken;
   TOKEN_PRIVILEGES tkp;

   if(OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken))
   {
      LookupPrivilegeValue(NULL, SE_DEBUG_NAME, &tkp.Privileges[0].Luid);
      tkp.PrivilegeCount = 1;
      tkp.Privileges[0].Attributes  = SE_PRIVILEGE_ENABLED;
      AdjustTokenPrivileges(hToken, 0, &tkp, sizeof(tkp), NULL, NULL);
   }

   HWND hWnd = FindWindowA(NULL, "Untitled - Notepad");
   DWORD pID;
   GetWindowThreadProcessId(hWnd, &pID);

   HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, false, pID);
   
   LPVOID Address = VirtualAllocEx(hProcess, NULL, strlen(DllPath.c_str()), MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE);

   if (!Address)
   {
      cout << "VirtualAllocEx() Failed" << endl;
   }
   else
   {
      cout << "VirtualAllocEx() Succeeded!" << endl;
   }

   SIZE_T BytesWritten;

   WriteProcessMemory(hProcess, Address, DllPath.c_str(), strlen(DllPath.c_str()), &BytesWritten);

   HANDLE hRemoteThread = CreateRemoteThread(hProcess, NULL, 0, (LPTHREAD_START_ROUTINE) hLoadLibrary, Address, 0, NULL);

   if (!hRemoteThread)
   {
      cout << "CreateRemoteThread() Failed" << endl;
   }   
   else
   {
      cout << "CreateRemoteThread() Succeeded" << endl;
   }

   cin.get();
}
Back to top
View user's profile Send private message MSN Messenger
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Thu Feb 25, 2010 1:17 pm    Post subject: Reply with quote

despite your very very disgusting code, the functionality of the injector does exist. the only code in there that doesn't make me want to throw up is the acquisition of tokens which i'm pretty sure i gave you

also. good job lying before about how you allegedly fixed your injector and got it working.

in b4denial

your couts are causing your program to crash. remove them and it will inject. and if you want to use the ansi versions of the APIs then learn how to use your IDE's settings instead of what you're currently doing

and code either C or C++. don't mix bad C code with random C++ features
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Thu Feb 25, 2010 4:23 pm    Post subject: Reply with quote

void main()? really?

you should write a simple function that wraps GetLastError / FormatMessage and returns the error string. makes debugging life all that much simpler.
Back to top
View user's profile Send private message
iPromise
Grandmaster Cheater
Reputation: -1

Joined: 27 Jun 2009
Posts: 529
Location: Canada

PostPosted: Mon Mar 01, 2010 6:36 pm    Post subject: Reply with quote

If something is wrong with my code, could somebody explain to me why speedhack in CE won't work?

Quote:

Cheat Engine 5.6 - Failure enabling Speedhack. (DLL Injection Failed)
Back to top
View user's profile Send private message MSN Messenger
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Mon Mar 01, 2010 7:05 pm    Post subject: Reply with quote

that's a separate matter. i just told you the code does not work and after i edited it, it worked. i even told you how to fix it. stop believing your OS or compiler or language is broken. it's just you and your broken code. stubbornness and ignorance are such a horrible combination
Back to top
View user's profile Send private message
samo502
Master Cheater
Reputation: 0

Joined: 14 Mar 2008
Posts: 342
Location: That place.

PostPosted: Tue Mar 02, 2010 1:06 am    Post subject: Reply with quote

Personally I think it would be better to use WinMain on something like this so you don't have a virtually useless console laying around and use Messageboxes to display errors since they are the most common method, and obviously the console sitting around since it only appears to be doing error report work. Just my opinion though.
Back to top
View user's profile Send private message MSN Messenger
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