Go Back   FileForums > Games > Game Coders

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 27-10-2011, 14:58
cocodrilo cocodrilo is offline
Registered User
 
Join Date: Jun 2011
Location: spain
Posts: 43
Thanks: 0
Thanked 1 Time in 1 Post
cocodrilo is on a distinguished road
Stronghold3 Trainer source code (by sicheats) Added god mode

This is the source code for the sicheats trainer, to run is necesary a dll included in the download rar. source of dll is not need, only loads a lua script and handle the onKeyDown function.

EDITED: added resources option.

Fixed: environment script execution fixed in the dll. link to dll http://www.megaupload.com/?d=UO8TMT05

Code:
--StrongHold3 trainer by cocodrilo.
--can you make your own options.
-- www.sicheats.com

function getLocalPlayer()
 local e = { GameLib.GetEstates() }
 for n,tmp in ipairs(e) do
   if tmp and tmp:GetPlayer():IsHumanControlled() then
     return tmp
   end
 end
 return nil
end

function addGold(gValue)
 local miPlayer = getLocalPlayer()
 if miPlayer~=nil then
   miPlayer.m_gameState.iGold = miPlayer.m_gameState.iGold + gValue
 end
end

function addHonour(hValue)
 local miPlayer = getLocalPlayer()
 if miPlayer~=nil then
   miPlayer.m_gameState.iHonour  = miPlayer.m_gameState.iHonour + hValue
 end
end

function addResources(rValue)
 local miPlayer = getLocalPlayer()
 if miPlayer~=nil then
   for i=1,31 do
     miPlayer.m_gameState.hResources[i] = Inc(miPlayer.m_gameState.hResources[i],rValue)
   end
 end
end

function Inc(a,b)
 return a+b
end

--Hooked Damage function. simply return, not call the original.
function miDamage()
 return
end

function setGodMode()
 local ent = GameLib.GetEntityUnderMouse()
 if ent~=nil then
  ent.Damage = miDamage
 end
end

function onKeyDown(key)
 if key==112 then  --F1: add gold
   addGold(5000)
 elseif key==113 then  --F2: add honour
   addHonour(1000)
 elseif key==114 then  --F3: no build costs
   Game.Options.Cheats.bNoBuildCosts = true
 elseif key==115 then  --F4: add resources
   addResources(1000)
 elseif key == 116 then -- F5: add god mode to selected unit
   setGodMode()
 end
end

Last edited by cocodrilo; 28-10-2011 at 17:25.
Reply With Quote
Sponsored Links
  #2  
Old 28-11-2011, 09:11
ptsz ptsz is offline
Registered User
 
Join Date: Nov 2011
Location: Offland
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
ptsz is on a distinguished road
How do you run the dll though?

I saw your trainer also on sicheats but its down at the moment.
Reply With Quote
  #3  
Old 28-11-2011, 13:26
cocodrilo cocodrilo is offline
Registered User
 
Join Date: Jun 2011
Location: spain
Posts: 43
Thanks: 0
Thanked 1 Time in 1 Post
cocodrilo is on a distinguished road
winject or another injector.
Reply With Quote
  #4  
Old 28-11-2011, 17:13
ptsz ptsz is offline
Registered User
 
Join Date: Nov 2011
Location: Offland
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
ptsz is on a distinguished road
Thanks man. I got it working. Nice trainer.
Reply With Quote
  #5  
Old 30-11-2011, 17:07
STN STN is offline
Registered User
 
Join Date: Aug 2008
Location: a dark cave that has gone wet
Posts: 70
Thanks: 2
Thanked 6 Times in 5 Posts
STN is on a distinguished road
Huh not really a source, the title is misguiding. It is just your dll that people have to manually inject themselves instead of using your main trainer gui (which might be good, peeps don't have to go through the drm stuff)

The lua script is even using custom key codes for hotkeys, you should mention all the key codes so at least users can change the hotkeys.

This might help.
http://en.wikipedia.org/wiki/Source_code
__________________
DEViATED - We are seriously iNSANE!
Reply With Quote
  #6  
Old 01-12-2011, 17:12
cocodrilo cocodrilo is offline
Registered User
 
Join Date: Jun 2011
Location: spain
Posts: 43
Thanks: 0
Thanked 1 Time in 1 Post
cocodrilo is on a distinguished road
Quote:
Huh not really a source
¿no? trainer is written in lua, this is the source code.

¿what is my GUI? I don't have a GUI. there are a lot of injectors ¿I need to write another?.

Quote:
The lua script is even using custom key codes for hotkeys, you should mention all the key codes so at least users can change the hotkeys.
is obvious, the key codes are a VK_* constants from Windows. "onKeyDown" is a simple wrapper from WindowProc ...

if this is not the source code ¿what is it?.

the dll only calls to lua_loadfile and lua_pcall to load this source code in game. and have a custom windowproc to handle keys in lua script ¿is this interestings?.
Reply With Quote
  #7  
Old 04-12-2011, 09:30
STN STN is offline
Registered User
 
Join Date: Aug 2008
Location: a dark cave that has gone wet
Posts: 70
Thanks: 2
Thanked 6 Times in 5 Posts
STN is on a distinguished road
I was talking about the addresses since that included would make a complete source. And the hotkeys, yeah they are virtual keycodes actually but in decimel. I thought they were your customs ones since MSDN etc brings hex codes and i was thinking in hex.

Anyway, yeah its pretty customizable so i guess it counts as a source.
__________________
DEViATED - We are seriously iNSANE!
Reply With Quote
  #8  
Old 05-12-2011, 10:31
cocodrilo cocodrilo is offline
Registered User
 
Join Date: Jun 2011
Location: spain
Posts: 43
Thanks: 0
Thanked 1 Time in 1 Post
cocodrilo is on a distinguished road
Quote:
I was talking about the addresses
what addresses?.

this game uses lua from a dll, not is statically linked. I using GetProcAddress to get functions from lua. in statically linked versions is need to find a pattern (per function), but isn't this case.
Reply With Quote
  #9  
Old 31-05-2013, 11:53
the_true_love72 the_true_love72 is offline
Registered User
 
Join Date: May 2013
Location: egypt
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
the_true_love72 is on a distinguished road
plz can anybody reupload the dll ?!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Announcement and final word on the CheatHappens vs. h4x0r trainer war Joe Forster/STA Game Trainers 7 12-07-2010 08:31
trainer and source code... pikachu5501 Game Coders 2 14-05-2007 23:18



All times are GMT -7. The time now is 03:18.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
FileForums @ https://fileforums.com