12 October 2009, 10:19 | #1 |
Zone Friend
|
Need sufficient condition for "is a NDOS disk"
Hi coders,
I've stumbled on a very special disk. (in the zone) It's 99% NDOS, but unfortunately meets all my criteria for an AmigaDOS disk, thus it is detected as such (remember computers and programs are dumb ) - DOS0 OFS boot block - Boot program pointer @ 0x370 in BOOT block - VALID ADOS disk name (even though it's "Lazarus" from DiskDestro...er...-Doctor) - Primary type 0x02 AND secondary type 0x01 in ROOT block; checksum is OK - longword #03 from ROOT block must be 0x48 My problem is that it is described as a SADDAM virus suspect (Which it is not, because Saddam does not infect NDOS disks) Unfortunately, said SADDAM virus does the rest to get a proper misdetection: - it clears both the bitmap flag (previously 0xFFFFFFFF, @0x78) and the bitmap ptr (@0x79) as well as (normally (!)) backs up the bitmap ptr by relocating it to 0x80. BUT: some SADDAM clones may also clear the backed-up bitmap ptr again sometime later!! So you guessed it: it will look the same as our NDOS disk: 0x78 - 0x80 is 0. Because of that, I need a sufficient condition to determine the disk being NDOS. Is there anything else I could check additionally to the things mentioned? Well, I could try reading the beginning of a selection of blocks and if it's 0x08 it's AmigaDOS data. Uh, no way, scratch that thought. So any ideas? Last edited by andreas; 13 October 2009 at 08:16. |
12 October 2009, 10:35 | #2 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
How can this be detected as DOS disk when it clearly does trackloading in the bootblock? Apparently your bootblock check is not correct as this is a custom bootblock.
|
12 October 2009, 10:50 | #3 |
CaptainM68K-SPS France
|
Yep Dragon Ninja is a NDOS RNC disk. It uses a trackloader.
|
12 October 2009, 11:50 | #4 | |
Zone Friend
|
Quote:
Only basic criteria so far (root block ptr must be $370 for ADOS in long word 02 (successor of boot checksum), etc.) Well OK, how could I start at best? In theory, I could be checking for some "typical" opcodes used in track loaders, for instance. Should ideally be generic and fit to a couple of known track loaders in the end. Trackloader signatures (i. e. whole byte sequences memcmp()'d in the same way as virus signatures) only if I must, please. Since this would mean doing a sort of brain file with "signatures" stored for a few known TLs. Cumbersome, yeah, but if there's no other way...so be it. Any further ideas? Last edited by andreas; 12 October 2009 at 11:58. |
|
12 October 2009, 12:11 | #5 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
You could include a standard bootblock (i.e. one created by the install command) in your program, since a standard bootblock doesn't do much it's only a few bytes you need to compare. If the compare fails -> non standard bootblock and you can do further checks.
|
12 October 2009, 12:19 | #6 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,507
|
There are too many variants of "no virus found"/disable extra drives bootblocks that make this kind of comparison pointless..
I guess you can look for trackdisk.device DoIO()/SendIO() calls but there are also demo packs that trackload the menu but use normal dos filesystem and startup-sequence.. Just forget it |
12 October 2009, 12:21 | #7 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
I disagree. He said he's checking for "normal OFS" bootblock, as such, the comparison with a standard bootblock makes perfect sense. If he wants to have a 100% reliable check he needs to do much more anyway.
|
12 October 2009, 12:25 | #8 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,507
|
I read/assumed/whatever his question as: how to detect between disk that can boot to dos (even if it has not exactly standard bootblock) and disk that has dos-like format but actually uses only trackloader.
|
12 October 2009, 12:29 | #9 | ||
Zone Friend
|
Quote:
Quote:
Because: There are lots of true ADOS disks (e. g. PD software from known publishers ) whose distributors put a boot-intro in the boot block which can usually be quit with the mouse. Or ancient BootGirl (& friends) were involved. [edit] Toni said it above already, just in other words [/edit] These disks normally do not include any NDOS sectors...and will make another brain file necessary: known boot (loader) blocks with a flag whether they're used on NDOS or DOS disks Toni seems right: too much diversity / variety Thanks anyway for your reactions... Last edited by andreas; 12 October 2009 at 12:35. |
||
12 October 2009, 13:16 | #10 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 6,987
|
Coincidentally I just read this thread and this description. So what about just searching for "dos.library". If it's not present, it's an NDOS disk for sure.
|
12 October 2009, 18:19 | #11 |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
|
Agreed. And if you want an extra check for OFS, you must compare with an OFS bootblock.
|
12 October 2009, 18:35 | #12 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 6,987
|
There is no such thing like an "OFS bootblock". OFS/FFS/INTL/DirCache are derived from the DosType stored in the first four bytes of the boot block. The boot code is always the same (or can even be custom).
|
13 October 2009, 08:21 | #13 | |
Zone Friend
|
Quote:
Speaking about DosType: doing a "(first word) & 1" operation in the bootblock should be a 100% safe method to detect FFS, for instance? |
|
13 October 2009, 08:45 | #14 | ||
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 6,987
|
Quote:
Quote:
0x444F5300 = OFS 0x444F5301 = FFS 0x444F5302 = OFS INTL 0x444F5303 = FFS INTL 0x444F5304 = OFS INTL DirCache 0x444F5305 = FFS INTL DirCache |
||
14 October 2009, 00:03 | #15 |
Zone Friend
|
Uh. I should have been more precise: "& 1" *IS* enough to detect "FFS family".
FFS has *always* odd LSB. 1st bit is SET = is_FFS ; CLR = is_OFS INTL or not INTL (...that's the question ) is determined by bit 2. I prefer to test such stuff in a loop, the "DosType & (1 << n)" way. More generic; and keeps me from #defining every value by hand. |
15 October 2009, 20:15 | #16 |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
|
What I meant was, if he doesn't want custom bootblocks, he'll have to compare the whole bootblock.
|
16 October 2009, 08:25 | #17 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 6,987
|
But he does want custom bootblocks. That's all of the problem. He only wants to distinguish between DOS and NDOS disks, but DOS disks with custom bootblock (i.e. boot intro or virus) should be accepted, too, while NDOS disks with DOS filesystem should be identified as such.
A DOS disk by this definition is a disk which can be written to by the means of AmigaDOS copy, rename, delete commands without destroying the game/software which originally was on the disk. An NDOS disk can still look like an empty or partially filled DOS disk when inserted after booting, but writing to it will destroy the software because it is hidden in unallocated tracks. The bootblock of such disk will take over the system early and will not initialize AmigaDOS, but rather use a trackloader routine to load the software. Currently the absence of the string "dos.library" in the bootblock is the best method to identify an NDOS disk. |
20 October 2009, 16:55 | #18 | ||
Zone Friend
|
Quote:
Quote:
|
||
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
"Lincs Amiga User Group aka "LAG" Meeting Confirmed for Sat 2nd of March" | rockape | News | 2 | 21 February 2013 22:46 |
"Reminder "Lincs Amiga User Group aka "LAG" Meet Sat 5th of January 2013" | rockape | News | 4 | 30 January 2013 00:06 |
CD32 Image-Name-Bug: "...(bla)[!].zip" -> "...(bla)[" / "...[test].zip" -> "...[tes" | cfTrio | support.WinUAE | 8 | 18 December 2012 16:31 |
Problems with "Thespywholovedme", "Flood", "Shinobi" | sareks | support.Games | 12 | 03 May 2006 14:52 |
"Read only" and "Disk swapper" | Ulric | support.WinUAE | 4 | 11 July 2004 14:17 |
|
|