Giter Site home page Giter Site logo

samunders-core / le_disasm Goto Github PK

View Code? Open in Web Editor NEW
18.0 18.0 5.0 67 KB

libopcodes-based (AT&T syntax) linear executable (MZ/LE/LX DOS EXEs) disassembler modified from http://swars.vexillium.org/files/swdisasm-1.0.tar.bz2

License: GNU General Public License v3.0

C++ 95.27% C 4.73%

le_disasm's People

Contributors

klei1984 avatar samunders-core avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

le_disasm's Issues

Compilation error under Arch Linux

Hello,

Compiling le_disasm under Arch Linux produces the following error:

In file included from /usr/local/include/dis-asm.h:35,
                 from dis_info.h:4,
                 from analyzer.h:13,
                 from print.h:4,
                 from main.cpp:3:
/usr/local/include/bfd.h:35:2: error: #error config.h must be included before this header
 #error config.h must be included before this header
  ^~~~~
In file included from dis_info.h:4,
                 from analyzer.h:13,
                 from print.h:4,
                 from main.cpp:3:
/usr/local/include/dis-asm.h: In function ‘const char* next_disassembler_option(const char*)’:
/usr/local/include/dis-asm.h:298:21: error: ‘strchr’ was not declared in this scope
   const char *opt = strchr (options, ',');
                     ^~~~~~
/usr/local/include/dis-asm.h:298:21: note: ‘strchr’ is defined in header ‘<cstring>’; did you forget to ‘#include <cstring>’?
/usr/local/include/dis-asm.h:36:1:
+#include <cstring>
 
/usr/local/include/dis-asm.h:298:21:
   const char *opt = strchr (options, ',');
                     ^~~~~~
In file included from analyzer.h:13,
                 from print.h:4,
                 from main.cpp:3:
dis_info.h: In member function ‘void DisInfo::disassemble(uint32_t, const void*, size_t, Insn&)’:
dis_info.h:26:14: error: ‘print_insn_i386_att’ was not declared in this scope
   int size = print_insn_i386_att(addr, this);
              ^~~~~~~~~~~~~~~~~~~
dis_info.h:26:14: note: suggested alternative: ‘print_insn_rl78_g14’
   int size = print_insn_i386_att(addr, this);
              ^~~~~~~~~~~~~~~~~~~
              print_insn_rl78_g14

This can be silenced by adding the following lines into main.cpp:

#include <cstring>
#define PACKAGE

and this line in dis_info.h:

int print_insn_i386_att (bfd_vma pc, disassemble_info *info);

However, linkage does fail with the following error:

/usr/local/bin/ld: ./main.o: in function `DisInfo::disassemble(unsigned int, void const*, unsigned long, Insn&)':
/home/marespiaut/code/le_disasm/dis_info.h:28: undefined reference to `print_insn_i386_att(unsigned long, disassemble_info*)'
collect2: error: ld returned 1 exit status

I've tried fixing it with no success.

I wonder if print_insn_i386_att can be replaced by something else, as the source code of GNU binutils says that this function is here “for backwards compatibility only”:

/* Here for backwards compatibility.  When gdb stops using
   print_insn_i386_att and print_insn_i386_intel these functions can
   disappear, and print_insn_i386 be merged into print_insn.  */
int
print_insn_i386_att (bfd_vma pc, disassemble_info *info)
{
  intel_syntax = 0;

  return print_insn (pc, info);
}

Best regards.

Help with partial disassemble.

Hi, I'm using this LE disassembler to try and disassemble a DOS/4GW based project. I unbound the LE executable and ran it trough the disassembler, but I ended up with a couple of warnings which lead to undefined references in the assembly code.

The main one being,

Warning: Tried to trace code at an unmapped address: 0x00000f

but similar warnings follow. I was wondering if that happens with more projects you tried to disassemble and what you did to resolve them.

Could it be that DOS/4GW maps a function in lower memory?
Or is this disassembled wrong?

In other cases the unmapped address is way outside the binary so this would suggest some error in the disassembly.

"Not a LE executable" with a MS-DOS exe

I'm trying to use the latest revision of le_disasm with the Threat MS-DOS game, however, the executable header is not correctly parsed:

$ ./le_disasm THREAT.EXE 
stack trace:
  ./le_disasm : Error::Error()+0x5d
  ./le_disasm : Header::throwOnInvalidSignature(std::istream&, unsigned int&)+0x1db
  ./le_disasm : Header::Header(std::istream&, unsigned int&)+0x52
  ./le_disasm : LinearExecutable::LinearExecutable(std::istream&, unsigned int)+0x3a
  ./le_disasm : main()+0xba
  /usr/lib/libc.so.6 : __libc_start_main()+0xf3
  ./le_disasm : _start()+0x2e
Not a LE executable

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.