Hello,
Are any of you guys familiar with the LHA file format? I believe it was used on the Commodore and maybe Amiga systems back in the day.
I have a custom DOS archive that is just an LHA archive that's been modified a bit. I can decrypt it but the program I'm using, ar (from way back in the day) doesn't recreate the header properly. In the ar.c file, it shows bits 15 - 18 (starting at 0) are UNUSED but in this custom archive, they are used.
I was digging around on the net, and I found for the Commodore LHA archive, those bits are used for the date. I believe in this custom archive, they're used for the date as well. When I extract them using the custom program that the original author wrote, I see the first file is created with a time stamp of:
12-31-97 4:00pm.
When I use the really old ar program, they're created with today's date. When I create an archive using the really old ar program, those bits are all 0's. However, in the custom archive, those bits are:
94 6B BA 31
According to the document I found online for the Commodore LHA archive program, the date format can be broken down like this:
I tried concentrating on calculating the year from the data I have and have been unsuccessful. Any smart math people out there that might want to give me a hand trying to figure this out? Thanks!
Are any of you guys familiar with the LHA file format? I believe it was used on the Commodore and maybe Amiga systems back in the day.
I have a custom DOS archive that is just an LHA archive that's been modified a bit. I can decrypt it but the program I'm using, ar (from way back in the day) doesn't recreate the header properly. In the ar.c file, it shows bits 15 - 18 (starting at 0) are UNUSED but in this custom archive, they are used.
I was digging around on the net, and I found for the Commodore LHA archive, those bits are used for the date. I believe in this custom archive, they're used for the date as well. When I extract them using the custom program that the original author wrote, I see the first file is created with a time stamp of:
12-31-97 4:00pm.
When I use the really old ar program, they're created with today's date. When I create an archive using the really old ar program, those bits are all 0's. However, in the custom archive, those bits are:
94 6B BA 31
According to the document I found online for the Commodore LHA archive program, the date format can be broken down like this:
Code:
Bytes: $0000-0001: Time of last modification: BITS 0 - 4: Seconds divided by 2 (0-58, only even numbers) BITS 5 - 10: Minutes (0-59) BITS 11 - 15: Hours (0-23, no AM or PM) Bytes: $0002-0003: Date of last modification: BITS 0- 4: Day (1-31) BITS 5- 9: Month (1-12) BITS 10-15: Year minus 1980
Comment