6 // (C) 2010 Underground Software
8 // JLH = James Hammons <jlhamm@acm.org>
9 // JPM = Jean-Paul Mari <djipi.mari@gmail.com>
10 // RG = Richard Goedeken
13 // --- ---------- ------------------------------------------------------------
14 // JLH 01/16/2010 Created this log ;-)
15 // JLH 02/28/2010 Added functions to look inside .ZIP files and handle contents
16 // JLH 06/01/2012 Added function to check ZIP file CRCs against file DB
17 // JPM June/2016 Visual Studio support, ELF format support and Soft debugger support
18 // JPM 07/15/2016 DWARF format support
19 // JPM 04/06/2019 Added ELF sections check
20 // JPM 03/12/2020 Added ELF section types check and new error messages
21 // JPM Aug./2020 ELF executable file information
22 // RG Jan./2021 Linux build fixes
27 #include "_MSC_VER/config.h"
31 #include <sys/types.h>
39 #include "universalhdr.h"
45 #include "debugger/ELFManager.h"
46 #include "debugger/DBGManager.h"
50 // Private function prototypes
52 static int gzfilelength(gzFile gd
);
53 //#if defined(_MSC_VER) || defined(__MINGW64__)|| defined(__MINGW32__) || defined(__CYGWIN__)
54 static bool CheckExtension(const uint8_t *filename
, const char *ext
);
56 //static bool CheckExtension(const char * filename, const char * ext);
58 //static int ParseFileType(uint8_t header1, uint8_t header2, uint32_t size);
60 // Private variables/enums
64 // Generic ROM loading
66 uint32_t JaguarLoadROM(uint8_t * &rom
, char * path
)
68 // We really should have some kind of sanity checking for the ROM size here to prevent
69 // a buffer overflow... !!! FIX !!!
71 #pragma message("Warning: !!! FIX !!! Should have sanity checking for ROM size to prevent buffer overflow!")
73 #warning "!!! FIX !!! Should have sanity checking for ROM size to prevent buffer overflow!"
77 WriteLog("FILE: JaguarLoadROM attempting to load file '%s'...", path
);
78 char * ext
= strrchr(path
, '.');
80 // No filename extension == YUO FAIL IT (it is loading the file).
81 // This is naive, but it works. But should probably come up with something a little
82 // more robust, to prevent problems with dopes trying to exploit this.
85 WriteLog("FAILED!\n");
89 WriteLog("\nFILE: Succeeded in finding extension (%s)!\n", ext
);
90 WriteLog("FILE: Loading \"%s\"...", path
);
92 if (strcasecmp(ext
, ".zip") == 0)
94 // Handle ZIP file loading here...
95 WriteLog("(ZIPped)...");
97 // uint8_t * buffer = NULL;
98 // romSize = GetFileFromZIP(path, FT_SOFTWARE, buffer);
99 romSize
= GetFileFromZIP(path
, FT_SOFTWARE
, rom
);
103 WriteLog("Failed!\n");
107 // memcpy(rom, buffer, romSize);
112 // Handle gzipped files transparently [Adam Green]...
114 gzFile fp
= gzopen(path
, "rb");
118 WriteLog("Failed!\n");
122 romSize
= gzfilelength(fp
);
123 rom
= new uint8_t[romSize
];
124 gzseek(fp
, 0, SEEK_SET
);
125 gzread(fp
, rom
, romSize
);
129 WriteLog("OK (%i bytes)\n", romSize
);
136 // Jaguar file loading
137 // We do a more intelligent file analysis here instead of relying on (possible
138 // false) file extensions which people don't seem to give two shits about
141 bool JaguarLoadFile(char * path
)
144 GElf_Ehdr ElfEhdr
, *PtrGElfEhdr
;
146 Elf_Data
*PtrElfData
;
147 GElf_Shdr GElfShdr
, *PtrGElfShdr
;
149 uint8_t *buffer
= NULL
;
151 size_t ElfSectionNameType
;
152 int DBGType
= DBG_NO_TYPE
;
155 struct stat _statbuf
;
157 jaguarROMSize
= JaguarLoadROM(buffer
, path
);
159 if (jaguarROMSize
== 0)
161 // It's up to the GUI to report errors, not us. :-)
162 WriteLog("FILE: Could not load ROM from file \"%s\"...\nAborting load!\n", path
);
166 jaguarMainROMCRC32
= crc32_calcCheckSum(buffer
, jaguarROMSize
);
167 WriteLog("CRC: %08X\n", (unsigned int)jaguarMainROMCRC32
);
168 // TODO: Check for EEPROM file in ZIP file. If there is no EEPROM in the user's EEPROM
169 // directory, copy the one from the ZIP file, if it exists.
171 jaguarRunAddress
= 0x802000; // For non-BIOS runs, this is true
172 int fileType
= ParseFileType(buffer
, jaguarROMSize
);
173 jaguarCartInserted
= false;
176 if (fileType
== JST_ROM
)
178 jaguarCartInserted
= true;
179 memcpy(jagMemSpace
+ 0x800000, buffer
, jaguarROMSize
);
180 // Checking something...
181 jaguarRunAddress
= GET32(jagMemSpace
, 0x800404);
182 WriteLog("FILE: Cartridge run address is reported as $%X...\n", jaguarRunAddress
);
186 else if (fileType
== JST_ALPINE
)
188 // File extension ".ROM": Alpine image that loads/runs at $802000
189 WriteLog("FILE: Setting up Alpine ROM... Run address: 00802000, length: %08X\n", jaguarROMSize
);
190 memset(jagMemSpace
+ 0x800000, 0xFF, 0x2000);
191 memcpy(jagMemSpace
+ 0x802000, buffer
, jaguarROMSize
);
194 // Maybe instead of this, we could try requiring the STUBULATOR ROM? Just a thought...
195 // Try setting the vector to say, $1000 and putting an instruction there that loops forever:
196 // This kludge works! Yeah!
197 SET32(jaguarMainRAM
, 0x10, 0x00001000);
198 SET16(jaguarMainRAM
, 0x1000, 0x60FE); // Here: bra Here
201 else if (fileType
== JST_ELF32
)
205 char *PtrELFExe
= (char *)ELFManager_ExeCopy(buffer
, jaguarROMSize
);
207 if (PtrELFExe
!= NULL
)
209 // check the ELF version
210 if ((elf_version(EV_CURRENT
) != EV_NONE
) && (ElfMem
= ELFManager_MemOpen(PtrELFExe
, jaguarROMSize
)))
212 // get the file information
213 stat(path
, &_statbuf
);
215 if (ELFManager_DwarfInit(ElfMem
, _statbuf
))
217 DBGType
|= DBG_ELFDWARF
;
220 if (!elf_getshdrnum(ElfMem
, &NbrSect
))
222 if (((PtrGElfEhdr
= gelf_getehdr(ElfMem
, &ElfEhdr
)) != NULL
) && ((PtrElfScn
= elf_getscn(ElfMem
, 0)) != NULL
))
224 for (error
= false; (PtrElfScn
!= NULL
) && (error
== false); PtrElfScn
= elf_nextscn(ElfMem
, PtrElfScn
))
228 if ((PtrGElfShdr
= gelf_getshdr(PtrElfScn
, &GElfShdr
)) == NULL
)
234 NameSection
= elf_strptr(ElfMem
, PtrGElfEhdr
->e_shstrndx
, (size_t)PtrGElfShdr
->sh_name
);
235 WriteLog("FILE: ELF Section %s found\n", NameSection
);
237 if (((ElfSectionNameType
= ELFManager_GetSectionType(NameSection
)) == ELF_NO_TYPE
) && vjs
.ELFSectionsCheck
)
239 WriteLog("FILE: ELF Section %s not recognized\n", NameSection
);
244 switch (PtrGElfShdr
->sh_type
)
250 if ((PtrGElfShdr
->sh_flags
& (SHF_ALLOC
| SHF_WRITE
| SHF_EXECINSTR
)))
252 if (PtrGElfShdr
->sh_addr
>= 0x800000)
254 memcpy(jagMemSpace
+ PtrGElfShdr
->sh_addr
, buffer
+ PtrGElfShdr
->sh_offset
, PtrGElfShdr
->sh_size
);
259 memcpy(jaguarMainRAM
+ PtrGElfShdr
->sh_addr
, buffer
+ PtrGElfShdr
->sh_offset
, PtrGElfShdr
->sh_size
);
264 switch (ElfSectionNameType
)
267 case ELF_debug_abbrev_TYPE
:
268 case ELF_debug_aranges_TYPE
:
269 case ELF_debug_frame_TYPE
:
270 case ELF_debug_info_TYPE
:
271 case ELF_debug_line_TYPE
:
272 case ELF_debug_loc_TYPE
:
273 case ELF_debug_macinfo_TYPE
:
274 case ELF_debug_pubnames_TYPE
:
275 case ELF_debug_pubtypes_TYPE
:
276 case ELF_debug_ranges_TYPE
:
277 case ELF_debug_str_TYPE
:
278 case ELF_debug_types_TYPE
:
284 case ELF_comment_TYPE
:
288 WriteLog("FILE: ELF section %s is not recognized\n", NameSection
);
300 while ((error
== false) && ((PtrElfData
= elf_getdata(PtrElfScn
, PtrElfData
)) != NULL
))
302 if (!ELFManager_AddTab(PtrElfData
, ElfSectionNameType
))
304 WriteLog("FILE: ELF tab cannot be allocated\n");
311 WriteLog("FILE: ELF SHT type %i not recognized\n", PtrGElfShdr
->sh_type
);
319 // Set the executable address
320 jaguarRunAddress
= (uint32_t)PtrGElfEhdr
->e_entry
;
321 WriteLog("FILE: Setting up ELF 32bits... Run address: %08X\n", jaguarRunAddress
);
330 WriteLog("FILE: Cannot get the number of the ELF sections\n");
337 WriteLog("FILE: libelf version is not recognized or libelf memory cannot be opened\n");
343 WriteLog("FILE: ELFManager cannot allocate memory\n");
350 WriteLog("FILE: ELF parsing error\n");
352 if ((err
= elf_errno()))
354 WriteLog("FILE: ELF error: %s\n", elf_errmsg(err
));
361 DBGManager_SetType(DBGType
);
365 else if (fileType
== JST_ABS_TYPE1
)
367 // For ABS type 1, run address == load address
368 uint32_t loadAddress
= GET32(buffer
, 0x16),
369 codeSize
= GET32(buffer
, 0x02) + GET32(buffer
, 0x06);
370 WriteLog("FILE: Setting up homebrew (ABS-1)... Run address: %08X, length: %08X\n", loadAddress
, codeSize
);
371 memcpy(jagMemSpace
+ loadAddress
, buffer
+ 0x24, codeSize
);
373 jaguarRunAddress
= loadAddress
;
376 else if (fileType
== JST_ABS_TYPE2
)
378 uint32_t loadAddress
= GET32(buffer
, 0x28), runAddress
= GET32(buffer
, 0x24),
379 codeSize
= GET32(buffer
, 0x18) + GET32(buffer
, 0x1C);
380 WriteLog("FILE: Setting up homebrew (ABS-2)... Run address: %08X, length: %08X\n", runAddress
, codeSize
);
381 memcpy(jagMemSpace
+ loadAddress
, buffer
+ 0xA8, codeSize
);
383 jaguarRunAddress
= runAddress
;
386 // NB: This is *wrong*
388 Basically, if there is no "JAG" at position $1C, then the long there is the load/start
389 address in LITTLE ENDIAN.
390 If "JAG" is present, the the next character ("R" or "L") determines the size of the
391 JagServer command (2 bytes vs. 4). Following that are the commands themselves;
392 typically it will either be 2 (load) or 3 (load & run). Command headers go like so:
411 10: (Poll for commands)
413 12: (Load & run user program)
414 filname, terminated with NULL
419 else if (fileType
== JST_JAGSERVER
)
421 // This kind of shiaut should be in the detection code below...
422 // (and now it is! :-)
423 // if (buffer[0x1C] == 'J' && buffer[0x1D] == 'A' && buffer[0x1E] == 'G')
425 // Still need to do some checking here for type 2 vs. type 3. This assumes 3
426 // Also, JAGR vs. JAGL (word command size vs. long command size)
427 uint32_t loadAddress
= GET32(buffer
, 0x22), runAddress
= GET32(buffer
, 0x2A);
428 WriteLog("FILE: Setting up homebrew (Jag Server)... Run address: $%X, length: $%X\n", runAddress
, jaguarROMSize
- 0x2E);
429 memcpy(jagMemSpace
+ loadAddress
, buffer
+ 0x2E, jaguarROMSize
- 0x2E);
431 jaguarRunAddress
= runAddress
;
433 // Hmm. Is this kludge necessary?
434 SET32(jaguarMainRAM
, 0x10, 0x00001000); // Set Exception #4 (Illegal Instruction)
435 SET16(jaguarMainRAM
, 0x1000, 0x60FE); // Here: bra Here
439 // else // Special WTFOMGBBQ type here...
441 // uint32_t loadAddress = (buffer[0x1F] << 24) | (buffer[0x1E] << 16) | (buffer[0x1D] << 8) | buffer[0x1C];
442 // WriteLog("FILE: Setting up homebrew (GEMDOS WTFOMGBBQ type)... Run address: $%X, length: $%X\n", loadAddress, jaguarROMSize - 0x20);
443 // memcpy(jagMemSpace + loadAddress, buffer + 0x20, jaguarROMSize - 0x20);
445 // jaguarRunAddress = loadAddress;
449 else if (fileType
== JST_WTFOMGBBQ
)
451 uint32_t loadAddress
= (buffer
[0x1F] << 24) | (buffer
[0x1E] << 16) | (buffer
[0x1D] << 8) | buffer
[0x1C];
452 WriteLog("FILE: Setting up homebrew (GEMDOS WTFOMGBBQ type)... Run address: $%X, length: $%X\n", loadAddress
, jaguarROMSize
- 0x20);
453 memcpy(jagMemSpace
+ loadAddress
, buffer
+ 0x20, jaguarROMSize
- 0x20);
455 jaguarRunAddress
= loadAddress
;
459 // We can assume we have JST_NONE at this point. :-P
460 WriteLog("FILE: Failed to load headerless file.\n");
466 // "Debugger" file loading
467 // To keep the things separate between "Debugger" and "Alpine" loading until usage clarification has been done
469 bool DebuggerLoadFile(char * path
)
471 return (AlpineLoadFile(path
));
476 // "Alpine" file loading
477 // Since the developers were coming after us with torches and pitchforks, we
478 // decided to allow this kind of thing. ;-) But ONLY FOR THE DEVS, DAMMIT! >:-U
481 bool AlpineLoadFile(char * path
)
483 uint8_t * buffer
= NULL
;
484 jaguarROMSize
= JaguarLoadROM(buffer
, path
);
486 if (jaguarROMSize
== 0)
488 // It's up to the GUI to deal with failure, not us. ;-)
489 WriteLog("FILE: Could not load Alpine from file \"%s\"...\nAborting load!\n", path
);
493 jaguarMainROMCRC32
= crc32_calcCheckSum(buffer
, jaguarROMSize
);
494 WriteLog("FILE: CRC is %08X\n", (unsigned int)jaguarMainROMCRC32
);
497 jaguarRunAddress
= 0x802000;
499 WriteLog("FILE: Setting up Alpine ROM with non-standard length... Run address: 00802000, length: %08X\n", jaguarROMSize
);
501 memset(jagMemSpace
+ 0x800000, 0xFF, 0x2000);
502 memcpy(jagMemSpace
+ 0x802000, buffer
, jaguarROMSize
);
505 // Maybe instead of this, we could try requiring the STUBULATOR ROM? Just a thought...
506 // Try setting the vector to say, $1000 and putting an instruction there
507 // that loops forever:
508 // This kludge works! Yeah!
509 SET32(jaguarMainRAM
, 0x10, 0x00001000); // Set Exception #4 (Illegal Instruction)
510 SET16(jaguarMainRAM
, 0x1000, 0x60FE); // Here: bra Here
517 // Get the length of a (possibly) gzipped file
519 static int gzfilelength(gzFile gd
)
521 int size
= 0, length
= 0;
522 unsigned char buffer
[0x10000];
528 // Read in chunks until EOF
529 size
= gzread(gd
, buffer
, 0x10000);
544 // Compare extension to passed in filename. If equal, return true; otherwise false.
546 //#if defined(_MSC_VER) || defined(__MINGW64__)|| defined(__MINGW32__) || defined(__CYGWIN__)
547 static bool CheckExtension(const uint8_t *filename
, const char *ext
)
549 //static bool CheckExtension(const char * filename, const char * ext)
552 // Sanity checking...
553 if ((filename
== NULL
) || (ext
== NULL
))
556 const char * filenameExt
= strrchr((const char *)filename
, '.'); // Get the file's extension (if any)
558 if (filenameExt
== NULL
)
561 return (strcasecmp(filenameExt
, ext
) == 0 ? true : false);
566 // Get file from .ZIP
567 // Returns the size of the file inside the .ZIP file that we're looking at
568 // NOTE: If the thing we're looking for is found, it allocates it in the passed in buffer.
569 // Which means we have to deallocate it later.
571 uint32_t GetFileFromZIP(const char * zipFile
, FileType type
, uint8_t * &buffer
)
573 // NOTE: We could easily check for this by discarding anything that's larger than the RAM/ROM
574 // size of the Jaguar console.
575 #if defined(_MSC_VER)
576 #pragma message("Warning: !!! FIX !!! Should have sanity checking for ROM size to prevent buffer overflow!")
578 #warning "!!! FIX !!! Should have sanity checking for ROM size to prevent buffer overflow!"
580 const char ftStrings
[5][32] = { "Software", "EEPROM", "Label", "Box Art", "Controller Overlay" };
581 // ZIP * zip = openzip(0, 0, zipFile);
582 FILE * zip
= fopen(zipFile
, "rb");
586 WriteLog("FILE: Could not open file '%s'!\n", zipFile
);
594 // The order is here is important: If the file is found, we need to short-circuit the
595 // readzip() call because otherwise, 'ze' will be pointing to the wrong file!
596 // while (!found && readzip(zip))
597 while (!found
&& GetZIPHeader(zip
, ze
))
601 // Here we simply rely on the file extension to tell the truth, but we know
602 // that extensions lie like sons-a-bitches. So this is naive, we need to do
603 // something a little more robust to keep bad things from happening here.
604 #if defined(_MSC_VER)
605 #pragma message("Warning: !!! Checking for image by extension can be fooled !!!")
607 #warning "!!! Checking for image by extension can be fooled !!!"
609 if ((type
== FT_LABEL
) && (CheckExtension(ze
.filename
, ".png") || CheckExtension(ze
.filename
, ".jpg") || CheckExtension(ze
.filename
, ".gif")))
612 WriteLog("FILE: Found image file '%s'.\n", ze
.filename
);
615 if ((type
== FT_SOFTWARE
) && (CheckExtension(ze
.filename
, ".j64")
616 || CheckExtension(ze
.filename
, ".rom") || CheckExtension(ze
.filename
, ".abs")
617 || CheckExtension(ze
.filename
, ".cof") || CheckExtension(ze
.filename
, ".coff")
618 || CheckExtension(ze
.filename
, ".jag") || CheckExtension(ze
.filename
, ".elf")))
621 WriteLog("FILE: Found software file '%s'.\n", ze
.filename
);
624 if ((type
== FT_EEPROM
) && (CheckExtension(ze
.filename
, ".eep") || CheckExtension(ze
.filename
, ".eeprom")))
627 WriteLog("FILE: Found EEPROM file '%s'.\n", ze
.filename
);
631 fseek(zip
, ze
.compressedSize
, SEEK_CUR
);
634 uint32_t fileSize
= 0;
638 WriteLog("FILE: Uncompressing...");
639 // Insert file size sanity check here...
640 buffer
= new uint8_t[ze
.uncompressedSize
];
642 // if (readuncompresszip(zip, ze.compressedSize, buffer) == 0)
643 // if (UncompressFileFromZIP(zip, ze.compressedSize, buffer) == 0)
644 if (UncompressFileFromZIP(zip
, ze
, buffer
) == 0)
646 fileSize
= ze
.uncompressedSize
;
647 WriteLog("success! (%u bytes)\n", fileSize
);
653 WriteLog("FAILED!\n");
657 // Didn't find what we're looking for...
658 WriteLog("FILE: Failed to find file of type %s...\n", ftStrings
[type
]);
666 uint32_t GetFileDBIdentityFromZIP(const char * zipFile
)
668 FILE * zip
= fopen(zipFile
, "rb");
672 WriteLog("FILE: Could not open file '%s'!\n", zipFile
);
678 // Loop through all files in the zip file under consideration
679 while (GetZIPHeader(zip
, ze
))
681 // & loop through all known CRC32s in our file DB to see if it's there!
684 while (romList
[index
].crc32
!= 0xFFFFFF)
686 if (romList
[index
].crc32
== ze
.crc32
)
695 // We didn't find it, so skip the compressed data...
696 fseek(zip
, ze
.compressedSize
, SEEK_CUR
);
700 return (uint32_t )-1;
704 bool FindFileInZIPWithCRC32(const char * zipFile
, uint32_t crc
)
706 FILE * zip
= fopen(zipFile
, "rb");
710 WriteLog("FILE: Could not open file '%s'!\n", zipFile
);
716 // Loop through all files in the zip file under consideration
717 while (GetZIPHeader(zip
, ze
))
725 fseek(zip
, ze
.compressedSize
, SEEK_CUR
);
734 // Parse the file type based upon file size and/or headers.
736 uint32_t ParseFileType(uint8_t * buffer
, uint32_t size
)
738 // Check headers first...
741 if (buffer
[EI_CLASS
] == ELFCLASS32
)
743 if (((BigToLittleEndian16(((Elf32_Ehdr
*)buffer
)->e_machine
) & 0xFF) == EM_68K
) && (BigToLittleEndian16(((Elf32_Ehdr
*)buffer
)->e_type
) == ET_EXEC
) && (buffer
[0] == ELFMAG0
) && (buffer
[1] == ELFMAG1
) && (buffer
[2] == ELFMAG2
) && (buffer
[3] == ELFMAG3
))
748 if (buffer
[0] == 0x60 && buffer
[1] == 0x1B)
749 return JST_ABS_TYPE1
;
752 if (buffer
[0] == 0x01 && buffer
[1] == 0x50)
753 return JST_ABS_TYPE2
;
755 // Jag Server & other old shite
756 if (buffer
[0] == 0x60 && buffer
[1] == 0x1A)
758 if (buffer
[0x1C] == 'J' && buffer
[0x1D] == 'A' && buffer
[0x1E] == 'G')
759 return JST_JAGSERVER
;
761 return JST_WTFOMGBBQ
;
764 // And if that fails, try file sizes...
766 // If the file size is divisible by 1M, we probably have an regular ROM.
767 // We can also check our CRC32 against the internal ROM database to be sure.
768 // (We also check for the Memory Track cartridge size here as well...)
769 if ((size
% 1048576) == 0 || size
== 131072)
772 // If the file size + 8192 bytes is divisible by 1M, we probably have an
773 // Alpine format ROM.
774 if (((size
+ 8192) % 1048576) == 0)
782 // Check for universal header
784 bool HasUniversalHeader(uint8_t * rom
, uint32_t romSize
)
790 for(int i
=0; i
<8192; i
++)
791 if (rom
[i
] != universalCartHeader
[i
])
801 Stubulator ROM vectors...
802 handler 001 at $00E00008
803 handler 002 at $00E008DE
804 handler 003 at $00E008E2
805 handler 004 at $00E008E6
806 handler 005 at $00E008EA
807 handler 006 at $00E008EE
808 handler 007 at $00E008F2
809 handler 008 at $00E0054A
810 handler 009 at $00E008FA
811 handler 010 at $00000000
812 handler 011 at $00000000
813 handler 012 at $00E008FE
814 handler 013 at $00E00902
815 handler 014 at $00E00906
816 handler 015 at $00E0090A
817 handler 016 at $00E0090E
818 handler 017 at $00E00912
819 handler 018 at $00E00916
820 handler 019 at $00E0091A
821 handler 020 at $00E0091E
822 handler 021 at $00E00922
823 handler 022 at $00E00926
824 handler 023 at $00E0092A
825 handler 024 at $00E0092E
826 handler 025 at $00E0107A
827 handler 026 at $00E0107A
828 handler 027 at $00E0107A
829 handler 028 at $00E008DA
830 handler 029 at $00E0107A
831 handler 030 at $00E0107A
832 handler 031 at $00E0107A
833 handler 032 at $00000000
835 Let's try setting up the illegal instruction vector for a stubulated jaguar...
837 SET32(jaguar_mainRam, 0x08, 0x00E008DE);
838 SET32(jaguar_mainRam, 0x0C, 0x00E008E2);
839 SET32(jaguar_mainRam, 0x10, 0x00E008E6); // <-- Should be here (it is)...
840 SET32(jaguar_mainRam, 0x14, 0x00E008EA);//*/
843 ABS Format sleuthing (LBUGDEMO.ABS):
845 000000 60 1B 00 00 05 0C 00 04 62 C0 00 00 04 28 00 00
846 000010 12 A6 00 00 00 00 00 80 20 00 FF FF 00 80 25 0C
849 DRI-format file detected...
850 Text segment size = 0x0000050c bytes
851 Data segment size = 0x000462c0 bytes
852 BSS Segment size = 0x00000428 bytes
853 Symbol Table size = 0x000012a6 bytes
854 Absolute Address for text segment = 0x00802000
855 Absolute Address for data segment = 0x0080250c
856 Absolute Address for BSS segment = 0x00004000
859 000000 01 50 00 03 00 00 00 00 00 03 83 10 00 00 05 3b
860 000010 00 1c 00 03 00 00 01 07 00 00 1d d0 00 03 64 98
861 000020 00 06 8b 80 00 80 20 00 00 80 20 00 00 80 3d d0
863 000030 2e 74 78 74 00 00 00 00 00 80 20 00 00 80 20 00 .txt (+36 bytes)
864 000040 00 00 1d d0 00 00 00 a8 00 00 00 00 00 00 00 00
865 000050 00 00 00 00 00 00 00 20
866 000058 2e 64 74 61 00 00 00 00 00 80 3d d0 00 80 3d d0 .dta (+36 bytes)
867 000068 00 03 64 98 00 00 1e 78 00 00 00 00 00 00 00 00
868 000078 00 00 00 00 00 00 00 40
869 000080 2e 62 73 73 00 00 00 00 00 00 50 00 00 00 50 00 .bss (+36 bytes)
870 000090 00 06 8b 80 00 03 83 10 00 00 00 00 00 00 00 00
871 0000a0 00 00 00 00 00 00 00 80
873 Header size is $A8 bytes...
875 BSD/COFF format file detected...
877 Symbol Table offset = 230160 ($00038310)
878 Symbol Table contains 1339 symbol entries ($0000053B)
879 The additional header size is 28 bytes ($001C)
880 Magic Number for RUN_HDR = 0x00000107
881 Text Segment Size = 7632 ($00001DD0)
882 Data Segment Size = 222360 ($00036498)
883 BSS Segment Size = 428928 ($00068B80)
884 Starting Address for executable = 0x00802000
885 Start of Text Segment = 0x00802000
886 Start of Data Segment = 0x00803dd0