View previous topic :: View next topic |
Author |
Message |
daninthemix Cheater Reputation: 0
Joined: 29 Jul 2013 Posts: 39
|
Posted: Sun Jun 28, 2020 12:48 am Post subject: Help with enumMemoryRegions |
|
|
This very helpful script gives you the base address of DOSBOX's virtual memory:
Code: | [ENABLE]
for i,v in ipairs(enumMemoryRegions()) do
if v.RegionSize==0x1001000 and v.AllocationProtect==4 then
unregisterSymbol('GameMemoryStart') registerSymbol('GameMemoryStart',v.BaseAddress+0x20)
end
end |
But it only works when in the dosbox.conf.
If it doesn't work, and I've tried using Code: | v.RegionSize==0x2002000 | but to no avail.
How can I figure out what memory region size I want to be searching for, when DOSbox is using a particular amount of virtual memory?
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25287 Location: The netherlands
|
Posted: Sun Jun 28, 2020 1:32 am Post subject: |
|
|
try 2001000
anyhow, instead of checking the size you could change the check to v.RegionSize>=0x1001000
and then check each result if it's a valid dosbox memory region
e.g at GameMemoryStart+7e is likely the 2 byte value 0xc000 (int1f default points to a graphics card bios rom area which is at c000)
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
daninthemix Cheater Reputation: 0
Joined: 29 Jul 2013 Posts: 39
|
Posted: Sun Jun 28, 2020 3:04 am Post subject: |
|
|
v.RegionSize>=0x1001000 works great - tested on 32MB and 64MB mem sizes, so thanks a million for that.
In the case of games with changing values (for example Fade to Black - the health value is in a different location every time you run the game), would I just follow the standard process of trying to find the pointer, and then when I do make that pointer relative to GameMemoryStart right at the end?
I always get very confused when it comes to finding pointers in emulators.
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25287 Location: The netherlands
|
Posted: Sun Jun 28, 2020 8:43 am Post subject: |
|
|
no, pointers are very different in emulators, and in realmode it's just a nightmare
in realmode (dos) a pointer exists out of segment and offset
segment specifies the address*0x10 and offset adds to it
e.g
0x1000:0x30 would end up at 0x10000+0x30=0x10030
0x1002:0x10 would end up at 0x10020+0x10=0x10030
0x1003:0x0 would end up at 0x10030+0=0x10030
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
daninthemix Cheater Reputation: 0
Joined: 29 Jul 2013 Posts: 39
|
Posted: Sun Jun 28, 2020 9:07 am Post subject: |
|
|
Thanks a million for your help.
Luckily most DOS games seem to use static addresses. So with the above method, you can just find the right address once, then add it with GameMemoryStart+offset and it works across all versions of DOSBox, which is great.
|
|
Back to top |
|
|
mgr.inz.Player I post too much Reputation: 218
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Mon Jul 13, 2020 11:27 am Post subject: |
|
|
Left window = dosbox with memsize=16
Right window = dosbox with memsize=32
This should work for memsize=32
Code: | for i,v in ipairs(enumMemoryRegions()) do
if v.RegionSize==0x2001000 and v.AllocationProtect==4 then
unregisterSymbol('GameMemoryStart') registerSymbol('GameMemoryStart',v.BaseAddress+0x20)
end |
end
What games are using more than 16MB under DOS?
_________________
|
|
Back to top |
|
|
|