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

📄 regwnd.c

📁 CC386 is a general-purpose 32-bit C compiler. It is not an optimizing compiler but given that the co
💻 C
📖 第 1 页 / 共 2 页
字号:
/* 
Copyright 2001-2003 Free Software Foundation, Inc.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.  

You may contact the author at:

mailto::camille@bluegrass.net

or by snail mail at:

David Lindauer
850 Washburn Ave Apt 99
Louisville, KY 40222

 **********************************************************************

REGWND.C holds the functionality to handle the register window

 **********************************************************************
 */
#include <windows.h>
#include <commctrl.h>
#include <commdlg.h>
#include <richedit.h>
#include <stdio.h>
#include <ctype.h>

#include "header.h"
#include "operands.h"
#include "opcodes.h"

typedef struct
{
    TCData ptrs;
    int *olddataptr;
    int *currentdataptr;
    HTREEITEM hTreeItem;
    enum
    {
        floating = 1, editable = 2
    } flags;
} REGDATA;

//-------------------------------------------------------------------------


extern HWND hwndSourceTab;
extern HINSTANCE hInstance;
extern HWND hwndClient, hwndStatus, hwndFrame;
extern int childxpos, childypos;
extern PROCESS DebugProcess;
extern enum DebugState uState;
extern HWND hwndTab;
extern THREAD *StoppedThread;

HWND hwndRegister;
static CONTEXT regContext;
static HWND hwndTree;
static char szRegisterClassName[] = "xccRegisterClass";
static char szRegisterTitle[] = "";
static LOGFONT fontdata = 
{
    16, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET,
        OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, FIXED_PITCH |
        FF_DONTCARE, "Courier New"
};
static HWND hwndCtrl;
static HANDLE registerHandle;
static CONTEXT oldContext;
static HBITMAP valueBitmap, itemBitmap;
static char *szRegTitle = "Register Window";

static char xeax[] = "EAX";
static char xebx[] = "EBX";
static char xecx[] = "ECX";
static char xedx[] = "EDX";
static char xesi[] = "ESI";
static char xedi[] = "EDI";
static char xesp[] = "ESP";
static char xebp[] = "EBP";
static char xeip[] = "EIP";
static char xst0[] = "ST0";
static char xst1[] = "ST1";
static char xst2[] = "ST2";
static char xst3[] = "ST3";
static char xst4[] = "ST4";
static char xst5[] = "ST5";
static char xst6[] = "ST6";
static char xst7[] = "ST7";
static char xeflags[] = "EFLAGS";
static char eaxbuf[20];
static char ebxbuf[20];
static char ecxbuf[20];
static char edxbuf[20];
static char esibuf[20];
static char edibuf[20];
static char espbuf[20];
static char ebpbuf[20];
static char eipbuf[20];
static char eflagsbuf[20];
static char st0buf[40];
static char st1buf[40];
static char st2buf[40];
static char st3buf[40];
static char st4buf[40];
static char st5buf[40];
static char st6buf[40];
static char st7buf[40];

static char regst[] = "Arithmetic";
static char control[] = "Control";
static char floatingname[] = "Floating";
static REGDATA regs[] = 
{
    {
        {
             &regst, 0
        }
        , 0, 0, 0, 
    }
    , 
    {
        {
             &xeax, &eaxbuf
        }
        , &oldContext.Eax, &regContext.Eax, 0, editable
    }
    , 
    {
        {
             &xebx, &ebxbuf
        }
        , &oldContext.Ebx, &regContext.Ebx, 0, editable
    }
    , 
    {
        {
             &xecx, &ecxbuf
        }
        , &oldContext.Ecx, &regContext.Ecx, 0, editable
    }
    , 
    {
        {
             &xedx, &edxbuf
        }
        , &oldContext.Edx, &regContext.Edx, 0, editable
    }
    , 
    {
        {
             &xesi, &esibuf
        }
        , &oldContext.Esi, &regContext.Esi, 0, editable
    }
    , 
    {
        {
             &xedi, &edibuf
        }
        , &oldContext.Edi, &regContext.Edi, 0, editable
    }
    , 
    {
        {
             &control, 0
        }
        , 0, 0, 0, 
    }
    , 
    {
        {
             &xesp, &espbuf
        }
        , &oldContext.Esp, &regContext.Esp, 0, editable
    }
    , 
    {
        {
             &xebp, &ebpbuf
        }
        , &oldContext.Ebp, &regContext.Ebp, 0, editable
    }
    , 
    {
        {
             &xeip, &eipbuf
        }
        , &oldContext.Eip, &regContext.Eip, 0, editable
    }
    , 
    {
        {
             &xeflags, &eflagsbuf
        }
        , &oldContext.EFlags, &regContext.EFlags, 0, editable
    }
    , 
    {
        {
             &floatingname, 0
        }
        , 0, 0, 0, 
    }
    , 
    {
        {
             &xst0, &st0buf
        }
        , &oldContext.FloatSave.RegisterArea[0],
            &regContext.FloatSave.RegisterArea[0], 0, editable | floating
    }
    , 
    {
        {
             &xst1, &st1buf
        }
        , &oldContext.FloatSave.RegisterArea[10],
            &regContext.FloatSave.RegisterArea[10], 0, editable | floating
    }
    , 
    {
        {
             &xst2, &st2buf
        }
        , &oldContext.FloatSave.RegisterArea[20],
            &regContext.FloatSave.RegisterArea[20], 0, editable | floating
    }
    , 
    {
        {
             &xst3, &st3buf
        }
        , &oldContext.FloatSave.RegisterArea[30],
            &regContext.FloatSave.RegisterArea[30], 0, editable | floating
    }
    , 
    {
        {
             &xst4, &st4buf
        }
        , &oldContext.FloatSave.RegisterArea[40],
            &regContext.FloatSave.RegisterArea[40], 0, editable | floating
    }
    , 
    {
        {
             &xst5, &st5buf
        }
        , &oldContext.FloatSave.RegisterArea[50],
            &regContext.FloatSave.RegisterArea[50], 0, editable | floating
    }
    , 
    {
        {

⌨️ 快捷键说明

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