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 


SpeedHack-i386.dll Functions and sample usage?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
DTeCH
Newbie cheater
Reputation: 0

Joined: 19 Jul 2013
Posts: 23
Location: Cayman Islands

PostPosted: Fri Nov 29, 2013 9:40 am    Post subject: SpeedHack-i386.dll Functions and sample usage? Reply with quote

Hey guys Smile


I know that the common answer to this question would be to go check out the source on Google's code site where CE is hosting it's source, but as much as I've stared at it, I must admit that I don't understand a thing i'm looking at. It's like me gazing at Japanese (the old school Japanese too! Very Happy), & expecting it to magically make sense some how.

All I want to know is what functions are available, & how to basically call them once injected. I've written quite a few injectors over the years when I was an AVA addict, but I'd like to see a sample call to enable/disable the DLL's whatever... like hooking, or whatever it does once injected.

I use the speedhack in my trainers made with CE's trainer maker thing, & It works just fine. I just hate the freezing of the resulting trainers while scanning, or using AoBSwap, so I've made my own in pure .NET

Now I'm stuck on the speedhack-i386.dll usage.

This is how I used it in CE's LUA thingy...
Code:

function SpeedHackButton(sender)
   createNativeThread(CESpeedHackClick(sender))
   processMessages()
end

function CESpeedHackClick(sender)
   labelFont8 = control_getFont(CETrainer_CESpeedHack)
   if (gButtonOnX) then
      control_setEnabled(CETrainer_CESpeedHack, false)
      control_setCaption(CETrainer_CESpeedHack, "SpeedHack 5x")
      gButtonOnX=false
      speedhack_setSpeed(1)
      processMessages()
      sender.Font.Style = "[]"
      sender.Font.Color = "[clDefault]"
      font_setColor(labelFont8, 0x000000)
      control_setEnabled(CETrainer_CESpeedHack, true)
      processMessages()
      customSound.PlaySound(2)
  else
      control_setEnabled(CETrainer_CESpeedHack, false)
      control_setCaption(CETrainer_CESpeedHack, "Wait")
      gButtonOnX=true
      speedhack_setSpeed(5)
      control_setCaption(CETrainer_CESpeedHack, "SpeedHack 5x")
      sender.Font.Style = "[fsBold]"
      sender.Font.Color = "[clGreen]"
      font_setColor(labelFont8, 0x00aa00)
      control_setEnabled(CETrainer_CESpeedHack, true)
      processMessages()
      customSound.PlaySound(1)
      end
end


BTW... createNativeThread makes no difference... it still freezes the main thread until the scan, or Swapping is complete.


From the looks of the LUA script above, setSpeed(n) is the function to call? A parameter of 1 returns the speed to normal, & 5 to 5 times normal speed? I know it's a long shot to ask for an example in another language that's not LUA, but here goes lol... Can someone please show an example in another language other than LUA please? Very Happy

_________________
Hitler... When all else fails, you'll be in the right state of mind. Jesus Saves.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Fri Nov 29, 2013 10:30 am    Post subject: Reply with quote

You'll have to hook/redirect the timer api's to the ones in the dll, and fill in the original api function call stub address (the speedhack dll can't be loaded without any assembly changes by a secondary program)

Also, your usage of createNativeThread is wrong. Never touch any gui objects in a thread

Use it to do Memscan object scans and writeInterger/autoAssemble calls with the results of the memscan
Certainly don't use processMessages inside a thread

_________________
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
DTeCH
Newbie cheater
Reputation: 0

Joined: 19 Jul 2013
Posts: 23
Location: Cayman Islands

PostPosted: Fri Nov 29, 2013 11:20 am    Post subject: Reply with quote

I just knew I was using createNativeThread wrong! lol


The trainers seems to do those SpeedHack things automatically somehow without any input from me, and leads me to assume that whatever process I inject into has a set location of the timer API call... I think this because the trainers all work flawlessly, & I didn't do anything extra to get it done other than tell CE to add the SpeedHack feature, & me calling it with a parameter of 5, or 1.

I really want to understand it, but have nothing to read, or no one to watch while they do it. It looks like I'll really have to learn Delphi/pascal - which isn't gonna happen any time soon. Won't be mastered overnight.

I guess I can figure out a way to get it redirected to the DLL, but I have never done this before, & is left to wonder if there's some set header location, or whatever that is constant, & mandatory for programs to have that I can alter, or does it have to be scanned for? (Timer API) ...or even the system's Timer API maybe?

In any event... I'm going to try to re-do the createNativeThread thingy to see if I can get it right this time. An example might be best - based on the code I have above would be nice, or not. lol

_________________
Hitler... When all else fails, you'll be in the right state of mind. Jesus Saves.
Back to top
View user's profile Send private message AIM Address Yahoo 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