English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 02 October 2020, 21:33   #1
Steffest
Registered User
 
Join Date: Jan 2017
Location: Antwerp / Belgium
Posts: 189
Detect Amiga 68k Executable

Hey!

I'm building a mix-n-match system where you can access files from different platforms. The plan is to detect what type of file you're working with and then automatically perform a meaningful action.

In the case of an Amiga executable, it should fire up an Amiga Emulator, mount the volume the file is located on and execute the file.

Thing is: how do you detect an Amiga executable?
Does this approach makes sense:
- check if there's an .info file attached that has the executable flag set
- check if the file starts with 000003F300000000
- Check if the file starts with the ELF header

for the ELF header: How do you know the binary is for the 68k platform and not some unix type x86 flavour?
Steffest is offline  
Old 02 October 2020, 21:41   #2
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,186
68k AmigaOS uses Hunk files, not ELF. Only the next-gen Amiga systems use the ELF format.
Samurai_Crow is offline  
Old 02 October 2020, 21:44   #3
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,161
Quote:
check if the file starts with 000003F300000000
that

But your auto mount & winuae execute thing will fail if the executable needs assigns, or a given CPU to work. You could detect shell scripts as well. At least the ones starting with

Code:
.key
that's how I have configured classaction to detect scripts (of course the ".key" keyword must be present)
jotd is offline  
Old 02 October 2020, 21:59   #4
Steffest
Registered User
 
Join Date: Jan 2017
Location: Antwerp / Belgium
Posts: 189
Quote:
Originally Posted by jotd View Post
that

But your auto mount & winuae execute thing will fail if the executable needs assigns, or a given CPU to work. You could detect shell scripts as well. At least the ones starting with

Code:
.key
that's how I have configured classaction to detect scripts (of course the ".key" keyword must be present)
Thanks!
Indeed - it's a best effort and it will sometimes fail.
The main goal is to have an easy to use system to parse thousands of ADF files, scanning the content, trying to determine what's on them.
There are far to many to do that by hand, so if it at least could make a rough first index, listing the DOS disks with percentages of file type (pictures, executables, music mods, text files, ...) that would already be very useful.

Then I can check the interesting ones manually.
Most data files can then be opened directly or copied to the local filesystem, and for executables I mount the ADF file in an emulator to run the exe, or just boot the disk.

Last edited by Steffest; 02 October 2020 at 22:24.
Steffest is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Amiga 1200 floppydrive doesn’t detect diskchange bolding support.Hardware 15 12 August 2019 15:08
asm routine to reloc amiga executable jotd Coders. Asm / Hardware 3 10 March 2016 19:24
Freespace 68k Problem with executable meckert support.Games 10 18 September 2014 03:17
Is winuae able to detect emulated (Amiga) output resolution? ceztko support.WinUAE 5 11 March 2007 23:36
WinUAE 1.3 does not detect my Amiga 2.5" IDE HDD gizmomelb support.WinUAE 2 18 July 2006 14:46

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 17:18.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.06850 seconds with 13 queries