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 


AobScan Template header needs modernization
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
gir489
Grandmaster Cheater
Reputation: 14

Joined: 03 Jan 2012
Posts: 840
Location: Maryland, United States

PostPosted: Sun Apr 09, 2023 9:21 am    Post subject: AobScan Template header needs modernization Reply with quote

When creating an AoBScan code injection script, the header for it will auto populate with some wanting information. Mostly version and author.

Author is taken directly from the Window's user and there is no room for configuration to instead manually supply a replacement, I have to replace my real name with my internet handle each time, it's very annoying and tedious.

Version is always blank, when you could use something reliable like the compile Timestamp variable located in the PE header. I sometimes use the EXE signing date, but only a few companies sign their EXEs, so it's not reliable, whereas the compile sign timestamp is required by Windows PE header.
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Sun Apr 09, 2023 4:09 pm    Post subject: Reply with quote

Have you looked at using custom templates?
Back to top
View user's profile Send private message
gir489
Grandmaster Cheater
Reputation: 14

Joined: 03 Jan 2012
Posts: 840
Location: Maryland, United States

PostPosted: Tue Apr 11, 2023 11:30 am    Post subject: Reply with quote

++METHOS wrote:
Have you looked at using custom templates?

How do I do that?
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Tue Apr 11, 2023 4:34 pm    Post subject: Reply with quote

Here is one that I have used for years:

https://forum.cheatengine.org/viewtopic.php?t=588038

It saves me a lot of time. Highly recommended.

Just drop the Lua file into your autorun folder. You can edit it to create your own templates.



2023-04-11_17-33-21.png
 Description:
 Filesize:  22.64 KB
 Viewed:  4203 Time(s)

2023-04-11_17-33-21.png


Back to top
View user's profile Send private message
gir489
Grandmaster Cheater
Reputation: 14

Joined: 03 Jan 2012
Posts: 840
Location: Maryland, United States

PostPosted: Wed Apr 12, 2023 6:47 pm    Post subject: Reply with quote

++METHOS wrote:
Here is one that I have used for years:

https://forum.cheatengine.org/viewtopic.php?t=588038

It saves me a lot of time. Highly recommended.

Just drop the Lua file into your autorun folder. You can edit it to create your own templates.

Thanks a lot, man. This is exactly the control I wanted over the template.

Included is the Lua file I'm using with the 2 features requested.

https://pastebin.com/TNw8iSUP



Example.png
 Description:
 Filesize:  103.35 KB
 Viewed:  4137 Time(s)

Example.png


Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Wed Apr 12, 2023 7:04 pm    Post subject: Reply with quote

Yes. Easily my favorite CE extension. I wish mgr.inz.Player was still coming around these days, but life keeps us busy sometimes.
Back to top
View user's profile Send private message
gir489
Grandmaster Cheater
Reputation: 14

Joined: 03 Jan 2012
Posts: 840
Location: Maryland, United States

PostPosted: Thu Apr 13, 2023 8:41 pm    Post subject: Reply with quote

++METHOS wrote:
Yes. Easily my favorite CE extension. I wish mgr.inz.Player was still coming around these days, but life keeps us busy sometimes.

The first game I tried to use it on, it fell flat on its face.

I get an error about

Code:
Error:Failure determining what Cyberpunk2077.AK means


The address I have highlighted is:

Code:
Cyberpunk2077.AK::SoundEngine::StartProfilerCapture+7ED0 - 41 8B 00              - mov eax,[r8]


I tried giving it all manners of different addresses, but it kept erroring out. The stock AoB Scan Template works fine against the address.
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Thu Apr 13, 2023 8:58 pm    Post subject: Reply with quote

The extension is a little dated. Maybe someone can update it.

As a workaround, try turning off symbols inside of memory viewer before generating your script.
Back to top
View user's profile Send private message
LeFiXER
Grandmaster Cheater Supreme
Reputation: 20

Joined: 02 Sep 2011
Posts: 1066
Location: 0x90

PostPosted: Fri Apr 14, 2023 6:54 am    Post subject: This post has 1 review(s) Reply with quote

gir489 wrote:
++METHOS wrote:
Yes. Easily my favorite CE extension. I wish mgr.inz.Player was still coming around these days, but life keeps us busy sometimes.

The first game I tried to use it on, it fell flat on its face.

I get an error about

Code:
Error:Failure determining what Cyberpunk2077.AK means


The address I have highlighted is:

Code:
Cyberpunk2077.AK::SoundEngine::StartProfilerCapture+7ED0 - 41 8B 00              - mov eax,[r8]


I tried giving it all manners of different addresses, but it kept erroring out. The stock AoB Scan Template works fine against the address.


This is to do with the pattern used to match the address since the injection address is pulled from the information within the large comment block at the bottom of the scripts. The current code stops at the first colon and because there are two consecutive colons twice in the example provided, it can't capture the text after that.

On line 347 of your Pastebin code change this:
Code:

  local injectAddress = newScript:match('INJECTING HERE %-%-%-%-%-%-%-%-%-%-\r\n(.-):')
  local injectAddressNum = getAddress(injectAddress)

To:
Code:

  local injectAddress = newScript:match('INJECTING HERE %-%-%-%-%-%-%-%-%-%-\r\n(.-):') or newScript:match('%-%-%-%-%-%-%-%-%-%-\n(.-)%s')
  local injectAddressNum = getAddress(injectAddress)


The new pattern captures any text after the hyphens and newline char, but before the space. This is the example:
Code:

// ---------- INJECTING HERE ----------
Cyberpunk2077.AK::SoundEngine::StartProfilerCapture+7ED0 - 41 8B 00              - mov eax,[r8]
// ---------- DONE INJECTING  ----------

//The new pattern captures this text:
Cyberpunk2077.AK::SoundEngine::StartProfilerCapture+7ED0


Hopefully that will resolve your problem.
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Fri Apr 14, 2023 11:11 am    Post subject: Reply with quote

It would be great if we can get this issue resolved. When checking against a different target, the problem persists when symbols are turned on.

The symbol addressing can vary greatly. Any way to fix?

Thanks.



2023-04-14_12-07-06.png
 Description:
 Filesize:  2.67 KB
 Viewed:  3946 Time(s)

2023-04-14_12-07-06.png



2023-04-14_12-04-54.png
 Description:
 Filesize:  1.26 KB
 Viewed:  3946 Time(s)

2023-04-14_12-04-54.png


Back to top
View user's profile Send private message
gir489
Grandmaster Cheater
Reputation: 14

Joined: 03 Jan 2012
Posts: 840
Location: Maryland, United States

PostPosted: Fri Apr 14, 2023 6:56 pm    Post subject: Reply with quote

LeFiXER wrote:
This is to do with the pattern used to match the address since the injection address is pulled from the information within the large comment block at the bottom of the scripts. The current code stops at the first colon and because there are two consecutive colons twice in the example provided, it can't capture the text after that.

On line 347 of your Pastebin code change this:
Code:

  local injectAddress = newScript:match('INJECTING HERE %-%-%-%-%-%-%-%-%-%-\r\n(.-):')
  local injectAddressNum = getAddress(injectAddress)

To:
Code:

  local injectAddress = newScript:match('INJECTING HERE %-%-%-%-%-%-%-%-%-%-\r\n(.-):') or newScript:match('%-%-%-%-%-%-%-%-%-%-\n(.-)%s')
  local injectAddressNum = getAddress(injectAddress)


The new pattern captures any text after the hyphens and newline char, but before the space. This is the example:
Code:

// ---------- INJECTING HERE ----------
Cyberpunk2077.AK::SoundEngine::StartProfilerCapture+7ED0 - 41 8B 00              - mov eax,[r8]
// ---------- DONE INJECTING  ----------

//The new pattern captures this text:
Cyberpunk2077.AK::SoundEngine::StartProfilerCapture+7ED0


Hopefully that will resolve your problem.

The script just silently does nothing, it's still not resolved.

I figured out how to fix it.

Code:
  local injectAddress = newScript:match('INJECTING HERE %-%-%-%-%-%-%-%-%-%-\r\n(.-):%s')


It will return anything between the new line and the colon and stop at the first space.
Back to top
View user's profile Send private message
LeFiXER
Grandmaster Cheater Supreme
Reputation: 20

Joined: 02 Sep 2011
Posts: 1066
Location: 0x90

PostPosted: Sat Apr 15, 2023 5:34 am    Post subject: Reply with quote

++METHOS wrote:
It would be great if we can get this issue resolved. When checking against a different target, the problem persists when symbols are turned on.

The symbol addressing can vary greatly. Any way to fix?

Thanks.


Do you have some examples?

gir489 wrote:

The script just silently does nothing, it's still not resolved.

I figured out how to fix it.

Code:
  local injectAddress = newScript:match('INJECTING HERE %-%-%-%-%-%-%-%-%-%-\r\n(.-):%s')


It will return anything between the new line and the colon and stop at the first space.


That's interesting. When I inserted '\r' into the pattern it yielded no results. But it pretty much is the same functionality, capture the text between '\n' and the first space after the hyphens. At least that's resolved.
Back to top
View user's profile Send private message
gir489
Grandmaster Cheater
Reputation: 14

Joined: 03 Jan 2012
Posts: 840
Location: Maryland, United States

PostPosted: Sat Apr 15, 2023 3:32 pm    Post subject: Reply with quote

LeFiXER wrote:

That's interesting. When I inserted '\r' into the pattern it yielded no results. But it pretty much is the same functionality, capture the text between '\n' and the first space after the hyphens. At least that's resolved.

What's funny is after I fixed it, I realized I stripped the script that requires injectAddress. I didn't even need to fix it. Rolling Eyes
Back to top
View user's profile Send private message
LeFiXER
Grandmaster Cheater Supreme
Reputation: 20

Joined: 02 Sep 2011
Posts: 1066
Location: 0x90

PostPosted: Sat Apr 15, 2023 3:51 pm    Post subject: Reply with quote

gir489 wrote:

What's funny is after I fixed it, I realized I stripped the script that requires injectAddress. I didn't even need to fix it. Rolling Eyes


Laughing Nevermind eh. What's important is you have the functionality you need.
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Sat Apr 15, 2023 4:01 pm    Post subject: Reply with quote

LeFiXER wrote:
Do you have some examples?

-I have posted one example in my previous post. However, it seems that it can be anything, really. Here are some random examples, from the same module:

Code:
7FF651E582D0 - sdhdship.`anonymous namespace'::strconv_attribute_t<0,1,1,1>()
7FF651E5D590 - sdhdship.UFG::qList<Illusion::StateBlock,Illusion::StateBlock,1,0>::~qList<Illusion::StateBlock,Illusion::StateBlock,1,0>()
7FF651E6AD30 - sdhdship.hkSmallArray<hkpEntityListener * __ptr64>::~hkSmallArray<hkpEntityListener * __ptr64>()
7FF653160293 - sdhdship.`UFG::`dynamic initializer for 'aHardcodedLeaderboardData'''::`1'::dtor$631()
7FF6532FC070 - sdhdship.`dynamic initializer for 'gDirectGameSliceId''()
7FF65341CA68 - sdhdship.Symbol_EnableDLC01CollectibleIndicators$initializer$
7FF653422298 - sdhdship.UFG::TargetingSystemPedBaseComponent::_TypeIDesc$initializer$


As previously mentioned, turning off symbols in memory viewer eliminates this issue. However, this solution is not ideal. By default, CE can generate an AA script, regardless. But when trying to generate a script using the custom template extension, errors occur and nothing is generated unless symbols are turned off.

Thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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