15 April 2024, 17:14 | #121 |
Registered User
Join Date: Apr 2019
Location: UK
Posts: 180
|
|
16 May 2024, 13:09 | #122 |
Registered User
Join Date: Apr 2019
Location: UK
Posts: 180
|
Hi. I'm having trouble processing offset hunk files with
-configand I'm not sure if this is user error or a bug. Using WB1.3 Calculator as a test case, this works as expected: Code:
ira -a -label=1 -radix=0 -compat=bi -preproc Calculator ira -a -label=1 -radix=0 -compat=bi -config Calculator Code:
ira -a -label=1 -radix=0 -compat=bi -offset=$10000 -preproc Calculator ira -a -label=1 -radix=0 -compat=bi -config Calculator DPass1(see below), before eventually crashing with read access vilolation Code:
IRA V2.11 (May 16 2024) (c)1993-1995 Tim Ruehsen (SiliconSurfer/PHANTASM) (c)2009-2023 Frank Wille (c)2014-2019 Nicolas Bastien SOURCE : "Calculator" TARGET : "Calculator.asm" CONFIG : "Calculator.cnf" MACHINE: MC68000 OFFSET : $00010000 codeAdrs: 0 codeAdrMax: 16 CodeArea[0]: 00010000 - 0001008a CodeArea[1]: 000100a2 - 00010582 ... CodeArea[19]: 00011df0 - 00011df0 CodeArea[20]: 00011df4 - 00011df4 Watch out: prgcounter(00010000) > nextreloc(00000080) Watch out: prgcounter(00010002) > nextreloc(00000080) Watch out: prgcounter(00010006) > nextreloc(00000080) ... Watch out: prgcounter(00010088) > nextreloc(00000080) P1 Missed bad reloc addr $00000080! Pass 1: 100% Pass 2: correcting labels Pass 2: writing mnemonics 0 adr=10000 This=0 0 adr=10002 This=0 0 adr=10006 This=0 ... 0 adr=10088 This=0 0 adr=1008a This=0 This is not a problem for -BINARY files. Many thanks for any help with this. EDIT: Passing -offset=$10000along with -configfixes this, but I thought the offset would be read from the config file. EDIT2: This seems to be an ordering bug: Code:
main() Init() ReadOptions() parse -OFFSET=<OFFSET> into ira->params.prgStart ReadAmigaHunkExecutable(ira); ExamineHunks() set ira->hunksOffs[] from ira->params.prgStart set ira->reloc.relocAdr[] <- ira->hunksOffs[i] + offset ReadConfig() Parse OFFSET directive into ira->params.prgStart Last edited by hop; 16 May 2024 at 14:29. |
16 May 2024, 18:04 | #123 | |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,510
|
Yes, but only because BINARY files have no relocations attached.
Quote:
I guess the easiest solution is to forbid the OFFSET directive in config files, as long as the input file type is not a raw binary. And don't let -preproc write OFFSET to config files, when the type is not binary. I fixed that now (still allowing OFFSET=0 for backwards compatibility). For hunk-format executables you have to use the command line option. I wasn't even aware that it can be used for relocatable executable files. |
|
16 May 2024, 18:21 | #124 | |
Registered User
Join Date: Apr 2019
Location: UK
Posts: 180
|
Thanks
Of course Quote:
|
|
17 May 2024, 00:46 | #125 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,510
|
Nothing is impossible. I'm on holiday for four days now and will think about whether it is worth the effort. The feature to use OFFSET for relocatable executables seems rarely used. What is your use-case here?
|
17 May 2024, 08:26 | #126 | ||
Registered User
Join Date: Apr 2019
Location: UK
Posts: 180
|
Quote:
Quote:
The tool is also handy for identifying "hidden" CODE areas such as exception handlers. Last edited by hop; 17 May 2024 at 08:46. Reason: Clarity |
||
20 May 2024, 22:39 | #127 | |
Registered User
Join Date: Jul 2009
Location: Lala Land
Posts: 537
|
Quote:
|
|
20 May 2024, 23:30 | #128 | |
Registered User
Join Date: Apr 2019
Location: UK
Posts: 180
|
Quote:
A video is a great idea. I was just about ready to release this tool, but I really thought it needed some more automation to be really useful. Feature creep. |
|
21 May 2024, 21:23 | #129 |
Registered User
Join Date: Feb 2017
Location: Denmark
Posts: 1,145
|
Looks very neat, and looking forward to trying it out! I've also played around with making a more advanced disassambler myself, and the lack of "recursive" code discovery in IRA once you go for config settings is by far my biggest issue.
|
21 May 2024, 23:05 | #130 | |
Registered User
Join Date: Apr 2019
Location: UK
Posts: 180
|
Quote:
I wasn't planning on writing a 68000 emulator, but the code traversal benefits from it. I should probably swap it out for a tried and tested feature compete 680x0 one, but it's been fun. The traversal algorithm needs a bit more work. At present it can both break out of loops early that need to complete (like memcpys), and get stuck in loops it needs to escape from (like waitrasters). Swapping the simple counters for some simple CPU/memory state tracking should hopefully fix this. |
|
21 May 2024, 23:16 | #131 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,302
|
I always wanted to do this too (symbolic execution) since 2003 but never went through. If you have your own emulation layer, you could get rid of IRA altogether, as executing in "text" mode has its limitations. There's a very good lib called "capstone" that even has a python interface and which can disassemble a lot of processors. I've used it in a project for work on 68040 and it works.
To be honest, finding LVOs is often much easier, with some manual rework. I've written a tool (cheapres.py) which allows to find most of them by performing some lousy & cheap "symbolic" execution (run until RTS or JMP or BRA and keep track of the current A6 value), then you rework the IRA source and run again to find the remaining ones. |
Yesterday, 17:14 | #132 | ||
Registered User
Join Date: Apr 2019
Location: UK
Posts: 180
|
Hi. I would not have liked to try this in 2003, when immediate mode GUIs were not available.
Quote:
Thanks very much. Noted! Quote:
|
||
Yesterday, 17:55 | #133 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,510
|
Ok. Had not much time during my holidays, but implemented that now. The config file is read twice. Once before reading the source file (for OFFSET) and once after that, for the remaining options.
Beta-archive is here: http://sun.hasenbraten.de/~frank/TEST/ira_211beta.lha |
Yesterday, 18:55 | #134 | |
Registered User
Join Date: Apr 2019
Location: UK
Posts: 180
|
Quote:
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ira for Windows | jotd | Coders. General | 63 | 12 December 2023 10:53 |
New tutorial on sprites | Yragael | Coders. Tutorials | 8 | 04 September 2023 21:00 |
Debugging messages in serial (small tutorial, mainly for cross-dev) | alkis | Coders. Asm / Hardware | 7 | 22 February 2016 14:16 |
68020 to 68000 code convertion using Ira and PhxAss | gulliver | Coders. Asm / Hardware | 18 | 12 April 2014 01:09 |
Looking for IRA v1.07 or newer :-) | voxel | request.Apps | 7 | 30 July 2008 01:39 |
|
|