#version $50 #reserve 6 #copyright "Dump.cmd Copyright 1995 K-Products" #address $7000 #include runtime.h #include bbs_pro.h #define DISK 4 int offset, size; char buffer [8]; main() { offset = 0; cr_lf(); if (length(parm1) == 0) { echose("Usage: DUMP [Dx:path]filename.ext"); return; } header(); MIOsuspend(); close (DISK); if (open(DISK, parm1, 4, 0) != OK) { MIOresume(); echose("Unable to find that file..."); return; } aborted = 0; do { MIOsuspend(); size = blockread (DISK, buffer, 8); MIOresume(); if (size == 0) break; dump_chunk (); offset = offset + size; } while (IOresult(DISK) == OK && aborted == 0); MIOsuspend(); close (DISK); MIOresume(); cr_lf(); if (aborted) { echose("Aborted..."); cr_lf(); } return; } header() { echose ("BBS Express! Pro Dump v5.0"); echose (" (c) 1995 K-Products"); cr_lf(); echos ("File: "); echose (parm1); cr_lf(); } hexbyte (char c) { char hexdig [20]; strcpy(hexdig,"0123456789ABCDEF"); echo (hexdig [c >> 4 + 1]); echo (hexdig [c & $0f + 1]); } hexword (CARD i) { hexbyte(i >> 8); hexbyte(i & $ff); } putchar (char c) { if (c == 155 || c = '\' || c = 125) { echo ('.'); return; } if (trans == 0) { /* ATASCII mode */ echo (27); echo (c); return; } if (c >= ' ' && c <= 'z') /* ASCII mode */ echo (c); else echo ('.'); } dump_chunk () { int i; HexWord( offset ); echo (' '); for (i=0; i