10 April 2015, 14:32 | #1 |
Registered User
Join Date: Aug 2013
Location: Germany
Posts: 81
|
User Symbols in ReSource
Hi,
has anybody ever tried to create/use user symbols in ReSource? I am diasassembling and stumple about a big structure. The code allocates some kbytes of memory and stores the address to A5. It writes values to that alloated memory, for instance move.l d0, (8,A5) ; d0 contains execbase ptr ... move.l d0,(A5) ; d0 contains gfxbase ... LEA ($30,A5),A1 JSR (_LVOInitView,A6) ; ok, ($30,A5) is struct view Now with this knowledge I would like to build a structure definition that I can use in ReSource. I read UserSymbols.doc but that leaves many questions open. Do I create an Ascii-File for Resource or do I need to assemble it? Do I need Byte- or Word-symbols? Can anybody tell me what to do? regards selco |
10 April 2015, 19:25 | #2 |
Registered User
Join Date: Aug 2004
Location:
Posts: 3,344
|
You create an ASCII source file then assemble it to an executable using an assembler (e.g. PhxAss). For your structure, assuming it's shorter than 64KB you can use the WordSymbol macro to define the field names/offsets.
As an alternative, you could add a BSS hunk to the executable you want to disassemble before loading it into ReSource. Then define a copy of the structure in the BSS data and convert A5-relative references.So you'd have Code:
move.l D0,(8,A5) [rest of original code] SECTION whatever,BSS A5struct ds.b $1000 ;If 4KB is enough for whatever structures you define You can have three structures like that defined (Ctrl-Shift-Alt-1/2/3) and press Ctrl-1/2/3 to convert references to each. The advantage of that approach is, it's quicker if you're figuring out all the structure fields as you go. Whereas with a symbol base you'd need to edit and reassemble it, then load it into ReSource again whenever you make a change. And if you change the name of a structure field, all references to that field would automatically change to show the new name, unlike using a symbol base. |
11 April 2015, 18:31 | #3 | ||
Registered User
Join Date: Aug 2013
Location: Germany
Posts: 81
|
Hello and thank you very much for your answer!
Quote:
Are such user-symbols available somewhere already? Quote:
Can I do that after starting disassembling with ReSource? I do not know in advance if/how many/how big strctures I will find in the code...? Does that mean I add additional dummy variables to the code? How can I get rid of these variables later? Actually I disassemble some Kickstart modules. (Romboot/Strap) I used remus/romsplit to split my kickstart. Then I converted "romboot" with the tool "hunk" (Aminet) because ReSource did not like Reloc32Short. Then I loaded it into Resource and started. regards selco |
||
11 April 2015, 21:26 | #4 | ||
Registered User
Join Date: Aug 2004
Location:
Posts: 3,344
|
Quote:
User symbols can certainly be used if you're figuring out the data structure fields as you go, but as I mentioned repeatedly updating the user symbol source file, reassembling and loading into ReSource could be a bit of a pain. Though you might be able to use a ReSource macro to automatically reload the user symbols (I haven't tried that). Quote:
There are a couple of ways to create a BSS area. For example, suppose your original file is this: Code:
moveq #0,d0 rts dc.b "Hello" Code:
00000000: 000003f3 00000000 00000001 00000000 00000010: 00000000 00000003 000003e9 00000003 00000020: 70004e75 48656c6c 6f000000 000003f2 Code:
00000000: 000003f3 00000000 00000001 00000000 00000010: 00000000 00001003 000003e9 00000003 00000020: 70004e75 48656c6c 6f000000 000003f2 Code:
00000000: 000003f3 00000000 00000002 00000000 00000010: 00000001 00000003 00001000 000003e9 00000020: 00000003 70004e75 48656c6c 6f000000 00000030: 000003f2 000003eb 00001000 000003f2 |
||
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
SAS/C: Undefined symbols | Yesideez | Coders. C/C++ | 14 | 13 February 2014 16:36 |
Settlers/copy protection Symbols | macpegg | support.Games | 8 | 27 February 2009 05:23 |
ReSource 6.XX | MrZammler | request.Apps | 7 | 30 October 2007 14:15 |
Hardware symbols includes like cia.i | Photon | Coders. General | 6 | 10 March 2006 23:48 |
Resource | Amigaboy | request.Apps | 2 | 16 August 2001 05:15 |
|
|