Announcement

Collapse
No announcement yet.

Commodore and old system LHA archive format...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #41
    Re: Commodore and old system LHA archive format...

    http://translate.google.com/translat...emp/header.txt

    Code:
      For c. OS ID
    
       Currently, it has reserved the following ID.
    
        MS-DOS 'M'
        OS / 2 '2'
        OS9 '9'
        OS / 68K 'K'
        OS / 386 '3'
        HUMAN 'H'
        UNIX 'U'
        CP / M 'C'
        FLEX 'F'
        Mac 'm'
        Runser 'R'
    Here is an extended list of OS IDs:

    http://homepage1.nifty.com/dangan/en...otes/OSID.html

    This is a very extensive resource:

    http://homepage1.nifty.com/dangan/en...tes/Notes.html
    Last edited by fzabkar; 02-22-2016, 08:39 PM.

    Comment


      #42
      Re: Commodore and old system LHA archive format...

      How did you find that stuff? The first article...I wonder if there's away to find the source to the version released in 92 (or around there).

      I feel like I'm going to explode. There's this doctor who's a customer of mine and he brought me three computers but two of them are reeeeally old and he wants Windows 7 on them. I told him that it would run soooo slow but he insists. It's a nightmare man. I got 7 on both of them but drivers? I can't find any drivers for one of them. Some Pinnacle JPEG-1 card (wtf?). It's got a socket 478 SL9J P4 processor in it. It came with Windows 98SE and had 256 MBs of RAM. The other one is a Dell Inspiron 5100. Three days, still doing Windows updates on it. When I click the start menu, literally, 5 minutes later, it'll pop up.

      I got a feeling once I give these back, he's gonna pay me more money to put XP on them.
      -- Law of Expanding Memory: Applications Will Also Expand Until RAM Is Full

      Comment


        #43
        Re: Commodore and old system LHA archive format...

        It says for directory name separator:
        level-0 header
        Traditional LHarc, the same format as LArc. Separator of directory name is '¥'

        What does the funky Y mean? Maybe the $ sign?
        Last edited by Spork Schivago; 02-22-2016, 09:39 PM.
        -- Law of Expanding Memory: Applications Will Also Expand Until RAM Is Full

        Comment


          #44
          Re: Commodore and old system LHA archive format...

          it's a japanese character.
          it does not seem to translate into anything.

          Comment


            #45
            Re: Commodore and old system LHA archive format...

            I found the source code to an older version of LHArc (from 89 I think?) I see they convert the MS-DOS timestamp to Unix like this:
            Code:
            static struct tm *
            msdos_to_unix_stamp_tm (a)
               long a;
            {
             static struct tm t;
            
             t.tm_sec = ( a     & 0x1f) * 2;
             t.tm_min = (a >>  5) & 0x3f;
             t.tm_hour = (a >>  11) & 0x1f;
             t.tm_mday = (a >>  16) & 0x1f;
             t.tm_mon = (a >> 16+5) & 0x0f - 1;
             t.tm_year = ((a >> 16+9) & 0x7f) + 80;
             return &t;
            }
            I wonder if those bit-wise &'s have anything do with it. Come tomorrow, I'm going to compile the LHArc code (it's completely different than the ar code) and see if it can properly decompress these files with the proper time stamp.
            -- Law of Expanding Memory: Applications Will Also Expand Until RAM Is Full

            Comment


              #46
              Re: Commodore and old system LHA archive format...

              Originally posted by stj View Post
              it's a japanese character.
              it does not seem to translate into anything.
              Right. I wonder if it's meant to be an ASCII character. Do Japanese computers have the same ASCII table that we have? They'd have to, I'd think.
              -- Law of Expanding Memory: Applications Will Also Expand Until RAM Is Full

              Comment


                #47
                Re: Commodore and old system LHA archive format...

                I changed the OS ID to "U", but 7-Zip still interpreted the date in "generic" format rather than Unix format. However, the Host OS was now seen as UNIX rather than Unknown.

                BTW, the "nifty" web site turned up in a Google search for "Runser":

                http://www.google.com/search?q=Runse...rating+system"

                The directory name separator is 0xFF. It is used instead of "\" or "/".

                http://homepage1.nifty.com/dangan/en...ExtHeader.html
                Last edited by fzabkar; 02-22-2016, 11:00 PM.

                Comment


                  #48
                  Re: Commodore and old system LHA archive format...

                  Originally posted by fzabkar View Post
                  I changed the OS ID to "U", but 7-Zip still interpreted the date in "generic" format rather than Unix format. However, the Host OS was now seen as UNIX rather than Unknown.

                  BTW, the "nifty" web site turned up in a Google search for "Runser":

                  http://www.google.com/search?q=Runse...rating+system"

                  The directory name separator is 0xFF. It is used instead of "\" or "/".

                  http://homepage1.nifty.com/dangan/en...ExtHeader.html
                  Thank you. I know in the program Stj linked to, they seem to use -lhd- for directory markers. I'd like to use the program Stj linked too, but too much has changed. Once I get ar working to create 100% duplicate archives, I want to modify LHArc to do the same. That's one heck of a job. The code in LHArc seems to be a bit nicer.

                  Where exactly is the OS ID stored? I can't seem to find it. Thanks for the help.
                  -- Law of Expanding Memory: Applications Will Also Expand Until RAM Is Full

                  Comment


                    #49
                    Re: Commodore and old system LHA archive format...

                    Oh, it's after the CRC-16 of the original file.
                    -- Law of Expanding Memory: Applications Will Also Expand Until RAM Is Full

                    Comment


                      #50
                      Re: Commodore and old system LHA archive format...

                      So, if I fill in 94 6B BA 00, I get 5-22-98 2:40A. This cannot be seconds from 1997. 94 6B BA 00 is 2490087936 seconds. That's over 78 years. If I keep those three bytes the same, but put any value in the last column, time goes backwards it seems and I get dates back before 97.

                      If I do 94 6B 00 00, I get 12-31-97 11:39PM. That's 7 hours, 39 minutes after 4:00PM. That's 25,200 seconds. Shouldn't 94 6B be 37,995 seconds, not 25,200?
                      Last edited by Spork Schivago; 02-23-2016, 02:26 PM.
                      -- Law of Expanding Memory: Applications Will Also Expand Until RAM Is Full

                      Comment


                        #51
                        Re: Commodore and old system LHA archive format...

                        that strange character earlier,
                        i just saw it on a website - it's the chinese symbol for "yen" as in the currency!!!
                        why would that be in a japanese document?

                        Comment


                          #52
                          Re: Commodore and old system LHA archive format...

                          Also, I'm struggling with converting seconds to years, month, day, hours, minutes and seconds. Could someone help me figure out the math?
                          -- Law of Expanding Memory: Applications Will Also Expand Until RAM Is Full

                          Comment


                            #53
                            Re: Commodore and old system LHA archive format...

                            Originally posted by stj View Post
                            that strange character earlier,
                            i just saw it on a website - it's the chinese symbol for "yen" as in the currency!!!
                            why would that be in a japanese document?
                            I think they're saying that in the file format, they use the yen symbol to distinguish a directory versus a file. So, if I have a directory called mydir, in the actual archive file, before mydir, there will be a yen symbol, to show that it's a directory and not a file.
                            -- Law of Expanding Memory: Applications Will Also Expand Until RAM Is Full

                            Comment


                              #54
                              Re: Commodore and old system LHA archive format...

                              0xba6b94 seconds = 141.403194 days

                              http://www.google.com.au/search?q=0x...econds+in+days


                              http://www.timeanddate.com/date/date...w=&ad=141&rec=

                              From Wednesday, 31 December 1997
                              Added 141 days
                              Result: Thursday, 21 May 1998


                              (16 hours) + (0.403194 days) = 25.676656 hours

                              http://www.google.com.au/search?q=16...+days+in+hours


                              0.676656 hours = 40.59936 minutes

                              http://www.google.com.au/search?q=0....urs+in+minutes


                              So (Dec 31, 1997 4PM) + (0xba6b94 seconds) = Friday, 22 May 1998 1:40AM

                              Comment


                                #55
                                Re: Commodore and old system LHA archive format...

                                Okay, so the first three bytes are definitely seconds. It's something with that last byte there that makes it go backwards, further away from Dec 31, 1997. I'm gonna try to write a program that converts those hex digits to years, days, months, seconds, etc for me real quick like.
                                -- Law of Expanding Memory: Applications Will Also Expand Until RAM Is Full

                                Comment


                                  #56
                                  Re: Commodore and old system LHA archive format...

                                  Man, you still don't get it. The date/time stamp is LITTLE-ENDIAN.

                                  https://en.wikipedia.org/wiki/Endianness

                                  As for the funny character, you can create a text file with a single 0xFF character as follows:

                                  Code:
                                  C:\>debug
                                  
                                  -e 100 ff
                                  -rcx
                                  CX 0000
                                  :1
                                  -n ff.txt
                                  -w
                                  Writing 00001 bytes
                                  -q
                                  If you examine this file in Windows Notepad or Wordpad, you see a lower case "y" with an umlaut.

                                  That said, the JetBBS.DAT file uses a backslash as a directory separator, IIUC.

                                  Code:
                                  Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
                                  
                                  0002E3D0       27 E3 2D 6D 67 35 2D 2A 00 00 00 77   'ã-mg5-*...w
                                  0002E3E0 00 00 00 DC 97 12 2E 20 01 0E 73 79 73 5C 73 75 ...Ü—.. ..sys\su
                                  0002E3F0 62 61 64 73 2E 74 78 74 3D D5 20         bads.txt=Õ

                                  Comment


                                    #57
                                    Re: Commodore and old system LHA archive format...

                                    maybe it's not nibbles, maybe it's octal.

                                    Comment


                                      #58
                                      Re: Commodore and old system LHA archive format...

                                      Originally posted by stj View Post
                                      maybe it's not nibbles, maybe it's octal.
                                      Eh?

                                      Comment


                                        #59
                                        Re: Commodore and old system LHA archive format...

                                        just trying to cause problems

                                        Comment


                                          #60
                                          Re: Commodore and old system LHA archive format...

                                          Originally posted by fzabkar View Post
                                          Man, you still don't get it. The date/time stamp is LITTLE-ENDIAN.

                                          https://en.wikipedia.org/wiki/Endianness

                                          As for the funny character, you can create a text file with a single 0xFF character as follows:

                                          Code:
                                          C:\>debug
                                          
                                          -e 100 ff
                                          -rcx
                                          CX 0000
                                          :1
                                          -n ff.txt
                                          -w
                                          Writing 00001 bytes
                                          -q
                                          If you examine this file in Windows Notepad or Wordpad, you see a lower case "y" with an umlaut.

                                          That said, the JetBBS.DAT file uses a backslash as a directory separator, IIUC.

                                          Code:
                                          Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
                                          
                                          0002E3D0       27 E3 2D 6D 67 35 2D 2A 00 00 00 77   'ã-mg5-*...w
                                          0002E3E0 00 00 00 DC 97 12 2E 20 01 0E 73 79 73 5C 73 75 ...Ü—.. ..sys\su
                                          0002E3F0 62 61 64 73 2E 74 78 74 3D D5 20         bads.txt=Õ
                                          I understand that it's little endian. This is what I remember from when I learned about it:
                                          Code:
                                          32-bit (4 bytes) of the hexadecimal number 946BBA31
                                          
                                          Big Endian:
                                            hex: 0x946BBA31
                                            bin: 10010100 01101011 10111001 00110001
                                          
                                          Little Endian:
                                            hex: 0x31BA6B94
                                            bin: 00110001 10111001 01101011 10010100
                                          Is that wrong Fzabkar? I don't mean to be upsetting you and I really do appreciate all the help you and STJ have provided.

                                          I still don't understand how 4-bytes of all 0's for the time stamps gives me a date of 12-31-97 at 4:00PM but 94 6b ba 31 gives me a date BEFORE 12-31-97 at 4:00pm. The endianness shouldn't matter there unless I'm misunderstanding something. Four 00's, big endian or little, is still 00. All 00's = 12-31-97 @ 4:00PM, any number, regardless of endianness, should make the timestamp newer than 12-31-97 @ 4:00PM. I don't see how being little endian creates a timestamp before 12-31-97 @ 4:00PM.
                                          Last edited by Spork Schivago; 02-23-2016, 05:16 PM.
                                          -- Law of Expanding Memory: Applications Will Also Expand Until RAM Is Full

                                          Comment

                                          Working...
                                          X