?? program.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,®s,®s,&sregs);
if (regs.x.cflag == 1)
{
Program::~Program();
return 3;
}
return 0;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -