Help with Code Injection Unity

Memory scanning, code injection, debugger internals and other gamemodding related discussion
Post Reply
watersippin
Noobzor
Noobzor
Posts: 5
Joined: Mon Sep 27, 2021 1:20 am
Reputation: 2

Help with Code Injection Unity

Post by watersippin »

I'm having trouble using CE with unity games, AOB works sometimes but it's inconsistent because JIT, so I'm trying to use Mono features for code injections [Link] but whenever I try to do a code injection, it gives me an error saying [Link] "Failure to determine what ***** means" and if I write the address defining bytes to nop, it says [Link] "this address specifier is not valid" I've never really used CE for unity games so anything helps! :wub:
Last edited by watersippin on Mon Sep 27, 2021 2:19 am, edited 1 time in total.

User avatar
EpicBirdi
Fearless Donors
Fearless Donors
Posts: 64
Joined: Sat Jul 21, 2018 2:22 pm
Reputation: 58

Re: Help with Code Injection Unity

Post by EpicBirdi »

You can use Lua to forcibly compile functions that are JIT compiled. Normally you'd need to run the function once (get damaged for health function, etc.) but you can compile them with such a script.
If you look around a bit you'll find some examples.

User avatar
MBRKiNG
Table Makers
Table Makers
Posts: 315
Joined: Fri Feb 23, 2018 5:13 pm
Reputation: 525

Re: Help with Code Injection Unity

Post by MBRKiNG »

watersippin wrote:
Mon Sep 27, 2021 1:35 am
I'm having trouble using CE with unity games, AOB works sometimes but it's inconsistent because JIT, so I'm trying to use Mono features for code injections [Link] but whenever I try to do a code injection, it gives me an error saying [Link] "Failure to determine what ***** means" and if I write the address defining bytes to nop, it says [Link] "this address specifier is not valid" I've never really used CE for unity games so anything helps! :wub:
try

Code: Select all

define(walkeffector,EFT:Animations.ProceduralWeaponAnimation:set_WalkEffectorEnabled+13)

[ENABLE]
{$lua}
LaunchMonoDataCollector()
{$asm}
walkeffector:
db 90 90 90 90

[DISABLE]
walkeffector:
db 0F B6 45 F0
or

Code: Select all

{$lua}
if syntaxcheck then return end
LaunchMonoDataCollector()
[ENABLE]
scan = "EFT:Animations.ProceduralWeaponAnimation:set_WalkEffectorEnabled+13"
writeBytes(scan, 0x90, 0x90, 0x90, 0x90)
[DISABLE]
writeBytes(scan, 0x0F, 0xB6, 0x45, 0xF0)

watersippin
Noobzor
Noobzor
Posts: 5
Joined: Mon Sep 27, 2021 1:20 am
Reputation: 2

Re: Help with Code Injection Unity

Post by watersippin »

Yeah every single thing I have tried still ends with "Failure to determine what **** means" I've tried learning/copying others unity/mono scripts and still leads me to the same thing, :shock: :shock:

with

Code: Select all

 define(walkeffector,EFT:Animations.ProceduralWeaponAnimation:set_WalkEffectorEnabled+13)

[ENABLE]
{$lua}
LaunchMonoDataCollector()
{$asm}
walkeffector:
db 90 90 90 90

[DISABLE]
walkeffector:
db 0F B6 45 F0 
I get [Link]


and with

Code: Select all

 {$lua}
if syntaxcheck then return end
LaunchMonoDataCollector()
[ENABLE]
scan = "EFT:Animations.ProceduralWeaponAnimation:set_WalkEffectorEnabled+13"
writeBytes(scan, 0x90, 0x90, 0x90, 0x90)
[DISABLE]
writeBytes(scan, 0x0F, 0xB6, 0x45, 0xF0) 
I get this with CE 7.3: [Link]

and with a custom CE 7.2: [Link]

this rattles me brain a bit lmao

watersippin
Noobzor
Noobzor
Posts: 5
Joined: Mon Sep 27, 2021 1:20 am
Reputation: 2

Re: Help with Code Injection Unity

Post by watersippin »

Thank you for everyone helping!!

GreenHouse
Expert Cheater
Expert Cheater
Posts: 857
Joined: Fri Oct 12, 2018 10:25 pm
Reputation: 889

Re: Help with Code Injection Unity

Post by GreenHouse »

MBRKiNG wrote:
Mon Sep 27, 2021 9:08 am
...
Why the define and lua variable? You can access the address directly without the define:

Code: Select all

[ENABLE]
EFT:Animations.ProceduralWeaponAnimation:set_WalkEffectorEnabled+13:
db 90 90 90 90

[DISABLE]
EFT:Animations.ProceduralWeaponAnimation:set_WalkEffectorEnabled+13:
db 0F B6 45 F0

Code: Select all

[ENABLE]
writeBytes("EFT:Animations.ProceduralWeaponAnimation:set_WalkEffectorEnabled+13", 0x90, 0x90, 0x90, 0x90)

[DISABLE]
writeBytes("EFT:Animations.ProceduralWeaponAnimation:set_WalkEffectorEnabled+13", 0x0F, 0xB6, 0x45, 0xF0) 
Also if this is Escape From Tarkov and it's online, then you shouldn't be asking that here.

watersippin
Noobzor
Noobzor
Posts: 5
Joined: Mon Sep 27, 2021 1:20 am
Reputation: 2

Re: Help with Code Injection Unity

Post by watersippin »

It's offline, 12.9, no online support, just wanted to learn cheat engine reversing on a game I enjoy.

User avatar
LeFiXER
LeFixer
LeFixer
Posts: 478
Joined: Wed Mar 24, 2021 9:35 am
Reputation: 242

Re: Help with Code Injection Unity

Post by LeFiXER »

Make sure mono is activated before trying to access the address. Also, you don't need to use the whole path, just the module that contains the function.

watersippin
Noobzor
Noobzor
Posts: 5
Joined: Mon Sep 27, 2021 1:20 am
Reputation: 2

Re: Help with Code Injection Unity

Post by watersippin »

changing the address to just the module fixed it --> ProceduralWeaponAnimation:set_WalkEffectorEnabled thank you everyone for helping me learn more about cheat engine! All of the replies have helped me

Post Reply

Who is online

Users browsing this forum: No registered users