home *** CD-ROM | disk | FTP | other *** search
/ Home Edutainment Collection 4: Games & Extensions / Aztech-HomeEdutainmentCollection-Vol4-3DGamesExtensions.iso / dhacked / dehack1.bas < prev    next >
BASIC Source File  |  1994-06-13  |  3KB  |  78 lines

  1. ' DEHACK - Doom Exe HACK
  2. ' by Matt Fell (matt.burnett@acebbs.com)
  3. ' written 3/17/94, last revised 6/13/94
  4. '
  5. ' DEHACK 1 - The text strings which form the first part of the data segment.
  6. '
  7. ' These crude programs extract information from the DOOM.EXE or DOOM.WAD
  8. ' files and store it into a TXT file, suitable for perusing or printing.
  9. ' If you want to print the results, you might have to reformat it. Please
  10. ' don't waste reams of paper. Thanks.
  11. ' All of these only work on the 1.2 registered doom.exe, because I use
  12. ' simple byte offset numbers, not search strings.
  13. '
  14. ' IMPORTANT: If you don't like typing pathnames, modify the next section,
  15. ' un-comment it, and remove or comment-out the input section.
  16.  
  17. ' infile$ = "c:\doom\doom.exe"
  18. ' outfile$ = "c:\-\doom\12\dehack1.txt"
  19.  
  20. CLS
  21. PRINT "Enter the full pathname to your DOOM.EXE file, then the full pathname"
  22. PRINT "to where you want the textfile to be (in an already existing directory)"
  23. PRINT "e.g. 'c:\doom\doom.exe' and 'c:\doom\txt\dehack1.txt'"
  24. PRINT "Note: modify the program with built-in pathnames, and skip this!"
  25. PRINT
  26. INPUT infile$
  27. INPUT outfile$
  28.  
  29. OPEN infile$ FOR BINARY AS 1
  30. OPEN outfile$ FOR OUTPUT AS 2
  31.  
  32. DIM byte AS STRING * 1
  33.  
  34. PRINT #2, "List of text strings in DOOM.EXE version 1.2 2-17-94"
  35. PRINT #2, "List-making program was written by Matt Fell (matt.burnett@acebbs.com)"
  36. PRINT #2, "=========================================================================="
  37. PRINT #2, "The columns are: 1. decimal offset in doom.exe to start of text string"
  38. PRINT #2, "                 2. decimal offset from 455700 (start of data segment)"
  39. PRINT #2, "                 3. length of string in bytes. '00' marks string end"
  40. PRINT #2, "                 4. hexadecimal offset"
  41. PRINT #2, "                 5. hex offset from $6f414"
  42. PRINT #2, "                 6. hex length of entry"
  43. PRINT #2, "On the second line starts the text of the string. Extra/blank lines"
  44. PRINT #2, " indicate the presence of $0a and/or $0d in the string."
  45. PRINT #2, "=========================================================================="
  46.  
  47. offset& = 455701
  48.  
  49. anotherstring:
  50.  
  51. inc% = 0
  52. l% = 0
  53. entryname$ = ""
  54. byte$ = ""
  55. DO
  56.         GET #1, offset& + inc%, byte$
  57.         IF ASC(byte$) = 0 THEN EXIT DO
  58.         entryname$ = entryname$ + byte$
  59.         l% = l% + 1
  60.         inc% = inc% + 1
  61. LOOP
  62.       
  63. PRINT #2, USING "######"; offset& - 1;
  64. PRINT #2, " ",
  65. PRINT #2, USING "######"; offset& - 455701;
  66. PRINT #2, " ",
  67. PRINT #2, USING "####"; l%;
  68. PRINT #2, " ",
  69. PRINT #2, HEX$(offset& - 1),
  70. PRINT #2, HEX$(offset& - 455701),
  71. PRINT #2, HEX$(l%)
  72. PRINT #2, entryname$
  73.  
  74. offset& = offset& + 4 * (INT(l% / 4) + 1)
  75. IF offset& > 471370 THEN END
  76. GOTO anotherstring
  77.  
  78.