~ubuntu-branches/ubuntu/saucy/radare/saucy

« back to all changes in this revision

Viewing changes to src/rabin/p9bin.h

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Reichel
  • Date: 2009-05-22 19:01:00 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090522190100-qqp4aja112976t5v
Tags: 20090522-1
* new hg checkout
 - added 'cX' command to compare like 'cc' does but using two side hexdiff dump format
 - specify pointer & data size in pm with %<size>
 - add graph.weight
 - fix 'c' command (missing radare_read(0))
 - added /P search command that searchs for proximity in bytelevel distance
 - added more 'ag' and 'gu' commands to readline autocompletion.
 - fix build of debugger for non-linux systems
 - fixed code analysis at startup
 - more work in graphs (graph.split)
 - fixups in x86 code analysis

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Binary loader for Plan 9's a.out executable format
 
3
 * 
 
4
 * Copyright (C) 2008 Anant Narayanan
 
5
 */
 
6
struct plan9_exec {
 
7
        unsigned long magic;    /* magic number */
 
8
        unsigned long text;     /* size of text segment */
 
9
        unsigned long data;     /* size of initialized data */
 
10
        unsigned long bss;      /* size of uninitialized data */
 
11
        unsigned long syms;     /* size of symbol table */
 
12
        unsigned long entry;    /* entry point */
 
13
        unsigned long spsz;     /* size of pc/sp offset table */
 
14
        unsigned long pcsz;     /* size of pc/line number table */
 
15
};
 
16
 
 
17
#define HDR_MAGIC       0x00008000      /* header expansion */
 
18
 
 
19
#define _MAGIC(f, b)    ((f)|((((4*(b))+0)*(b))+7))
 
20
#define A_MAGIC         _MAGIC(0, 8)    /* 68020 */
 
21
#define I_MAGIC         _MAGIC(0, 11)   /* intel 386 */
 
22
#define J_MAGIC         _MAGIC(0, 12)   /* intel 960 (retired) */
 
23
#define K_MAGIC         _MAGIC(0, 13)   /* sparc */
 
24
#define V_MAGIC         _MAGIC(0, 16)   /* mips 3000 BE */
 
25
#define X_MAGIC         _MAGIC(0, 17)   /* att dsp 3210 (retired) */
 
26
#define M_MAGIC         _MAGIC(0, 18)   /* mips 4000 BE */
 
27
#define D_MAGIC         _MAGIC(0, 19)   /* amd 29000 (retired) */
 
28
#define E_MAGIC         _MAGIC(0, 20)   /* arm */
 
29
#define Q_MAGIC         _MAGIC(0, 21)   /* powerpc */
 
30
#define N_MAGIC         _MAGIC(0, 22)   /* mips 4000 LE */
 
31
#define L_MAGIC         _MAGIC(0, 23)   /* dec alpha */
 
32
#define P_MAGIC         _MAGIC(0, 24)   /* mips 3000 LE */
 
33
#define U_MAGIC         _MAGIC(0, 25)   /* sparc64 */
 
34
#define S_MAGIC         _MAGIC(HDR_MAGIC, 26)   /* amd64 */
 
35
#define T_MAGIC         _MAGIC(HDR_MAGIC, 27)   /* powerpc64 */
 
36
 
 
37
#define TOS_SIZE        14      /* Size of Top of Stack: 56 / 4 */
 
38
#define HDR_SIZE        0x20
 
39
#define STR_ADDR        0x1000  /* Start Address */
 
40
#define TXT_ADDR        HDR_SIZE + ex.text      /* TEXT Address */
 
41
#define DAT_ADDR        STR_ADDR + PAGE_ALIGN(TXT_ADDR) /* DATA&BSS Address */
 
42
 
 
43
/*---*/
 
44
 
 
45
#define p9bin_open(x) fopen(x,"r")
 
46
#define p9bin_close(x) fclose(x)
 
47