Registration Code (Part 1): w%kQ6
Registration Code (Part 2): b<#$1[*(cw~
In order to register on this forum, you must use the codes above. Combine them into one code (copy paste).

Grim Dawn Hook - Development Information

Topics regarding the new upcoming ARPG Grim Dawn.
User avatar
atom0s
Site Admin
Posts: 403
Joined: Sun Jan 04, 2015 11:23 pm
Location: 127.0.0.1
Contact:

Grim Dawn Hook - Development Information

Post by atom0s » Sun Mar 22, 2015 7:37 pm

I am dedicating this thread as a location for me to dump various information about Grim Dawn while I work on this project.

Current Lua State Dump
  1. -----------------------------------------------------------------------
  2.  -- Functions
  3.  -----------------------------------------------------------------------
  4.  ClearObjectUserdata
  5.  CrossProduct
  6.  DotProduct
  7.  GiveTokenIfPlayer
  8.  GiveTokenToLocalPlayer
  9.  QuestEvent
  10.  QuestEventDispatch
  11.  QuestGlobalEvent
  12.  RemoveTokenFromLocalPlayer
  13.  TokenStateBasedObjectSwap
  14.  UpdateObjectSwap
  15.  WaveEvent_DefaultEndCallback
  16.  WaveEvent_End
  17.  WaveEvent_OnAddToWorld
  18.  WaveEvent_OnRemoveFromWorld
  19.  WaveEvent_SpawnNext
  20.  WaveEvent_Start
  21.  WaveEvent_Update
  22.  assert
  23.  class
  24.  collectgarbage
  25.  cos
  26.  dofile
  27.  dump
  28.  dumpex
  29.  dumpr
  30.  error
  31.  gcinfo
  32.  getfenv
  33.  getmetatable
  34.  ipairs
  35.  load
  36.  loadfile
  37.  loadstring
  38.  max
  39.  min
  40.  module
  41.  newproxy
  42.  next
  43.  orderedTable
  44.  pairs
  45.  pcall
  46.  pow
  47.  print
  48.  random
  49.  rawequal
  50.  rawget
  51.  rawset
  52.  require
  53.  select
  54.  setfenv
  55.  setmetatable
  56.  sin
  57.  sortedpair
  58.  sqrt
  59.  tan
  60.  tonumber
  61.  tostring
  62.  type
  63.  unpack
  64.  xpcall
  65.  
  66.  -----------------------------------------------------------------------
  67.  -- Properties
  68.  -----------------------------------------------------------------------
  69.  Client
  70.  Server
  71.  _VERSION
  72.  __luaglue_version
  73.  
  74.  -----------------------------------------------------------------------
  75.  -- Tables
  76.  -----------------------------------------------------------------------
  77.  Actor
  78.  Character
  79.  Chest
  80.  Coords
  81.  Destructible
  82.  Door
  83.  Entity
  84.  Game
  85.  MpScript
  86.  Object
  87.  Player
  88.  Proxy
  89.  QuestState
  90.  Riftgate
  91.  Script
  92.  Shared
  93.  SoundType
  94.  Time
  95.  UI
  96.  Vec
  97.  WorldCoords
  98.  WorldVec
  99.  _G
  100.  __luaglue
  101.  bit
  102.  coroutine
  103.  debug
  104.  gd
  105.  io
  106.  jit
  107.  math
  108.  os
  109.  package
  110.  string
  111.  table
Here is the current hierarchy of the player object and its base class inheritance:
  1. GrantQuest: function: 0x0a9757b8
  2. GetQuestState: function: 0x0a978538
  3. GetFaction: function: 0x0a975268
  4. GetQuestTaskState: function: 0x0a975750
  5. __base:
  6.     Move: function: 0x0a975390
  7.     AdjustMoney: function: 0x0a97be08
  8.     GetLevel: function: 0x0a9751a8
  9.     GiveExperience: function: 0x0a97be78
  10.     Create: function: 0x0a97b908
  11.     TakeItem: function: 0x0a976a20
  12.     __base:
  13.         __cname: Actor
  14.         __base:
  15.             GetCoords: function: 0x0a97b248
  16.             __cname: Entity
  17.             Create: function: 0x0a971db8
  18.             IsType: function: 0x0a97a038
  19.             NetworkEnable: function: 0x0a97b1a8
  20.             __base:
  21.                 GetId: function: 0x0a97a6c8
  22.                 __type: -9
  23.                 __cname: Object
  24.                 Get: function: 0x0a971b18
  25.                 GetName: function: 0x0a97a608
  26.                 Destroy: function: 0x0a971a08
  27.             IsReloaded: function: 0x0a97b318
  28.             Get: function: 0x0a971d50
  29.             __type: -10
  30.             SetCoords: function: 0x0a97b2b0
  31.         __type: -11
  32.         Get: function: 0x0a97b5a0
  33.     GiveItem: function: 0x0a975840
  34.     Kill: function: 0x0a972e88
  35.     Say: function: 0x0a976c10
  36.     GiveLevels: function: 0x0a97bee0
  37.     __cname: Character
  38.     Turn: function: 0x0a9753d8
  39.     Attack: function: 0x0a975070
  40.     IsType: function: 0x0a97b930
  41.     HasItem: function: 0x0a977320
  42.     GiveSkillPoints: function: 0x0a97bd68
  43.     PlaySound: function: 0x0a9786a0
  44.     __type: -12
  45.     Get: function: 0x0a975580
  46. DestroyItem: function: 0x0a976b30
  47. GetPlayerName: function: 0x0a9772b0
  48. CompleteQuest: function: 0x0a976ac8
  49. __cname: Player
  50. GiveToken: function: 0x0a9752d0
  51. HasToken: function: 0x0a978e40
  52. AnyoneHasToken: function: 0x0a9776d0
  53. __type: -14
  54. RemoveToken: function: 0x0a9784c8
  55. IsType: function: 0x0a977240
  56. ServerHasToken: function: 0x0a977740
  57. Get: function: 0x0a975528
The setup of the Player object is currently:

Code: Select all

class Object { }
class Entity : Object { }
class Actor : Entity { }
class Character : Actor { }
class Player : Character { }

Player > Character > Actor > Entity > Object
Derp~
Need a great web host? Check out: AnHonestHost.com


Donations can be made via Paypal:
https://www.paypal.me/atom0s
User avatar
atom0s
Site Admin
Posts: 403
Joined: Sun Jan 04, 2015 11:23 pm
Location: 127.0.0.1
Contact:

Re: Grim Dawn Hook - Development Information

Post by atom0s » Sun Mar 22, 2015 7:38 pm

Grim Dawn LuaGlue Library

Here is the luaglue library that Grim Dawn makes use of in their engine:
  1. function __luaglue.class(name)                                 
  2.     -- Ensure name is string                                   
  3.     assert(type(name) == 'string');                            
  4.     -- Create class table and meta-table                       
  5.     local cls, mt = {}, {};                                    
  6.     -- Store class name in __cname field in class table        
  7.     cls.__cname = name;                                        
  8.     -- Setup class instancing calls                            
  9.     mt.__call = __luaglue.instance;                            
  10.     -- Set meta-table for class table                          
  11.     setmetatable(cls, mt);                                     
  12.     -- Create instancing meta-table, index by class table      
  13.     cls.__imt = {};                                            
  14.     cls.__imt.__class = cls;                                   
  15.     cls.__imt.__index = __luaglue.igetter;                     
  16.     cls.__imt.__newindex = __luaglue.isetter;                  
  17.     -- Store class table as global                             
  18.     _G[name] = cls;                                            
  19.     -- Return derivation function                              
  20.     return function(base) __luaglue.derive(cls, base); end     
  21. end
  22.  
  23. function __luaglue.derive(cls, base)                           
  24.     -- Get class meta-table                                    
  25.     local cmt = getmetatable(cls);                             
  26.     -- Index class table by base class                         
  27.     cmt.__index = base;                                        
  28.     -- Store base class in __base member of class table        
  29.     cls.__base = base;                                         
  30. end
  31.  
  32. function __luaglue.instance(cls, ...)                          
  33.     local instance;                                            
  34.     -- Call the C constructor if present in class or bases     
  35.     local ctor = cls.__ctor;                                   
  36.     if (ctor ~= nil) then                                      
  37.         instance = ctor(cls, ...);                             
  38.     else                                                       
  39.         -- Create table for class instance                     
  40.         instance = {};                                         
  41.         -- Assign class instancing meta-table                  
  42.         setmetatable(instance, cls.__imt);                     
  43.     end                                                        
  44.     -- Call Lua constructor                                    
  45.     local init = cls.__init;                                   
  46.     if (init ~= nil) then                                      
  47.         init(instance, ...);                                   
  48.     end                                                        
  49.     -- Return instance                                         
  50.     return instance;                                           
  51. end
  52.  
  53. function __luaglue.tsetter(self, key, value)                           
  54.     -- Check setters table                                         
  55.     local st = rawget(self, '__setters');                          
  56.     if (st ~= nil) then                                            
  57.         local fn = rawget(st, key);                                
  58.         if (fn ~= nil) then                                        
  59.             fn(self, value);                                       
  60.             return;                                                
  61.         end                                                        
  62.     end                                                            
  63.     -- Variable doesn't exist, just set the field in the table     
  64.     rawset(self, key, value);                                      
  65. end
  66.  
  67. function __luaglue.tgetter(self, key)                                  
  68.     -- Check getters table                                             
  69.     local gt = rawget(self, '__getters');                              
  70.     if (gt ~= nil) then                                                
  71.         local fn = rawget(gt, key);                                    
  72.         if (fn ~= nil) then                                            
  73.             return fn(self);                                           
  74.         end                                                            
  75.     end                                                                
  76.     -- Variable doesn't exist                                          
  77.     return nil;                                                        
  78. end
  79.  
  80. function __luaglue.isetter(self, key, value)                       
  81.     -- Get instance metatable                                      
  82.     local mt = getmetatable(self);                                 
  83.     -- Get class table from metatable                              
  84.     local ct = rawget(mt, '__class');                              
  85.     -- Search the class tree for a method                          
  86.     while (ct ~= nil) do                                           
  87.         local st = rawget(ct, '__setters');                        
  88.         if (st ~= nil) then                                        
  89.             local fn = rawget(st, key);                            
  90.             if (fn ~= nil) then                                    
  91.                 fn(self, value);                                   
  92.                 return;                                            
  93.             end                                                    
  94.         end                                                        
  95.         -- Check base class                                        
  96.         ct = rawget(ct, '__base');                                 
  97.     end                                                            
  98.     -- Property doesn't exist, just set the field in the metatable 
  99.     rawset(self, key, value);                                      
  100. end
  101.  
  102. function __luaglue.igetter(self, key)                              
  103.     -- Get instance metatable                                      
  104.     local mt = getmetatable(self);                                 
  105.     -- Get class table from metatable                              
  106.     local ct = rawget(mt, '__class');                              
  107.     -- Search the class tree for a method                          
  108.     while (ct ~= nil) do                                           
  109.         local fn = rawget(ct, key);                                
  110.         if (fn ~= nil) then                                        
  111.             return fn;                                             
  112.         end                                                        
  113.         -- No method found, check getters table                    
  114.         local gt = rawget(ct, '__getters');                        
  115.         if (gt ~= nil) then                                        
  116.             local fn = rawget(gt, key);                            
  117.             if (fn ~= nil) then                                    
  118.                 return fn(self);                                   
  119.             end                                                    
  120.         end                                                        
  121.         -- Check base class                                        
  122.         ct = rawget(ct, '__base');                                 
  123.     end                                                            
  124.     return nil;                                                    
  125. end
  126.  
  127. function __luaglue.readonly(self, key, value)                  
  128.     if (self[key] == nil) then                                 
  129.         rawset(self, key, value);                              
  130.     end                                                        
  131. end
  132.  
  133. function __luaglue.dumpex(name, obj, depth, max)               
  134.     local pad, i = '', 1;                                      
  135.     while (i < depth) do                                       
  136.         pad = pad .. '  ';                                     
  137.         i = i + 1;                                             
  138.     end                                                        
  139.     local t = type(obj);                                       
  140.     if (t == 'string') then                                    
  141.         print(pad, name, '=', "'" .. obj .. "'");          
  142.     elseif (t == 'number') then                                
  143.         print(pad, name, '=', tostring(obj));                  
  144.     elseif (t == 'function') then                              
  145.         print(pad, name, '=', tostring(obj));                  
  146.     elseif (t == 'table') then                                 
  147.         print(pad, name, '=', tostring(obj));                  
  148.         if (depth <= max) then                                 
  149.             print(pad, '{');                                   
  150.             for k, v in pairs(obj) do                          
  151.                 dumpex(k, v, depth + 1, max);                  
  152.             end                                                
  153.             local mt = getmetatable(obj);                      
  154.             if (mt ~= nil) then                                
  155.                 for k, v in pairs(mt) do                       
  156.                     print(pad, '  ', '+'..k, '=', tostring(v));
  157.                 end                                            
  158.             end                                                
  159.             print(pad, '}');                                   
  160.         end                                                    
  161.     elseif (t == 'userdata') then                              
  162.         print(pad, name, '=', tostring(obj));                  
  163.         local mt = getmetatable(obj);                          
  164.         if (mt ~= nil) then                                    
  165.             print(pad, '{');                                   
  166.             for k, v in pairs(mt) do                           
  167.                 print(pad, '  ', '+'..k, '=', tostring(v));    
  168.             end                                                
  169.             print(pad, '}');                                   
  170.         end                                                    
  171.     elseif (t == 'lightuserdata') then                         
  172.         print(pad, name, '=', tostring(obj));                  
  173.     elseif (t == 'nil') then                                   
  174.         print(pad, name, '=', tostring(obj));                  
  175.     end                                                        
  176. end
  177.  
  178. function __luaglue.dumpr(name, obj, depth)                     
  179.     dumpex(name, obj, 1, depth);                               
  180. end
  181.  
  182. function __luaglue.dump(name, obj)                             
  183.     dumpr(name, obj, 1);                                       
  184. end
Derp~
Need a great web host? Check out: AnHonestHost.com


Donations can be made via Paypal:
https://www.paypal.me/atom0s
User avatar
atom0s
Site Admin
Posts: 403
Joined: Sun Jan 04, 2015 11:23 pm
Location: 127.0.0.1
Contact:

Re: Grim Dawn Hook - Development Information

Post by atom0s » Sun Mar 22, 2015 7:59 pm

Some various strings found within the games executable, helping prove there is a developer console:

Code: Select all

Enables or disables exporting of large dump files
 - game.LargeDumpFiles
 
Exits the game
 - Exit

Closes the console
 - Close
 
Takes a screen shot
 - ScreenShot
 
Executes a script
 - Exec
 
Binds a command to key release
Binds a command to key press
Binds a command with true/false values to toggle with key press
Enables or disables god mode
Toggles being invincible.
Enables or disables mana loss
Enables or disables the UI
Teleports the player to the specified world space coordinates
Sets the game speed multiplier
Kills the player
Displays a variety of player stats on the screen
Creates an object at the player's location
Creates an object and gives it to the player
Enables or disables the object Dynamic Obstacles
Gives the player a skill point
Increments the number of points allocated to the specified skill
Gives the player an attribute point
Increments the player's level
Gives the player a devotion point
Allows player to equip anything regardless of requirements
Shows or hides the mouse cursor
Shows or hides skill not ready error messages
Makes it so enemies donÆt see the player and thus donÆt attack - but you can attack them
Shows a variety of data above player, NPCs, monsters
Gives the amount specified.  Negative numbers take gold away and 0 will zero out your gold.
Debug info for AI
Makes it so player always warps to destination
Forces all resources to be reloaded
Enables or disables displaying a variety of stats including frame rate
Enables or disables displaying a variety of sound statistics
Remove all stored trigger tokens in the player
Dumps the player's trigger tokens to the console
Gives the player the specified token
Revokes the specified token from the player
Return true if the server has the token
Return true if the anyone has the token
Shows data when things affect physics engine
Shows physics engine stats
Derp~
Need a great web host? Check out: AnHonestHost.com


Donations can be made via Paypal:
https://www.paypal.me/atom0s
User avatar
atom0s
Site Admin
Posts: 403
Joined: Sun Jan 04, 2015 11:23 pm
Location: 127.0.0.1
Contact:

Re: Grim Dawn Hook - Development Information

Post by atom0s » Sun Mar 22, 2015 10:01 pm

Developer Console Commands

Code: Select all

character.AnyoneHasToken    
character.ClearPlayerTokens 
character.GiveTakeGold      
character.GrantPlayerToken  
character.LogData           
character.RevokePlayerToken 
character.ServerHasToken    
character.SetPlayerInvisible
character.ShowAngerLevels   
character.ShowPlayerTokens  
character.WarpCursor      
game.Give                
game.God                 
game.IgnoreRequirements  
game.IncrementAttribute  
game.IncrementLevel      
game.IncrementSkill      
game.IncrementSkill      
game.Invincible          
game.KillMe              
game.LargeDumpFiles      
game.PlayStats           
game.ShowCursor          
game.ShowDynamicObstacles
game.ShowErrorMessages   
game.ShowHud             
game.Spawn               
game.Speed               
game.Teleport            
game.Uber                
game.incrementdevotion   
graphics.ReloadResources
graphics.Stats
Still unsure how to enable the console at this time. This is also not all of the commands, just some I've found so far in the binary.

The console command registration is at:
int __stdcall sub_57D4C0(int a1)
Derp~
Need a great web host? Check out: AnHonestHost.com


Donations can be made via Paypal:
https://www.paypal.me/atom0s
User avatar
atom0s
Site Admin
Posts: 403
Joined: Sun Jan 04, 2015 11:23 pm
Location: 127.0.0.1
Contact:

Re: Grim Dawn Hook - Development Information

Post by atom0s » Mon Mar 23, 2015 3:40 am

New Plugins
Tonight I have made new more plugins for GDHook:

Screenshot
Screenshot is a plugin that overrides the games screenshotting ability allowing users to take better quality screenshots. Users are able to take screenshots in the following formats:
- BMP
- JPG
- PNG

Grim Dawn comes stock with only taking .jpg screenshots which not everyone enjoys using. So this plugin is a great addition to allowing users to take pictures in their more desired format.

Effects
Effects is a plugin that incorporates the shader effects of SweetFX into GDHook. Users will be able to configure their desired SweetFX settings and apply it to Grim Dawn while using GDHook. (Please note this uses an older version of SweetFX that was once open source. Newer shaders and configuration options may not be available that the latest versions have available.)

Here is an example of the Effects plugin in action. (Screenshots were converted to jpg by imgur for some reason.. not sure why.)
Before: http://i.imgur.com/Mc0RgDy.jpg
After: http://i.imgur.com/7y2z2YD.jpg
Derp~
Need a great web host? Check out: AnHonestHost.com


Donations can be made via Paypal:
https://www.paypal.me/atom0s
User avatar
atom0s
Site Admin
Posts: 403
Joined: Sun Jan 04, 2015 11:23 pm
Location: 127.0.0.1
Contact:

Re: Grim Dawn Hook - Development Information

Post by atom0s » Mon Mar 23, 2015 11:03 pm

New Plugins

Addons
Addons is a plugin that extends the hook even more by allowing users to create quick and simple to use Lua addons. (These addons are separate from the games Lua engine!)
Derp~
Need a great web host? Check out: AnHonestHost.com


Donations can be made via Paypal:
https://www.paypal.me/atom0s
User avatar
atom0s
Site Admin
Posts: 403
Joined: Sun Jan 04, 2015 11:23 pm
Location: 127.0.0.1
Contact:

Re: Grim Dawn Hook - Development Information

Post by atom0s » Tue Mar 24, 2015 9:54 am

A video showing off the addons plugin:
Derp~
Need a great web host? Check out: AnHonestHost.com


Donations can be made via Paypal:
https://www.paypal.me/atom0s
GlockenGerda
Posts: 6
Joined: Sat Dec 26, 2015 10:52 pm

Re: Grim Dawn Hook - Development Information

Post by GlockenGerda » Mon Jan 11, 2016 9:52 am

atom0s wrote:Some various strings found within the games executable, helping prove there is a developer console:

Code: Select all

Enables or disables exporting of large dump files
 - game.LargeDumpFiles
 etc...
Hi atom0s, I managed to enable the developer console in the game.
If you're interested how I unlocked this, then send me a PM.

Thank you for your incredibly good work that you've done for Grim Dawn!
User avatar
atom0s
Site Admin
Posts: 403
Joined: Sun Jan 04, 2015 11:23 pm
Location: 127.0.0.1
Contact:

Re: Grim Dawn Hook - Development Information

Post by atom0s » Mon Jan 11, 2016 11:13 am

GlockenGerda wrote:
atom0s wrote:Some various strings found within the games executable, helping prove there is a developer console:

Code: Select all

Enables or disables exporting of large dump files
 - game.LargeDumpFiles
 etc...
Hi atom0s, I managed to enable the developer console in the game.
If you're interested how I unlocked this, then send me a PM.

Thank you for your incredibly good work that you've done for Grim Dawn!
Feel free to let me know. I can perhaps turn it into a plugin for GDHook to be able to open it.
Derp~
Need a great web host? Check out: AnHonestHost.com


Donations can be made via Paypal:
https://www.paypal.me/atom0s
User avatar
immorrr
Posts: 110
Joined: Fri Mar 27, 2015 2:21 pm
Location: Germany

Re: Grim Dawn Hook - Development Information

Post by immorrr » Mon Jan 11, 2016 3:05 pm

I'd be interest in the dev menu too ;)

btw. these are all the dev options i have found (should be complete) (including the original description for each option)..

Code: Select all

game.LargeDumpFiles	(Enables or disables exporting of large dump files)
Exit	(Exits the game)
Close	(Closes the console)
ScreenShot	(Takes a screen shot)
Exec	(Executes a script)
BindUp	(Binds a command to key release)
BindDown	(Binds a command to key press)
BindToggle	(Binds a command with true/false values to toggle with key press)
game.God	(Enables or disables god mode)
game.Invincible	(Toggles being invincible.)
game.Uber	(Enables or disables mana loss)
game.ShowHud	(Enables or disables the UI)
game.Teleport	(Teleports the player to the specified world space coordinates)
game.Speed	(Sets the game speed multiplier)
game.KillMe	(Kills the player)
game.PlayStats	(Displays a variety of player stats on the screen)
game.Spawn	(Creates an object at the player's location)
game.Give	(Creates an object and gives it to the player)
game.Gives	(Creates multiple objects and give them to the player)
game.ShowDynamicObstacles	(Enables or disables the object Dynamic Obstacles)
game.IncrementSkillpoints	(Gives the player a skill point)
game.IncrementSkill	(Increments the number of points allocated to the specified skill)
game.IncrementAttribute	(Gives the player an attribute point)
game.IncrementLevel	(Increments the player's level)
game.incrementdevotion	(Gives the player a devotion point)
game.decrementdevotion	(Removes a devotion point)
game.IgnoreRequirements	(Allows player to equip anything regardless of requirements)
game.ShowCursor	(Shows or hides the mouse cursor)
game.ShowErrorMessages	(Shows or hides skill not ready error messages)
character.SetPlayerInvisible	(Makes it so enemies don’t see the player and thus don’t attack - but you can attack them)
character.LogData	(Displays some realtime data for each entity)
character.GiveTakeGold	(Gives the amount specified.  Negative numbers take gold away and 0 will zero out your gold.)
character.ShowAngerLevels	(Debug info for AI)
character.WarpCursor	(Makes it so player always warps to destination)
Show system statistics	(Enables or disables displaying a variety of stats including frame rate)
Show sound statistics	(Enables or disables displaying a variety of sound statistics)
character.ClearPlayerTokens	(Remove all stored trigger tokens in the player)
character.ShowPlayerTokens	(Dumps the player's trigger tokens to the console)
character.GrantPlayerToken	(Gives the player the specified token)
character.RevokePlayerToken	(Revokes the specified token from the player)
character.ServerHasToken	(Return true if the server has the token)
character.AnyoneHasToken	(Return true if the anyone has the token)
debug.physics	(Shows data when things affect physics engine)
Last edited by immorrr on Tue Jan 26, 2016 11:46 pm, edited 1 time in total.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest