28 April 2020, 17:56 | #1 |
Global Moderator
Join Date: Nov 2001
Location: Derby, UK
Age: 48
Posts: 9,355
|
Library offsets
Hi Guys,
I am looking at some code (nothing important) and am wondering where I should look to investigate execbase offsets.. So Code:
movea.l (4),a6 jsr ($3c,a6) I know about offsets such as openlibrary etc, just unsure of these Cheers |
28 April 2020, 18:04 | #2 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 6,985
|
If you don't have list it might need quite some effort. I don't think there is a file in the developer docs which has all the offsets as readable text.
One working way to calculate the offset for a function is to look at the .fd file of the library. At the beginning there is an OFFSET statement which tells you at which offset to start for the first function (usually -30), then you add -6 for each line in the file until you reach the function of interest. |
28 April 2020, 18:12 | #3 |
Global Moderator
Join Date: Nov 2001
Location: Derby, UK
Age: 48
Posts: 9,355
|
This is right at the beginning of the file, and i'm sure absexecbase is stored in a6, hence this looks like an exec offset, however I know most library cales are negative (-$228 for openlibrary etc). I'm messing with resource and disassembing some code, and wanted to get the right symbols
|
28 April 2020, 18:24 | #4 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
I usually use ReSource for offsets (positive or negative) in libraries.
And I've a file with all the _LVO offsets to include in my ASM projects. For -$3C: _LVODispatch equ -60 You sure ExecBase is not tampered? A positive value for a jsr in exec is strange.. |
28 April 2020, 18:33 | #5 |
Zone Friend
Join Date: May 2006
Location: France
Posts: 1,801
|
|
28 April 2020, 18:46 | #6 | |
Global Moderator
Join Date: Nov 2001
Location: Derby, UK
Age: 48
Posts: 9,355
|
Quote:
Indeed this is odd.. Attached is a part of the code directly from resource: |
|
28 April 2020, 18:53 | #7 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
Maybe a binary loaded with LoadSeg() and then modified?
More info needed |
28 April 2020, 18:54 | #8 |
Registered User
Join Date: Apr 2005
Location: digital hell, Germany, after 1984, but worse
Posts: 3,365
|
I use Scout for that purpose. It needs the FD files from the NDK and an assign to FD: and you can also install the disassembler.library (I think its from ThoR) and then just click onto the "Function" button to see the actual code of that function, which could also be the code of a patch.
If you need to know positive offsets you can use the structure.guide: http://aminet.net/package/dev/asm/StructureGuide In your example ($60,A6) seems to be an interrupt vector in the execbase structure, but I've never used things like that. Edit: And if I remember it correctly, XOpa 1.96 has also excellent support for the execbase structure at real-time built-in. Last edited by PeterK; 28 April 2020 at 19:15. |
28 April 2020, 19:00 | #9 | |
Global Moderator
Join Date: Nov 2001
Location: Derby, UK
Age: 48
Posts: 9,355
|
Quote:
Essentially I am resourcing the captive map-generator (just for the hell of it).. I am doing it to try and understand how to use resource etc.. mapgen is attached |
|
28 April 2020, 19:06 | #10 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
I doubt this runs on its own, some other binary must have modified $4.w before. Looking at the plain ReSource screenshot you've posted I'd guess this would crash if run. The complete package would be required.
|
28 April 2020, 19:12 | #11 | |
Global Moderator
Join Date: Nov 2001
Location: Derby, UK
Age: 48
Posts: 9,355
|
Quote:
Now you have said this, I guess it makes sense. I never considered that someone might overwrite $4. It's Captive, maybe I should resource the bootloader, and then the file loader. Cheers guys |
|
28 April 2020, 19:12 | #12 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
Yep, this can't work on its own.
Inside there is also some encrypted code... Not the best example to learn how to use ReSource |
28 April 2020, 19:12 | #13 |
Global Moderator
Join Date: Nov 2001
Location: Derby, UK
Age: 48
Posts: 9,355
|
|
28 April 2020, 19:15 | #14 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,322
|
IIRC Captive uses own mini-OS called Ratt-Dos. The code has nothing to do with exec library.
To know what it is doing, disassembly of the loader is definitely needed. |
28 April 2020, 19:51 | #15 |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
|
$60,ExecBase should be:
Code:
WORD ChkSum ; for all of the above (minus 2) ******* Interrupt Related ******************************************** LABEL IntVects STRUCT IVTBE,IV_SIZE STRUCT IVDSKBLK,IV_SIZE STRUCT IVSOFTINT,IV_SIZE STRUCT IVPORTS,IV_SIZE STRUCT IVCOPER,IV_SIZE STRUCT IVVERTB,IV_SIZE STRUCT IVBLIT,IV_SIZE STRUCT IVAUD0,IV_SIZE STRUCT IVAUD1,IV_SIZE STRUCT IVAUD2,IV_SIZE STRUCT IVAUD3,IV_SIZE STRUCT IVRBF,IV_SIZE STRUCT IVDSKSYNC,IV_SIZE STRUCT IVEXTER,IV_SIZE STRUCT IVINTEN,IV_SIZE STRUCT IVNMI,IV_SIZE Code:
STRUCTURE IV,0 APTR IV_DATA APTR IV_CODE APTR IV_NODE LABEL IV_SIZ |
28 April 2020, 20:12 | #16 | |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
Quote:
Last edited by StingRay; 28 April 2020 at 21:34. Reason: typo |
|
28 April 2020, 21:19 | #17 |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
|
|
29 April 2020, 03:32 | #18 | |
Registered User
Join Date: Sep 2007
Location: Montreal, Canada
Age: 55
Posts: 68
|
Quote:
To create the Ultimate Captive Guide webpage, I reverse engineered about 95% of Captive including the map generator completely in order to create the dedicated section of the webpage. I also converted it to C++ to have it work with the SuperCC tool. It was a lot of fun and I learned SO much. Last edited by Lyverbe; 29 April 2020 at 13:37. |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Being Screwed around over icon.library and workbench.library. | rcrook9190 | support.Hardware | 8 | 07 January 2020 07:19 |
HELP: Opus5, KingCON, SysInfo.library (Sysmon.library) triangle | Michael | support.Apps | 6 | 10 March 2014 14:08 |
Mediator - openpci.library and pci.library | mardn78 | support.Hardware | 1 | 01 February 2014 11:11 |
Dat File Offsets? | Brakus | Coders. General | 2 | 29 June 2008 00:51 |
Making a shared library from a gcc .a library | JoJo | Coders. General | 1 | 10 March 2003 19:06 |
|
|