wjp / idados Goto Github PK
View Code? Open in Web Editor NEWEric Fry's IDA/DOSBox debugger plugin
Eric Fry's IDA/DOSBox debugger plugin
Hi. Where can I find the file area.hpp? It's not found anywhere (tried with SDK from IDA Pro 7.0 and got nothing). Thank you.
EDIT: appologies, it's not present in IDA 7.0+, it seems.
DOSBox with IDADos debugger can't be built with IDA 6.8 SDK on Linux.
Function prototype in idados/dosbox_debmod.h looks as follows:
virtual int idaapi dbg_attach_process(pid_t process_id, int event_id, int flags);
But it should be the same as in idasdk68/plugins/debugger/debmod.h:
virtual int idaapi dbg_attach_process(pid_t process_id, int event_id) = 0;
Fixing it makes dosbox to compile and run successfully.
Hi
My team and I are currently remaking a classic dos game called OMF 2097 at https://github.com/omf2097/openomf
We are desperately in need of a debugger that can handle the linear executable (LE) format.
We have some knowledge of x86 asm. We are able to reverse engineer about 10% of the omf game binary using only a dissembler. But static analysis isn't enough.
I want to ask how hard is it to add support for LE debugging to idados?
Thank you
It confuses IDA when it's needed to point some offset to dseg.
After pointing to such offset (Alt+R -> dseg), try to double click it. You will jump to seg004 offset. But not at dseg.
You should delete Loader segments, and only use debugger's ones.
Not sure if this is a regression, as I never attempted to build idados before. I followed the IDA instructions for building the SDK. This was a success. I am also able to build the example plugins without any problems. I followed the idados BUILD
instructions and set __MAC__=1
and IDA=<path-to-ida>
, substituting my actual IDA path, of course.
The problem seems to be that the idados build is trying to including headers or building objects that are unnecessary, resulting in a number of redefinition errors:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/signal.h:65:0,
from tcpip.cpp:58:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/sys/_pthread/_pthread_types.h:57:8: error: redefinition of 'struct __darwin_pthread_handler_rec'
struct __darwin_pthread_handler_rec {
^
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/_types.h:27:0,
from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/stdlib.h:63,
from ../../include/pro.h:74,
from tcpip.h:4,
from tcpip.cpp:11:
../../ldr/mach-o/h/sys/_types.h:58:8: error: previous definition of 'struct __darwin_pthread_handler_rec'
struct __darwin_pthread_handler_rec
^
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/signal.h:65:0,
from tcpip.cpp:58:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/sys/_pthread/_pthread_types.h:63:8: error: redefinition of 'struct _opaque_pthread_attr_t'
struct _opaque_pthread_attr_t {
^
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/_types.h:27:0,
from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/stdlib.h:63,
from ../../include/pro.h:74,
from tcpip.h:4,
from tcpip.cpp:11:
../../ldr/mach-o/h/sys/_types.h:64:8: error: previous definition of 'struct _opaque_pthread_attr_t'
struct _opaque_pthread_attr_t { long __sig; char __opaque[__PTHREAD_ATTR_SIZE__]; };
^
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/signal.h:65:0,
from tcpip.cpp:58:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/sys/_pthread/_pthread_types.h:68:8: error: redefinition of 'struct _opaque_pthread_cond_t'
struct _opaque_pthread_cond_t {
^
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/_types.h:27:0,
from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/stdlib.h:63,
from ../../include/pro.h:74,
from tcpip.h:4,
from tcpip.cpp:11:
../../ldr/mach-o/h/sys/_types.h:65:8: error: previous definition of 'struct _opaque_pthread_cond_t'
struct _opaque_pthread_cond_t { long __sig; char __opaque[__PTHREAD_COND_SIZE__]; };
^
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/signal.h:65:0,
from tcpip.cpp:58:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/sys/_pthread/_pthread_types.h:73:8: error: redefinition of 'struct _opaque_pthread_condattr_t'
struct _opaque_pthread_condattr_t {
^
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/_types.h:27:0,
from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/stdlib.h:63,
from ../../include/pro.h:74,
from tcpip.h:4,
from tcpip.cpp:11:
../../ldr/mach-o/h/sys/_types.h:66:8: error: previous definition of 'struct _opaque_pthread_condattr_t'
struct _opaque_pthread_condattr_t { long __sig; char __opaque[__PTHREAD_CONDATTR_SIZE__]; };
^
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/signal.h:65:0,
from tcpip.cpp:58:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/sys/_pthread/_pthread_types.h:78:8: error: redefinition of 'struct _opaque_pthread_mutex_t'
struct _opaque_pthread_mutex_t {
^
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/_types.h:27:0,
from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/stdlib.h:63,
from ../../include/pro.h:74,
from tcpip.h:4,
from tcpip.cpp:11:
../../ldr/mach-o/h/sys/_types.h:67:8: error: previous definition of 'struct _opaque_pthread_mutex_t'
struct _opaque_pthread_mutex_t { long __sig; char __opaque[__PTHREAD_MUTEX_SIZE__]; };
^
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/signal.h:65:0,
from tcpip.cpp:58:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/sys/_pthread/_pthread_types.h:83:8: error: redefinition of 'struct _opaque_pthread_mutexattr_t'
struct _opaque_pthread_mutexattr_t {
^
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/_types.h:27:0,
from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/stdlib.h:63,
from ../../include/pro.h:74,
from tcpip.h:4,
from tcpip.cpp:11:
../../ldr/mach-o/h/sys/_types.h:68:8: error: previous definition of 'struct _opaque_pthread_mutexattr_t'
struct _opaque_pthread_mutexattr_t { long __sig; char __opaque[__PTHREAD_MUTEXATTR_SIZE__]; };
^
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/signal.h:65:0,
from tcpip.cpp:58:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/sys/_pthread/_pthread_types.h:88:8: error: redefinition of 'struct _opaque_pthread_once_t'
struct _opaque_pthread_once_t {
^
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/_types.h:27:0,
from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/stdlib.h:63,
from ../../include/pro.h:74,
from tcpip.h:4,
from tcpip.cpp:11:
../../ldr/mach-o/h/sys/_types.h:69:8: error: previous definition of 'struct _opaque_pthread_once_t'
struct _opaque_pthread_once_t { long __sig; char __opaque[__PTHREAD_ONCE_SIZE__]; };
^
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/signal.h:65:0,
from tcpip.cpp:58:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/sys/_pthread/_pthread_types.h:93:8: error: redefinition of 'struct _opaque_pthread_rwlock_t'
struct _opaque_pthread_rwlock_t {
^
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/_types.h:27:0,
from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/stdlib.h:63,
from ../../include/pro.h:74,
from tcpip.h:4,
from tcpip.cpp:11:
../../ldr/mach-o/h/sys/_types.h:70:8: error: previous definition of 'struct _opaque_pthread_rwlock_t'
struct _opaque_pthread_rwlock_t { long __sig; char __opaque[__PTHREAD_RWLOCK_SIZE__]; };
^
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/signal.h:65:0,
from tcpip.cpp:58:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/sys/_pthread/_pthread_types.h:98:8: error: redefinition of 'struct _opaque_pthread_rwlockattr_t'
struct _opaque_pthread_rwlockattr_t {
^
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/_types.h:27:0,
from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/stdlib.h:63,
from ../../include/pro.h:74,
from tcpip.h:4,
from tcpip.cpp:11:
../../ldr/mach-o/h/sys/_types.h:71:8: error: previous definition of 'struct _opaque_pthread_rwlockattr_t'
struct _opaque_pthread_rwlockattr_t { long __sig; char __opaque[__PTHREAD_RWLOCKATTR_SIZE__]; };
^
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/signal.h:65:0,
from tcpip.cpp:58:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/sys/_pthread/_pthread_types.h:103:8: error: redefinition of 'struct _opaque_pthread_t'
struct _opaque_pthread_t {
^
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/_types.h:27:0,
from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/stdlib.h:63,
from ../../include/pro.h:74,
from tcpip.h:4,
from tcpip.cpp:11:
../../ldr/mach-o/h/sys/_types.h:72:8: error: previous definition of 'struct _opaque_pthread_t'
struct _opaque_pthread_t { long __sig; struct __darwin_pthread_handler_rec *__cleanup_stack; char __opaque[__PTHREAD_SIZE__]; };
^
make[1]: *** [obj/x86_mac_gcc_32/tcpip.o32] Error 1
make: *** [/Users/pgiblock/src/idasdk/idasdk68//plugins/debugger/obj/x86_mac_gcc_32/tcpip.o32] Error 1
A brief comparison of the sample plugin makefiles and idados's shows significant differences. For instance, findcrypt/makefile
only includes plugin.mak
instead of allmake.unx
, and doesn't bother specifying any of IDA's libraries (such as tcpip
) in the object list.
Can the makefile get some love? I'd help, but I'm unsure of its intent.
Thanks
I have several issues being able to build IdaDOS and DOSBox on a fresh MSys2 installation when strictly following BUILD.md as I'm new to MSys2. There are some things which can be tricky for a beginner like me, which I bolded. I still can't compile DOSBox correctly eventually.
Sorry that I can't even teach Github to continue my list numbers when using code blocks.
Preparations
pacman -S mingw-w64-i686-toolchain
(installing all members)pacman -S mingw-w64-i686-SDL
as I need to build DOSBox too later on./d/idasdk68
.Compiling IdaDOS
/d/idados
.build_mingw.sh
to use ../idasdk68
rather than ../idasdk69
/d/idados
and executing ./build_mingw.sh
.In file included from ../idasdk68/plugins/debugger/tcpip.h:4:0,
from dosbox_rstub.cpp:15:
../idasdk68/include/pro.h:735:84: error: conflicting declaration of C function 'int memicmp(const void*, const void*, size_t)'
idaman THREAD_SAFE int ida_export memicmp(const void *x, const void *y, size_t size);
#ifdef __GNUC__
in pro.h
to #if 0
so it looks like this:#if 0
idaman THREAD_SAFE int ida_export memicmp(const void *x, const void *y, size_t size);
#endif
./build_mingw.sh
again. Getting the error:C:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lida
collect2.exe: error: ld returned 1 exit status
ida.wll
into /d/idasdk68/bin/ida.dll
as actually described under the "DOSBox" section in BUILD.md.dosbox_rstub.plw
to my IDA plugin directory.C:\msys32\mingw32\bin\libwinpthread-1.dll
to my IDA installation directory.The notes about __GNUC__
and ida.dll
should probably go under the IdaDOS section already.
Compiling DOSBox
/d/dosbox
..autogen-sh
. Getting the following output:Generating build information using aclocal, autoheader, automake and autoconf
This may take a while ...
./autogen.sh: line 8: aclocal: command not found
./autogen.sh: line 9: autoheader: command not found
./autogen.sh: line 10: automake: command not found
./autogen.sh: line 11: autoconf: command not found
Now you are ready to run ./configure.
You can also run ./configure --help for extra features to enable/disable.
pacman -Su automake
and pacman -Su autoconf
../autogen-sh
. Getting quite a few warnings about source files being in subdirectories (if required, I can upload the warnings). But no errors../configure --enable-debug=ida32 --with-ida-sdk=/d/idasdk68 --with-ida-plugin=/d/idados
, no errors.make
. Noticing it's not installed. Installing it with pacman -Su make
.In file included from debug.cpp:47:0:
debug_inc.h:22:20: fatal error: curses.h: No such file or directory
compilation terminated.
curses.h
, following the instructions found in http://www.dosbox.com/wiki/BuildingDOSBox under the "Enabling the debugger (You probably don't want this)" section (requiring to install tar
too).make
, now running without errors (build log on request).src/DOSBox.exe
into my DOSBox 0.74 directory.libgcc_s_dw2-1.dll
and libwinpthread-1.dll
from C:\msys32\mingw32\bin
as it is not in my PATH. Also having to copy over IDA.WLL
from my IDA directory.The procedure entry point _ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE13find_first_ofEPKcjj could not be located in the dynamic link library D:\Archive\Games\Emulators\DOSBox Debug\DOSBox.exe.
I'm out of ideas, I had a similar error yesterday about a missing symbol. What do I have to do to correctly compile DOSBox?
It is not possible to restart emulation by pressing Stop in IDA, and then pressing Run again.
Is it known that the Stack View seems... incorrect? Or at least the values seem misleading. Also, Call Stack seems to be unimplemented.
Are they expected to work? Or is this unfinished business? If the later, I'm willing to help try to improve this aspect of the plugin.
This idados remote debugger plugin fails to initialize on IDA 6.8. An error is displayed upon selecting the debugger from the debugger dropdown on the toolbar, or through the "Debugger -> Switch Debugger ..." menu option. IDA immediately exits upon dismissing the error dialog. The message is:
" Wrong DBG_RESMOD_STEP_... bits "
I imagine this is due to the plugin not initializing some value. Most likely debugger_t::resume_modes
is not filled. I'm still struggling to determine how this plugin initializes the debugger structure and how it assigns it to the global dbg
variable.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.