Hello!

It looks like you're new here. If you want to get involved, click one of these buttons!

[Guide] Hitman 2016

13

Comments

  • I now have a fully working camera (fov/timestop keys aren't implemented yet, but that's a minor thing) system for Hitman, which is injectable. The code is mostly generic and can be re-used for cameras of any DX11/x64 game, only a small part of the code has to be adjusted, so creating a camera from a regular CT is relatively easy.

    Code is here: https://github.com/FransBouma/InjectableGenericCameraSystem

    In the coming days I'll add the missing features and add AOB scanning using an AOB scan lib so it's abit more future proof, and release the first version. Stay tuned!
  • This is very cool indeed! Is this in a usable format that I could try out or does it need to be compiled? Had a look on github but all I could find were the project files. I'll also have a look this weekend (if I can scrap out some time!) to see if the pause menu timestop can be isolated.
  • edited December 2016
    One3rd said:

    This is very cool indeed! Is this in a usable format that I could try out or does it need to be compiled? Had a look on github but all I could find were the project files. I'll also have a look this weekend (if I can scrap out some time!) to see if the pause menu timestop can be isolated.

    It's sourcecode only, but I'll compile a working alpha release this weekend :) FoV works now too, and I'll now add AOB scanning and add timestop (as that's already aob scanned in the CT). Controller support isn't in yet, but that's fairly easy.

    Regular timestop would be awesome!
  • @one3rd. The time stop the menu uses is the same as gamespeed.

    This is the timestop used in the CT:

    hitman.exe+41C8961 - F3 0F59 43 48 - mulss xmm0,[rbx+48] <<<<<<<<<<<< address in rbx is intercepted by CT, rbx+48 is written with 0.0001 (stop) or 1 (normal)
    hitman.exe+41C8966 - F3 0F59 05 D27B14FD - mulss xmm0,[hitman.exe+1310540]
    hitman.exe+41C896E - F3 48 0F2C C0 - cvttss2si rax,xmm0
    hitman.exe+41C8973 - 48 0FAF C1 - imul rax,rcx
    hitman.exe+41C8977 - 48 C1 F8 14 - sar rax,14
    hitman.exe+41C897B - 48 89 43 28 - mov [rbx+28],rax


    Now, if you look closely, it uses the value of rbx+48 as the input for some calculation. If it's a very low value the value is close to 0. cvttss2si converts a float to int, so will result in 0 in rax, which is stored in rbx+28. _that_ address contains a value that changes a lot but is > 16000. When you press ESC, it's set to 0. When the menu is closed, it's again set to some value > 16000. If I set it to 65535, the game runs very fast :)

    So the real timestop is rbx+28, which can be controlled by the calculation before it: simply make rax result in 0 if timestop is required. This is what I'm going to do in the camera as well. (as intercepting the timestop code otherwise is a pain due to a conditional jump near it and I need 14 bytes to store the jmp qword ptr [address] which overwrites too much).
  • edited December 2016
    I see that yes. That doesn't look to be the pause menu timestop however. There are still animations, such as water movement, occurring and those camera addresses I found do not work as they are being overridden by an opcode. This would definitely pause all player animations though and may be a good option depending on outcome of below.
    ...

    I also found the pause menu timestop (engine stop?) at a fixed address (hitman.exe+2662448). This address is settable without disabling any opcodes and provides the same timestop scenario as when in pause menu. Normally set to 0 during normal play, set to 1 to pause.

    The camera structure then works for rotation but when using it with keybinds (setting individual addresses) the shadows and lighting get broken as the camera rotates. Not sure if your camera code will fix this or if it is a problem with the engine timestop.
  • edited December 2016
    One3rd said:

    I see that yes. That doesn't look to be the pause menu timestop however. There are still animations, such as water movement, occurring and those camera addresses I found do not work as they are being overridden by an opcode. This would definitely pause all player animations though and may be a good option depending on outcome of below.
    ...

    I also found the pause menu timestop (engine stop?) at a fixed address (hitman.exe+2662448). This address is settable without disabling any opcodes and provides the same timestop scenario as when in pause menu. Normally set to 0 during normal play, set to 1 to pause.

    The camera structure then works for rotation but when using it with keybinds (setting individual addresses) the shadows and lighting get broken as the camera rotates. Not sure if your camera code will fix this or if it is a problem with the engine timestop.

    Nice! Will test that! The code I pointed to is weird, as re routing it with jmps to my own code makes the game hang, as if other code jumps into the middle of the opcodes (and now thus fails as there's now a jmp opcode with different bytes).

    (edit) the original camera addresses definitely won't work when that byte is set, everything's frozen and stays so, camera movement won't work. I'll try your other addresses to see if these work.
  • edited December 2016
    Your other addresses work nicely! And shadows, reflections, they all work too :) Perfect timestop, I can move around the camera like normal. I think the shadows etc. still work as I simply write to both camera structs all the time, one being the camera move apparently when stopped the other (the normal one) still used for reflections/shadows.

    Now to find the source of that address so I can reliably find it with AOB :) Thanks for this. 'One3rd' added to camera credits :)

    (edit) I was a 'little' (read: a lot) naive regarding doing AOB scanning in memory myself. There are a lot of memory scanners around in source, I picked one which was reasonably fast but ran into access violation problems while reading the process memory (so ... wtf?) and ran into this thread on CE forum, where darkbyte (author of CE) explains it's ... very difficult http://forum.cheatengine.org/viewtopic.php?p=5628403&sid=195904c5bbd4ff30709d387243a264d2. Likely also the reason why Hatti doesn't AOB scan his cameras.

    For now I'll not AOB scan the camera offsets. With asm search in CE it's a piece of cake to find the code back anyway. It is what it is.... :/

    1 other problem: FOV doesn't work in the camera for this timestop. At least I can't find it... (there's just 1 address with the value, (scanned with a fraction of 3 digits)). Thinking of adding two timestops, one based on Jim's code and keep the one you gave, so there are two, one has no fov control (simply inherits the one set) and one has fov control but suffers from corkscrew-itis ;)
  • The menu camera isn't needed :) If you store 0.000001 in the gamespeed, everything does stop, including snow, rain etc, fov works and I can't manipulate the character anymore. (controller move does nothing). Camera works OK though, fov everything. I'll wrap it up, remove the menu camera as it's not needed (commit the code first so I can roll back but I don't think that's needed). The camera currently has no controller movement, I'll add that after getting some feedback. :)
  • edited December 2016
    (updated)

    Here it is. https://github.com/FransBouma/InjectableGenericCameraSystem/releases/tag/Hitman2016_v101
    v1.0.1, now with controller support too. Let me know if this works or not, or what to change.

    I hope the controls are intuitive enough, if not, there's help using ALT-H in-game :) In the future I want to make these things configurable as well as the rotation/movement speed, but I think they're OK for now. Enjoy!

    For permalink, it's best to link to: https://github.com/FransBouma/InjectableGenericCameraSystem/tree/master/Cameras/Hitman2016 which has the latest binary release url.
  • Oh sweet! Doesn't matter about the pause menu camera if you've got this working as is. I just wasn't sure that timestop would stop everything so tried for another option. I'll take the camera for a spin tomorrow and see how it goes.
  • edited December 2016
    One3rd said:

    Oh sweet! Doesn't matter about the pause menu camera if you've got this working as is. I just wasn't sure that timestop would stop everything so tried for another option. I'll take the camera for a spin tomorrow and see how it goes.

    Cool! I've updated the post, it's now v1.0 with controller support :) I think it's pretty much done, except for tweaks here and there ;)

    (EDIT) One bug already found: ctrl or RB isn't a good key/control for slower, as it triggers the game's slowmo, resetting the timestop! Will fix this in 1.01 fixed
  • Took it for a quick spin and it works very well! One thing though, is there an option for inverting the mouse? I play with inverted mouse enabled and it takes a bit to orient myself after enabling the camera. Not a big problem as the camera is excellent as-is but I thought I'd ask.
  • One3rd said:

    Took it for a quick spin and it works very well! One thing though, is there an option for inverting the mouse? I play with inverted mouse enabled and it takes a bit to orient myself after enabling the camera. Not a big problem as the camera is excellent as-is but I thought I'd ask.

    Thanks! Glad it works on other people's PC as well! :D
    It's just 1 line of code to alter that, tho it should be configurable I think as others who don't play with inverted mouse / gamepad should be able to play with normal orientation. I was planning to add some configuration anyway, will try to see if I can add something in the coming days (in the form of an ini file, or keys). E.g. speed up/slow down default rotation/movement should also be possible.

    Rotation with the cursor keys use the same orientation, you feel if you play with inverted look (mouse/gamepad) these should be inverted as well?
  • One3rd said:

    Took it for a quick spin and it works very well! One thing though, is there an option for inverting the mouse? I play with inverted mouse enabled and it takes a bit to orient myself after enabling the camera. Not a big problem as the camera is excellent as-is but I thought I'd ask.

    Thanks! Glad it works on other people's PC as well! :D
    It's just 1 line of code to alter that, tho it should be configurable I think as others who don't play with inverted mouse / gamepad should be able to play with normal orientation. I was planning to add some configuration anyway, will try to see if I can add something in the coming days (in the form of an ini file, or keys). E.g. speed up/slow down default rotation/movement should also be possible.

    Rotation with the cursor keys use the same orientation, you feel if you play with inverted look (mouse/gamepad) these should be inverted as well?
  • OtisInf said:


    Rotation with the cursor keys use the same orientation, you feel if you play with inverted look (mouse/gamepad) these should be inverted as well?

    Yes. I originally learned on flight simulators that had inverted controllers (down for nose up, up for nose down) and that translated over to first person shooters when I started playing those. If it was going to be an "invert Y" option then, for me at least, it makes sense to have it also invert the arrow keys used for camera orientation.
Sign In or Register to comment.