Linux汇编调试器EDB 2008-08-28 10:06:23   http://www.codef00.com/projects

分类: LINUX

  • Home
  • About Me
  • Projects
  • Coding
  • Links
  • Blog
www.codef00.com :: Projects

Projects

Here is a list of some of the projects I am either currently worked on, or just liked enough to mention :). This list will be expanded in the future since I tend to pick up new projects all the time.

  • Debugger
  • QGMailNotifier
  • evanOS
  • Pretendo
  • Fakestation
  • RPG Engine
  • RPG Script
  • libunif
  • QHexView
  • edisassm

Debugger – Download Here – 0.9.4

I have recently noticed that the current version of EDB will fail to build on some platforms such as Fedora Core 6. This is due to the lack of QTs QT_ARCH variable and can be worked around by running qmake or qmake-qt4 with "QT_ARCH=i386" or "QT_ARCH=x86-64" as a parameter.

I am happy to announce that version 0.9.4 of EDB is available under the GPL-2 license for download! This version supports x86 and x86-64 architectures. Please give it a try and let me know what I can do to improve it. Documentation is pretty much non-existant, but that's one of the reasons why this is not a 1.0 release :). Remember to read the README file, it has a lot of information, and please check the bugzilla before asking about a missing feature, it may already be in the works. Enjoy!

I do a lot of work analyzing applications which I do not have the source code for. On Windows, OllyDbg is the tool of choice, but there is no Linux (or any other *nix) equivalent that I could find. Sure we have GDB, but GDB and all it's various frontends tend to lean towards debugging applications to which we have the source. What I really want is a debugger which is as functional and useable as OllyDbg but for Linux (and possibly more). So I started my own debugger which is currently based on the ptrace API, and it is coming along very nicely. The hex dump views are based on the QHexView I developed which gives things a very polished look.

One of the main goals of this debugger is modularity. The interface is written in QT4 and thus source portable to many platforms. The debugger core is a plugin and the platform specific code is isolated to just a few files, porting to a new OS would require porting these few files and implementing a plugin which implements the "DebuggerCoreInterface" interface. Also, because the plugins are based on the QPlugin API, and do their work through the DebuggerCoreInterface object, they are almost always portable with just a simple recompile.

Bugs & requests are now tracked in bugzilla set up at http://bugs.codef00.com. Please post any bugs you find or features you would like me to try to implement there.

The disassembly engine is based on my edisassm project. I feel that this disassembler is mature and works well. It is worth noting that the current version has temporarily dropped AT&T syntax support. Once this is implemented in edisassm, it will return.

I have produced an ebuild for all you gentoo users out there. The easiest way to use it is to do the following (as root):

mkdir -p /usr/local/portage/edb/dev-util/edb/
cp edb-0.9.4.ebuild /usr/local/portage/edb/dev-util/edb/
echo PORTDIR_OVERLAY="${PORTDIR_OVERLAY} /usr/local/portage/edb" >> /etc/make.conf
cd /usr/local/portage/edb/dev-util/edb/
ebuild edb-0.9.4.ebuild digest
ACCEPT_KEYWORDS=~x86 emerge -a dev-util/edb

Features

  • Intuitive GUI interface
  • The usual debugging operations (step-into/step-over/run/break)
  • Conditional breakpoints
  • Debugging core is implemented as a plugin so people can have drop in replacements. Of course if a given platform has several debugging APIs available, then you may have a plugin that implements any of them.
  • Basic instruction analysis
  • View/Dump memory regions
  • Effective address inspection
  • The data dump view is tabbed, allowing you to have several views of memory open at the same time and quickly switch between them.
  • Importing of symbol maps
  • Plugins
    • Search for binary strings
    • Code Bookmarks
    • Breakpoint management
    • Check for updates
    • Environment variable viewer
    • Heap block enumeration
    • Opcode search engine plugin has basic functionality (similar to msfelfscan/msfpescan)
    • Open file enumeration
    • Reference finder
    • String searching (like strings command in *nix)
    • Hardware Breakpoints

Some screen shots...

QGMailNotifier

Download Version 2008.3 Here

I love using GMail and on both Windows and MacOSX there is a wonderful simple program called Gmail Notifier. Unfortunately, there is no *nix port. To fill the gap there are a few work-alikes out there. But for me, none of them fit the bill. The closest to meeting my needs was kcheckgmail. But that one actually logs into the page and parses the data, which makes it very brittle and prone to breakage every time google updates their pages. QGMailNotifier uses the GMail RSS feed to get it's data.

So, I've developed my own QT4 based notifier which works very similarly to the Windows version. I've added a few things here and there, and plan to add some cool things in the future such as: multiple account support, kde wallet support and more methods of notification.

For now, it is simple and works well :). I've created an ebuild for anyone who wants to try it, the only dependancy is QT >= 4.3.0.

I have produced an ebuild for all you gentoo users out there. The easiest way to use it is to do the following (as root):

mkdir -p /usr/local/portage/qgmailnotifier/mail-client/qgmailnotifier/
cp qgmailnotifier-2008.3.ebuild /usr/local/portage/qgmailnotifier/mail-client/qgmailnotifier/
echo PORTDIR_OVERLAY="${PORTDIR_OVERLAY} /usr/local/portage/qgmailnotifier" >> /etc/make.conf
cd /usr/local/portage/qgmailnotifier/mail-client/qgmailnotifier/
ebuild qgmailnotifier-2008.3.ebuild digest
ACCEPT_KEYWORDS=~x86 emerge -a mail-client/qgmailnotifier

evanOS

This is my operating system. It is written in c++ with a tiny bit of assembly. My primary goal is to make a usable and useful operating system where it is truly designed from the ground up to secure and flexible. Generally, its design is influenced by a few Operating Systems. I plan to have a UNIX like filesystem, which will have the notion of "devices are files" but devices will live in there own namespace. For example, the first hard disk will be available as: "Device:/HardDisk/0" and will not be normally part of the actual filesystem. However, a user will be able to reproduce a UNIX like /dev by mounting "Device:/" to "/dev."

Also, I plan to have the normal way of creating processes somewhat like Win32, and not use fork/execve. I do however plan to have fork/execve available in order to increase compatibility the vast library of existing UNIX applications.

It currently runs in protected mode, supports multiple processes/threads, semaphores, mutexes, monitors, ATA hard disk access with preliminary ext2/3 reading support, and a few other cool things. I have been trying to implement in as logical a way as possible, the entire c++ standard library in kernel space. This way I can test and validate a lot of code in user space before jamming it into my kernel code. Also it allows me to reuse standard code for things like containers which are already have correct implementation. Finally the use of safe containers such as std::string will help greatly in the reduction of possibly insecure code. Once it moves along a bit more, I'll start posting source code so that if anyone is interested they can take a peek at what I'm up to :)

I have successfully added user mode processes, v8086 tasks, and the ability to load simple statically linked ELF binaries off disk and run them! Also, I have implemented switching to 32-bit graphical modes using a VESA driver implemented through v8086 tasks. It also has a somewhat functional mouse (a box which moves around and changes colour when you click). Once I finalize my IPC API, then I can begin work on a real GUI which will in user space.

I also may choose to fork off the evanOS-libc and evanOS-libstdc++ into seperate projects for people to use as well. The libc is pretty close to being complete and I'd call the libstdc++ 80%, usable but still missing some large pieces.

Some screen shots for your viewing pleasure...

Pretendo

Pretendo is a NES emulator. As per usual, it was written in c++ (my favorite language, can't you tell?) by me and my friend Eli Dayan. It was designed to be portable so it is already able to be compiled on Windows, BeOS/Zeta, Solaris and Linux (there is no real reason why it couldn't be built on any system which has SDL and QT as well), a Macintosh port may be done in the foreseeable future. This will probably depend on if I get one of those cool new Mac Minis...they are pretty bad ass. Here are some screen shots for you to take a gander. After discussing Pretendo with Eli, we both agree that we will in fact open source the emulator, but only after it is in a state where we feel happy with it, until then, binary only releases. It is a fairly fast emulator, but we are still looking to make it faster. (At the moment it get about 650 FPS on my laptop which is a 2.0GHz Centrino). Currently it sports a pretty wide feature set which includes:

  • Uses native APIs for video and sound when available (Win32, BeOS/Zeta)
  • Uses SDL for video/sound and QT for GUI on UNIX targets (command line GUI in works as well)
  • A pretty accurate sound system
  • A functional debugger
  • Good mapper support (0, 1, 2, 3, 4, 5, 7, 9, 10, 11, 15, 19, 23, 32, 33, 40, 41, 64, 66, 68, 69, 71, 118, 240, 245)
  • UNIF support
  • Fullscreen and Windowed video modes
  • Adjustable palette
  • Pattern Table Viewer (Tile Viewer)
  • Name Table Viewer
  • In memory IPS patches, this allows a ROM patch to be applied without modifying the original ROM file. If the user tells the interface to load an IPS file, Pretendo will load a .nes file of the same name from the same directory and then apply the patch automatically. This removes the need for storing the result of a patch on disk, and hopefully will cut down on hacks in people's ROM collections
  • And a few things I'm probably forgetting

Binaries will be available on a "once they are ready" basis. We are in no rush to get yet another release out the door. We are currently focusing on code quality, emulation accuracy, and being full featured.

Fakestation

This is my PSX emulator. Currently it really isn't much more than the CPU core and debugger with little tidbits of PSX specific extras. It will currently boot the BIOS just fine. Unlike other emulators, the goal of this one really isn't speed or playability, but more good design and clean code (which may result in speed/playability). What this means is that the code makes a lot of use of templates, classes, and very thought out design. For example, I noticed that many (all?) open source PSX emulators implement memory in a way which just seems weird to me. They tend to implement the memory code literally 3 times, once time for each of 8-bit, 16-bit and 32-bit read/writes. This in my opinion is rather silly, in the real hardware I don't think there is anything stopping you from using a 32-bit write to write to an address which represents an 8-bit port, even if it is considered a programming error. Plus there is the fact that it's annoying to manage 3 copies of the code. So my approach is the use templates and write it once. Then in the code I enforce alignment requirements of the CPU to make sure everything ends up being correct. The result is smaller and easier to follow code. I'll probably post some source soon.

RPG Engine

This one is one of my current favorites. I am building a Final Fantasy 3 (Final Fantasy 6 in Japan) style RPG Engine. It is top down and tile driven in classic RPG style. The cool part is that pretty much every part of the games made are driven by my C like scripting language developed specifically for this engine. Everything from stepping onto an event tile (think doors/stairs/damage tile/etc) to talking to an NPC triggers a function call in the script. This allows every aspect of the plot of the game to be written outside the engine, making it more than just an engine, but an RPG creation engine. I have also developed a mostly functional map editor which currently is used to aid in development of the main game engine, but it will likely be part of a "suite" of programs which make up the creation engine.

Here's some nice screenshots for anyone curious, click on them for larger versions.

Note: I am not an artist, so many if not all of the graphics are "borrowed" from other RPGs I have found on the internet. I will be posting a list of sources as soon as I find all the relevant URLs. If you would like to know the source of a given image, please feel free to contact me.

Ok, I found the program where i got my tiles from, they are from an RPG project known as O.H.R.R.P.H.C.E.. A very good RPG system, with a very fun wacky sense of humor to it.

RPG Script

This is the c like scripting language that I made to drive the event system in my RPG. It is a nice small, yet efficient engine written in c++. It is still a work in progress, and a little messy under the hood, but proves to be very useful for my RPG.

The language was originally loosely based on code found in "C: The Complete Reference", but has been expanded on, re-written and improved very much. My implementation included features such as:

  • Assignment to variables during declaration
  • Detection of duplicate functions
  • Combination assignment and modification operators (ex. +=)
  • Binary operations (ex: int a = b | c;)
  • Proper block level scoping for local variables (they are destroyed when the enclosing block is ended, not just function return
  • "else if" support
  • Vastly more complete syntax checking
  • Pre-tokenization of the program for improved execution speed, this also allows a future version to save this tokenized version and load it for execution. The goal being that you don't have to make your scripts open source.
  • Several other features I am failing to recall right now...

You can download a copy with my RPG functions trimmed out here.

libunif

This library is related to my NES emulator Pretendo. Basically around 2000/2001 there was a bit of a movement in the NES development community to have a more accurate and proper game cart backup format. .NES (the popular format) is very limited and constantly has needed hacks to the format. So UNIF came along and personally I think it is in fact a much better format. As for if it did/will catch on, who knows. Regardless, this is a library I made which makes loading UNIF and .NES files pretty trivial. It also has an example program which will convert from .NES to UNIF (though it does need a little user input). The code can be found here. And the documentation can be found here.

QHexView

This is a reusable QT4 widget made to display data in traditional hex editor style. The ASCII column is optional, and many visual aspects are adjustable, such as font and font size. I originally considered reusing the widget made for KHexEdit, but it really seemed like it is bit too tightly coupled with the rest of the application. So I developed this widget by building on top of the QAbstractScrollView. The look at feel of the widget is based on KHexEdit, but is a standalone close that depends on nothing more than the QT library itself. Currently it only supports read-only operations, but is still in active development. Future plans including:

  • Byte pattern searching (related to debugger feature)
  • Allowing the data to come from an input stream (allowing viewing of files trivially)
  • Write operations

At the moment, QHexView is available in the src/widgets subdirectory of my Debugger project. To use it, you simply need to redefine the two types which are the first public members of the class: C, which is a container expected to have a readable vector like interface (QVector works nicely) and address_t, which represents an address, likely a uint32_t will work perfect.

edisassm - Download Here - 1.5.4

My Debugger (EDB) has recently spawned off a side project. I am no longer satisfied with libdisasm as the disassembler engine for EDB. It is a stagnant project and only supports i386. Because of this I have started my own object oriented disassembly API which will be the future basis for EDB's disassembly. It can decode all of the i386/EMT64 instruction set including MMX, and the various SSE instructions sets (SSE/SSE2/SSE3/SSSE3). The tables are based on the latest documentation for the Intel EMT-64 and IA-32 architecutures. Version 1.5.4 is the first version to support 64-bit instructions and is available for download!

Usage is very simple and included in this package is edisassm.cpp which demonstrates a simple disassembler.

Linux汇编调试器EDB相关推荐

  1. 开源项目-基于Intel VT技术的Linux内核调试器

    本开源项目将硬件虚拟化技术应用在内核调试器上,使内核调试器成为VMM,将操作系统置于虚拟机中运行,即操作系统成为GuestOS,以这样的一种形式进行调试,最主要的好处就是调试器对操作系统完全透明.如下 ...

  2. 基于IntelVt技术的Linux内核调试器 - 2

    4 基于IntelVt技术的Linux内核调试器- 调试器设计与实现(2):调试核心 4.1反汇编引擎 如果说调试框架是一个调试器的灵魂,那么接口与反汇编引擎就是一个调试器的身体.我们在调试过程中是要 ...

  3. Linux下调试器工作原理

    Linux下调试器工作原理之一-基础篇 介绍关于Linux下的调试器实现的主要组成部分--ptrace系统调用.本文中出现的代码都在32位的Ubuntu系统上开发.请注意,这里出现的代码是同平台紧密相 ...

  4. Linux 内核调试器 调试指南

    Linux 内核调试器内幕 KDB 入门指南 Hariprasad Nellitheertha (nharipra@in.ibm.com), 软件工程师, IBM 简介: 调试内核问题时,能够跟踪内核 ...

  5. wow_32_64 汇编调试器/注入器/汇编指令书写神器 V1.7

    工具为方便自己书写汇编代码而出的一款由文本汇编转换机器指令的工具 工具由x64dbg开源引擎解析,由易语言编译,工具无联网和恶意行为,不能理解的务下 如果你喜欢书写汇编却还在为动态调试器上面改写汇编而 ...

  6. Linux下调试器GDB的简单使用图解

    gdb是一个由GNU开源组织发布的.UNIX/LINUX操作系统下的.基于命令行的.功能强大的程序调试工具. 当前是虚拟机上的Ubuntu系统:敲Ctrl+Alt+t,打开控制台终端: which g ...

  7. linux内核调试器ftrace使用

    本文的实验是在ubuntu(内核版本3.19.0)上运行的. ftrace原理 ftrace是一个追踪器框架,其中一个强大的追踪器就是函数追踪器(即函数的调用过程).它使用gcc的-pg选项让内核中的 ...

  8. Linux gdb调试器

    gdb的启动 --gdb 程序名 [corefile] --corefile是可选的,但能增强gdb的调试能力 --强调:启动gdb必须在编译命里加上"-g"参数,"-g ...

  9. 椒图加固软件linux说明书,【椒图科技】Linux内核调试器 - 安全牛课堂 - 领先的信息安全在线教育平台...

    { "i18nChapterName": "章", "i18nUnitName": "节", "i18nLes ...

  10. linux静态反汇编工具,27款反汇编/调试器/静态和动态分析工具

    原标题:27款反汇编/调试器/静态和动态分析工具 本文从github上收集了27款实用的反汇编.调试器.静态和动态分析工具,文中的工具在<Awesome Windows Exploitation ...

最新文章

  1. 谭浩强《C++程序设计》书后习题 第十三章-第十四章
  2. 张北将成规模150万台服务器的云计算产业基地
  3. Linux C定时器使用指南
  4. tomcat8+在maven中热部署
  5. thinkphp删除某一学生_基于ThinkPHP实现批量删除
  6. 曲线的生成算法实现_PCGPlanet1-地形生成算法简介
  7. Kubernetes:通过自动化节省IT预算的4种方法
  8. 窦学计算机基础期末考试,关于新生开学考计算机基础
  9. 【Python】Python3.7.3 - sys.path 模块搜索路径详解
  10. c++ loadlibrary 初始化对象_C++构造函数和初始化表
  11. excel生成趋势线和函数关系式
  12. Android实现汤姆猫小游戏
  13. linux安装无头浏览器
  14. matlab 注释多行方法
  15. Markdown基本语法
  16. 【Python入门教程】第35篇 查找元素的位置
  17. 看英语数据手册很难?5步帮你搞定!
  18. 荒野乱斗好友系统分析
  19. 《五种时间:重建人生秩序》读书笔记
  20. PageRank算法 -- 图算法

热门文章

  1. ab753变频器参数怎么拷贝到面板_20款常用变频器密码,想成为电工老师傅你一定需要,纯干货分享!...
  2. 游戏开发之动态创建对象及构造函数、析构函数的执行(C++基础)
  3. MPLS virtual private network PE-CE之间的路由协议(BGP)
  4. 日常工作中,个人总结的 - Git - 常用操作方法 (三)
  5. 彻底剖析C# 2.0泛型类的创建和使用
  6. Java loadlibrary分析及如何unload
  7. [LeetCode]50.Pow(x, n)
  8. 华为ADSL路由设置
  9. mysql one database_MYSQL学习笔记one
  10. 接入TapTap防沉迷系统的逻辑图