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 


Application Base Address Math Problem

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Quibbs
How do I cheat?
Reputation: 0

Joined: 08 Jul 2018
Posts: 4

PostPosted: Sun Jul 08, 2018 1:39 pm    Post subject: Application Base Address Math Problem Reply with quote

I've been banging my head against this problem for a bit now, so I've finally decided to sign up for an account here to see if you guys can help me out Smile


I'm trying to calculate my base pointer I've gotten for a game called "Brawlhalla". I've gotten this base pointer via CE already; "Adobe AIR.dll"+01315500 + 8 more levels of offsets. I've confirmed this is indeed a base pointer, it works across multiple gamemodes and across application restarts. However, this is about the only thing that's working as you'd expect.

I want to use this pointer in an external Python application; so I of course need to get the base address for "Adobe AIR.dll". After writing most of it manually I switched over instead to the much simpler hackManager Python library which can get the base address and module base addresses for applications. The problem? There is no "Adobe AIR.dll" module under "Brawlhalla.exe". This stopped me in my tracks for a while, until I made a discovery; in CE, a pointer that is just entered as "Adobe AIR.dll" and a pointer that is just entered as "Brawlhalla.exe" actually points towards the same address - at the moment, 0x00905A4D. So I assume this means the base address for Brawlhalla.exe is the same as Adobe AIR.dll. Problem solved, right? Well... not quite.

In my Python program I'm able to get the base address of Brawlhalla.exe, check memory, and get the same address CE has for it (0x00905A4D). However, no matter how many variations I've tried, I have not been able to properly get the first offset in the pointer ("Adobe AIR.dll"+01315500) to match what CE shows as the first offset address; I get the base address for the application, add the offset to it, then read for another address from memory (effectively read_dword(base+offset1). Instead of getting the next step shown in CE (in this case, 0x0451B088), though, I simply get a 0. Even stranger, despite "Adobe AIR.dll" and "Brawlhalla.exe" pointing to the same address in CE, "Adobe AIR.dll"+01315500 and "Brawlhalla.exe"+01315500 DON'T point to the same CE address; the Brawlhalla.exe one shows all 0's/???'s. So I don't know if I'm simply trashing the math for the first offset (I've confirmed my code for all offsets after the first work if I simply hard-code the first step shown in CE) or if the Brawlhalla.exe base address isn't actually the same as Adobe AIR.dll's despite CE seeming to think they are? Is the solution to this to somehow find a base address for Adobe AIR.dll (and if so, how? It's not listed as a module!) I dunno. Help is much appreciated <3
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4289

PostPosted: Sun Jul 08, 2018 2:34 pm    Post subject: Reply with quote

Quibbs wrote:
There is no "Adobe AIR.dll" module under "Brawlhalla.exe". This stopped me in my tracks for a while, until I made a discovery; in CE, a pointer that is just entered as "Adobe AIR.dll" and a pointer that is just entered as "Brawlhalla.exe" actually points towards the same address - at the moment, 0x00905A4D. So I assume this means the base address for Brawlhalla.exe is the same as Adobe AIR.dll.

I don't know what you mean by this. "Adobe AIR.dll" and "Brawlhalla.exe" are entirely different image files; they can't be loaded at the same address, and I don't know why you would think one is contained within the other.

The value you're looking at is the start of the DOS header (0x4d 0x5a). You're looking at the value stored at the addresses and not the addresses themselves.

It would be easier to help you if you show what you're doing (e.g. python source code).

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Quibbs
How do I cheat?
Reputation: 0

Joined: 08 Jul 2018
Posts: 4

PostPosted: Sun Jul 08, 2018 3:17 pm    Post subject: Reply with quote

I assumed Adobe AIR was a module/part of Brawlhalla.exe due to the fact that the game's written in AIR, that there's no Adobe AIR process, and that the pointer was found from scanning the Brawlhalla process. If I try to directly target an "Adobe AIR.dll" for getting a base address, I simply get an error saying that no such process exists. And since it's not any of the DLLs listed as modules of Brawlhalla, I'm at a loss at how else I'm supposed to get it's base address.

This is the code I'm using:
Code:
offset = 0x01315500

h = Hack('Brawlhalla.exe')
base = int(h.base_address)
print("Base: " + hex(base))

offsetAddress = base + offset
print("Offset Address: " + hex(offsetAddress))

data = h.read_dword(offsetAddress)
print(str(data[0]) + ", " + str(data[1]))

----OUTPUT-----

Base: 0x290000
Offset Address: 0x15a5500
0, 0x15a5500


My understanding is that the value at (base + offset) should be another address, but it's value is 0 and (base + offset) itself doesn't resemble any of the CE addresses shown in the pointer screen ("Adobe AIR.dll"+01315500 = 0451B088)
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4289

PostPosted: Sun Jul 08, 2018 3:49 pm    Post subject: Reply with quote

"Adobe AIR.dll" isn't a process - it's a dll file that was loaded by a process.

Code:
base = int(h.base_address)
This is getting the address of "Brawhlhalla.exe", not the address of "Adobe AIR.dll".

Use module_base_dict to get the address the dll was loaded at. Look online for documentation and examples (i.e. GitHub).

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Quibbs
How do I cheat?
Reputation: 0

Joined: 08 Jul 2018
Posts: 4

PostPosted: Sun Jul 08, 2018 3:54 pm    Post subject: Reply with quote

I've tried module_base_dict before, Adobe AIR.dll is not among the list. The output is:

{'wow64.dll': 2004287488L, 'ntdll.dll': 140707013066752L, 'wow64win.dll': 2003763200L, 'wow64cpu.dll': 2004680704L}

This is why I'm confused as to what to do at this point. If it's not a process, Brawlhalla.exe is a separate thing, and it's not in the module list... what's left for me to do?
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4289

PostPosted: Sun Jul 08, 2018 4:21 pm    Post subject: Reply with quote

There should be a hell of a lot more than just the wow64 emulator dlls. It's probably a bug with a library you're using.

You can try to find a better library out there that actually works, or just make it yourself (e.g. Stack Overflow).

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Quibbs
How do I cheat?
Reputation: 0

Joined: 08 Jul 2018
Posts: 4

PostPosted: Sun Jul 08, 2018 5:01 pm    Post subject: Reply with quote

Using the specific script you linked (which I think was the same one I was working with before switching to the Python library), I get only five outputs: Brawlhalla.exe and the same four DLLs from before.

Code:
----new entry-----
568
1
34232
65535
65535
<winappdbg.win32.defines.LP_c_byte object at 0x00000000029E5C48>
159744
2686976
Brawlhalla.exe
C:\Program Files (x86)\Steam\steamapps\common\Brawlhalla\Brawlhalla.exe
----new entry-----
568
1
34232
65535
65535
<winappdbg.win32.defines.LP_c_byte object at 0x00000000029E5C48>
1970176
140707013066752
ntdll.dll
C:\WINDOWS\SYSTEM32\ntdll.dll
----new entry-----
568
1
34232
65535
65535
<winappdbg.win32.defines.LP_c_byte object at 0x00000000029E5C48>
335872
2004287488
wow64.dll
C:\WINDOWS\System32\wow64.dll
----new entry-----
568
1
34232
65535
65535
<winappdbg.win32.defines.LP_c_byte object at 0x00000000029E5C48>
491520
2003763200
wow64win.dll
C:\WINDOWS\System32\wow64win.dll
----new entry-----
568
1
34232
1
1
<winappdbg.win32.defines.LP_c_byte object at 0x00000000029E5C48>
40960
2004680704
wow64cpu.dll
C:\WINDOWS\System32\wow64cpu.dll


Could this be related to this being a Adobe AIR and/or Steam game? Like some of the DLLs are hidden (is that possible?) or maybe being loaded in different processes for security?

EDIT: Running this on chrome.exe does give a much longer list of DLLs, so these 4 DLLs could be the correct list...?
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4289

PostPosted: Sun Jul 08, 2018 5:49 pm    Post subject: Reply with quote

Oh, now I see the problem. Try passing TH32CS_SNAPMODULE | TH32CS_SNAPMODULE32 to CreateToolhelp32Snapshot.
(TH32CS_SNAPMODULE32 = 0x00000010)

PS: Chrome works because it's 64-bit.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
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