• 大小: 133KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-13
  • 语言: 其他
  • 标签: VC  

资源简介

一个强大的虚拟机的源代码。虽然是一个OD的插件,但是他实现了完整的虚拟机功能,包括大部分的CPU指令集。学习虚拟机必看

资源截图

代码片段和文件信息

///////////////////////////////////////////////////////////////////////////////
//
//  FileName    :   Assembler.cpp
//  Version     :   0.10
//  Author      :   Luo Cong
//  Date        :   2004-10-28 22:12:03
//  Comment     :   first version started on 2004-10-16
//
///////////////////////////////////////////////////////////////////////////////

#include “StdAfx.h“
#include “OllyMachine.h“
#include “Assembler.h“

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif


#ifndef FatalError
#define FatalError()        m_nStopFlag = 1
#endif

#ifndef AddCodeLen
#define AddCodeLen(x)       m_unCodeLen += (x)
#endif

#ifndef AddOpcode
#define AddOpcode(MneType)  nRetCode = CheckCodeCapacity(1);\
                            OM_PROCESS_ERROR(nRetCode);\
                            m_Code[m_unCodeLen] = m_VM->opcode(MneType);\
                            ++m_unCodeLen
#endif

#ifndef AddCodes
#define AddCodes(Codes len)    nRetCode = CheckCodeCapacity((len));\
                                OM_PROCESS_ERROR(nRetCode);\
                                for (int cidx = 0; cidx < len; ++cidx)\
                                    m_Code[m_unCodeLen++] = (Codes[cidx])
#endif

#ifndef AddModRM
#define AddModRM(ModRm)     nRetCode = CheckCodeCapacity(1);\
                            OM_PROCESS_ERROR(nRetCode);\
                            m_Code[m_unCodeLen] = (unsigned char)(ModRm);\
                            ++m_unCodeLen
#endif

#ifndef Add1LCode
#define Add1LCode(lValue)   nRetCode = CheckCodeCapacity(4);\
                            OM_PROCESS_ERROR(nRetCode);\
                            *(long *)&m_Code[m_unCodeLen] = (lValue);\
                            m_unCodeLen += 4
#endif

static const unsigned char g_uchar_bits_lookup_tbl[255] =
{
    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 // 0 ~ 15
    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 // 16 ~ 31
    0 0 0 0 0 0 0 0 0 0 16 16 0 16 0 0 // 32 ~ 47
    8 8 8 8 8 8 8 8 8 8 0 0 0 0 0 0 // 48 ~ 63
    0 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 // 64 ~ 79
    2 2 2 2 2 2 2 2 2 2 2 0 0 0 0 0 // 80 ~ 95
    0 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 // 96 ~ 111
    4 4 4 4 4 4 4 4 4 4 4 0 0 0 0 0 // 112 ~ 127
    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 // 128 ~ 143
    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 // 144 ~ 159
    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 // 160 ~ 175
    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 // 176 ~ 191
    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 // 192 ~ 207
    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 // 208 ~ 223
    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 // 224 ~ 239
    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0     // 240 ~ 255
};

#define UC_LETTER_MASK      (1 << 1)    // upper letter
#define LC_LETTER_MASK   

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      26536  2004-06-29 08:26  OM_src_0.20\COPYING

     文件       1878  2005-01-19 23:55  OM_src_0.20\doc\howto_cn.txt

     文件       2084  2005-01-19 23:55  OM_src_0.20\doc\howto_en.txt

     文件      38620  2004-07-12 14:34  OM_src_0.20\Ollydbg.lib

     文件       4487  2004-12-01 19:04  OM_src_0.20\OllyMachine.dsp

     文件     232448  2003-10-17 15:46  OM_src_0.20\OllyMachine.ncb

     文件       6779  2006-06-03 15:49  OM_src_0.20\OllyMachine.vcproj

     文件      63927  2004-12-07 17:27  OM_src_0.20\src\Assembler.cpp

     文件      10282  2004-12-07 12:44  OM_src_0.20\src\Assembler.h

     文件      31419  2004-12-07 14:31  OM_src_0.20\src\OllyMachine.cpp

     文件       1095  2004-12-07 13:33  OM_src_0.20\src\OllyMachine.h

     文件      91289  2004-10-24 01:53  OM_src_0.20\src\Plugin.h

     文件        213  2004-10-28 21:59  OM_src_0.20\src\StdAfx.cpp

     文件       2066  2004-11-25 13:30  OM_src_0.20\src\StdAfx.h

     文件     111064  2004-12-07 17:27  OM_src_0.20\src\VM.cpp

     文件      25354  2004-12-07 12:31  OM_src_0.20\src\VM.h

     文件        130  2003-10-17 12:09  OM_src_0.20\virtualMachine.vpw

     文件       1130  2003-10-17 12:12  OM_src_0.20\virtualMachine.vpwhist

    ..AD...         0  2006-07-02 14:46  OM_src_0.20\doc

    ..AD...         0  2006-06-02 18:11  OM_src_0.20\src

    ..AD...         0  2003-10-17 12:12  OM_src_0.20

----------- ---------  ---------- -----  ----

               651019                    22


评论

共有 条评论