Compile DOSIT

From CGSecurity
Jump to navigation Jump to search

En.png English De.png Deutsch Es.png Español Fr.png Français It.png Italiano


Pacchetti per DJGPP

Sto usando il seguente pacchetto DJGPP

  • GNU Binutils 2.11.2 binaries for DJGPP
  • bsh204d GNU Bash 2.04 binary for DJGPP
  • bsn129b GNU bison 1.34 for DJGPP V2
  • csdpmi5b CWSDPMI binary distribution (release 5)
  • dif272b GNU Diffutils 2.7.2 for DJGPP V2
  • djdev203 Development Kit and Runtime
  • faq230b DJGPP FAQ List edition 2.30 for DJGPP v2.03
  • fil40b GNU Fileutils 4.0 for DJGPP 2.x, release 3 (binaries)
  • File(1) 3.34: binaries
  • find41b GNU findutils 4.1 for DJGPP V2
  • flx254b GNU Flex 2.5.4 binaries for DJGPP V2
  • gcc304b.zip : GCC 3.0.4 C compiler binaries for DJGPP
  • gdb500b GDB GNU Debugger version 5.0 binaries for DJGPP v2
  • gpp302b.zip : GCC 3.0.2 C++ compiler binaries for DJGPP
  • grep24b GNU grep 2.4 binaries for DJGPP V2
  • gwk306b GNU Awk 3.0.6 for DJGPP v2
  • libt143d.zip libtool
  • m4-14b GNU M4 1.4 binaries for DJGPP v2
  • mak3791b GNU Make 3.79.1 binaries for DJGPP V2
  • mlp107b Executable File Packer for DJGPP V2
  • objc302b.zip : GCC 3.0.2 Objective C compiler binaries for DJGPP
  • pdcur24b.zip PDCurses 2.4 binary for DJGPP
  • perl561b Perl 5.6.1b for DJGPP V2 (binary)
  • sed3028b GNU sed 3.02.80 for DJGPP V2
  • shl112b GNU sh-utils 1.12 for DJGPP V2
  • tar112ab GNU tar 1.12a binaries for DJGPP V2
  • txi40b GNU Texinfo 4.0 binaries for DJGPP V2
  • txt20b GNU Textutils 2.0 binaries for DJGPP V2
  • Which version 2.11 modified to work with DJGPP by David Cullen

E' possibile ottenere il compilatore C http://www.delorie.com/djgpp/.

Cioè se hai installato DJGPP in D:\gnu, aggiungi in autoexec.bat, il codice

set DJGPP=D:\gnu\djgpp.env
set PATH=D:\GNU\BIN;%PATH%

Patching DJGPP

In include/signal.h, aggiungi

#ifndef SIGCONT
#define SIGCONT 18
#endif

In include/mntent.h, aggiungi

#ifndef MOUNTED
#define MOUNTED "/etc/mtab"
#endif
#ifndef MNTOPT_RO
#define MNTOPT_RO "ro"
#endif

In include/errno.h, aggiungi

#ifndef EMSGSIZE
#define EMSGSIZE        90
#endif
#ifndef EOPNOTSUPP
#define EOPNOTSUPP      95
#endif
#ifndef ENOTSUPP
#define ENOTSUPP        524
#endif
#ifndef ENOTSUP
#define ENOTSUP         524
#endif
#ifndef ECANCELED
#define ECANCELED       125
#endif
#ifndef EILSEQ
#define EILSEQ          84
#endif
#ifndef EOVERFLOW
#define EOVERFLOW       600
#endif

In include/fcntl.h, aggiungi

#define O_LARGEFILE     0100000

In sys/param.h, aggiungi

/* Some autoconf'd packages check for endianness.  When cross-building we
   can't run programs on the target.  Fortunately, autoconf supports the
   definition of byte order in sys/param.h (that's us!).
   The values here are the same as used in gdb/defs.h (are the more
   appropriate values?).  */
#define BIG_ENDIAN      4321
#define LITTLE_ENDIAN   1234
/* All known dos systems are little endian.  */
#define BYTE_ORDER      LITTLE_ENDIAN

Aggiungi il file include/stdint.h

#ifndef _STDINT_H
#define _STDINT_H       1
typedef unsigned char uint8_t;
typedef unsigned short int uint16_t;
typedef unsigned int uint32_t;
typedef unsigned long long int uint64_t;
typedef char int8_t;
typedef short int int16_t;
typedef int int32_t;
typedef long long int int64_t;
typedef int                     intptr_t;
#endif

ln -s gpp.exe g++.exe

TestDisk è un vero programma a 32 bit (compilato in DJGPP), quindi un programma server DPMI (cwsdpmi.exe) è incluso nel download che permette a TestDisk l'esecuzione anche sotto DOS a 16-bit. Se si vuole lavorare in DOS reale (16-bit), è necessario avere un server DPMI; per farlo, scaricare: csdpmi*b.zip e poi posizionare il file eseguibile (cwsdpmi.exe) nella directory Bin (che deve essere nel PATH).
Vai a compilazione TestDisk