⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 program.cpp

📁 Decompilation Dos Program is a technique that allows you to recover lost source code. It is also nee
💻 CPP
字号:
/*---------------------------------------------------------------------------*/
// DisC Decompilation Wizard
// written by
// Satish Kumar S
// satish@miel.mot.com
//
// Copyright 1999-2001 Satish Kumar S
//
// Permission is granted to use this software for research purposes as
// long as this notice stays attached to this software.
/*---------------------------------------------------------------------------*/
#include <dos.h>
#include <dir.h>
#include "Program.h"
Program::Program()
{
  CodeSegment = 0;
  DataSegment = 0;
}
Program::~Program()
{
  if (CodeSegment) freemem(CodeSegment);
  if (DataSegment) freemem(DataSegment);
  CodeSegment = 0;
  DataSegment = 0;
}
Byte far *Program::GetCodePtr()
{
  return (Byte far *)MK_FP(CodeSegment,0);
}
Dword Program::GetCodeSize()
{
  return Size;
}
Byte far *Program::GetDataPtr()
{
  return (Byte far *)MK_FP(DataSegment,0);
}
int Program::Load(char *FileName)
{
  if (CodeSegment)
    Program::~Program();

  struct ffblk ffblk;
  if (findfirst(FileName, &ffblk, 0x17) == -1)
    return 1;
  Size = ffblk.ff_fsize;

  if (allocmem( (Size/16)+1, (unsigned *)&CodeSegment) != -1)
    return 2;

  union REGS regs;
  struct SREGS sregs;
  Word ParamBlock[2];
  ParamBlock[0] = CodeSegment;
  ParamBlock[1] = CodeSegment;

  regs.x.ax = 0x4b03;
  sregs.ds  = FP_SEG((void far *)FileName);
  regs.x.dx = FP_OFF((void far *)FileName);
  sregs.es  = FP_SEG((void far *)ParamBlock);
  regs.x.bx = FP_OFF((void far *)ParamBlock);
  int86x(0x21,&regs,&regs,&sregs);
  if (regs.x.cflag == 1)
  {
    Program::~Program();
    return 3;
  }
  return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -