Commit Graph

968 Commits

Author SHA1 Message Date
Nibble
c79afe3568 * Add var vm.arch
* Fix vm arch setup at startup
* Fix flag set in visual mode when cursor is enabled
* Filter string names before adding flags in r_bin_load
* Fix r_flag_name_filter (do trim)
* Fix r_sys_rmkdir
* Update TODO
2010-10-23 14:27:13 +02:00
pancake
431e626680 * Fix $$$ variable
* Do not set io.va twice
2010-10-22 01:16:32 +02:00
pancake
f7dd1dd66f * Build w32 python bindings in build.sh
* Added 'drb' command to show bytes of GPR
* Fix signature of r_print_hexdump and _hexpairs
* Enhace r_reg test case
* Fix swig/Makefile w32dist target
2010-10-19 22:17:58 +02:00
pancake
6ea3adb5aa * Bump revision to beta 0.6
* Fix bug in armass noticed by @earada
2010-10-19 19:53:29 +02:00
pancake
a25065fa75 * Honor print->cols in visual {j,k} 2010-10-19 13:17:25 +02:00
Nibble
65bd1b53e9 * Fix block read in visual mode
* Use a more reliable way for fixing the got_offset issues
* Remove ELF_GOTOFF_MASK
2010-10-19 12:57:28 +02:00
pancake
f9e6ca28cf * Fixes in swig/ for OS type selection
* Move rsc2 into binr/

--HG--
rename : rsc2/rsc2.c => binr/rsc2/rsc2.c
rename : rsc2/scripts/intel2att => binr/rsc2/scripts/intel2att
2010-10-18 20:47:13 +02:00
pancake
8149bab431 * Remove \r (thanks @earada) 2010-10-18 11:54:12 +02:00
pancake
bbdf96a97d * Some work on the analysis of the cursor bug 2010-10-18 11:38:52 +02:00
pancake
c02df0ba66 * Restore old asmserv.c
- Fix build
2010-10-18 01:52:44 +02:00
pancake
9313a158d6 * Added compilation support for python bindings on Windows
- Documented in doc/windows
* Use single linked list pointer in rbin->rcore
  - Thanks @earada :)
2010-10-18 00:00:17 +02:00
pancake
d0e3a3b0e3 * Fix w32 debugger register profile
* Remove \r in asmserv.c
2010-10-17 23:33:58 +02:00
pancake
9f7040dbf8 * Fix warnings in asmserv on windows
* Some alloca->malloc fixes for w32
* More error checking in r_sys_rmkdir
  - Uses the new r_sys_mkdir_failed() api
  - works on windows and posix
* Disable asm.dwarf when the plugin fails to init
  - Displays a warning message
* Added 'e scr.cols=16'
  - Determines the width of the hexdump (px, x)
  - Used also by Visual mode hjkl dimensions
2010-10-17 23:03:54 +02:00
Nibble
7fe2f823e7 * Fix build for win
* Fix string rva in r_bin
2010-10-17 20:38:19 +02:00
pancake
5d946a8b21 * Apply some fixes for w32
* More nullptr checks
  - Fix 'drp'
* Fix build
2010-10-14 19:01:14 +02:00
pancake
93e69bab0e * Fix null pointer issue related to r_syscall and r_core 2010-10-14 17:06:09 +02:00
Nibble
bfbd12ed3c * Don't add symbols as functions before analyze them
* Update and simplify gdiff
2010-10-13 18:51:10 +02:00
pancake
d607e969bc * Fix division by zero in VM code when using ATT syntax
- use intel syntax when running VM code from disasm loop
2010-10-13 18:07:55 +02:00
Nibble
add2efee74 * Fix reloc offset resolution in r_bin_elf 2010-10-13 04:00:32 +02:00
Nibble
11e8d6a1da * Fix va issue in dbg mode 2010-10-13 01:23:27 +02:00
pancake
ead5ebdd32 * Oops. fix debugger attach 2010-10-13 01:00:39 +02:00
pancake
01b56da424 * Remove -l flag in rarc2
- Replaced by rarc2 -a
* Fix build
2010-10-13 00:43:02 +02:00
pancake
8f9dbbd0d1 * Remove some use of alloca()
* Fix lock when using 'r2 -d'
* Invalid program name results in error, not warning
2010-10-12 13:22:19 +02:00
Nibble
17542ef3de * More work on r_bin and r_util vapi's
* Minor aesthetic fix in core/file.c
2010-10-12 07:08:03 +02:00
pancake
dac5cf1b08 * Apply patching fixing various bugs on w32
- Some segfaults resolved and bugs identified
  - Thanks @mrgadix :)
2010-10-12 01:18:17 +02:00
pancake
35adb1690d * Apply fix in rbin->core integration from @earada 2010-10-12 01:16:39 +02:00
pancake
b716077518 * merge 2010-10-11 17:12:08 +02:00
pancake
f1e46a88f6 * Do not run .!rabin2 from r_core
- Use internal APIs to load binary information
  - Startup time reduced about 2-3 times
  - Thanks @earada for this patch!
2010-10-11 17:11:43 +02:00
Nibble
f29444ab20 * r_core
- Add var asm.functions to show/hide function analysis in disasm
  - Take into account asm.{xrefs, functions} in disasm
* vapi's
  - Add bin to RCore in r_core.vapi
2010-10-09 19:13:10 +02:00
Nibble
b3ac5bd4d4 * r_core
- Add helpers r_core_disassemble_instr() and r_core_disassemble_bytes()
* bindings
  - Fix go detection
  - Update r_core.vapi
2010-10-09 13:54:08 +02:00
pancake
1fc70da3c9 * Analyze cmp/ldr/str opcodes in arm thumb
* Minor work to fix the cursor issues
2010-10-08 11:10:25 +02:00
pancake
cc4e664533 * Do not show cursor in visual mode when cursor is disabled 2010-10-08 00:48:07 +02:00
pancake
daa5d0fd38 * Implement ldmia/stmia in armthumb_assemble
- added also: yield, wfe, wfi, sev, bkpt
  - fix ldr{bh} and str{bh}
* Initial implementation of the arm-thumb code analysis module
2010-10-08 00:27:38 +02:00
pancake
284abdfb87 * Added partially supported ldr{hb} and str{hb} opcodes for armthumb
- needs more parse checking
2010-10-07 19:16:16 +02:00
Nibble
44eff205c1 * r_core
- Fix DATA in disasm
  - Correct the number of lines showed with 'pd n'
* Update r_core vapi
2010-10-07 13:02:07 +02:00
pancake
6b3883cc43 * More opcodes supported by the arm thumb assembler
- Just missing ldr{b,h} and str{b,h}
* Added armthumb_length() function to retrieve opcode length
2010-10-07 11:20:12 +02:00
pancake
a8c641a0a6 * Initial import of the ARM thumb assembler
- Not all opcodes are supported, partially done
2010-10-06 21:22:56 +02:00
Nibble
124aa07a96 * Add r_core_asm_bwdisassemble for backward disassemble resolution
* Add example using bwdisassemble in swig/vapi/t/bwdisassemble.vala
* Add field len to RCoreAsmHit
* Update vapi's
* Fix memory leak in r_core_asm_strsearch()
* Fix several vala examples
* Fix r_list_iterator warning in vala
2010-10-06 18:04:47 +02:00
pancake
b21584e06c * Initial import of the thumb arm disassembler
- based in C++ code of KennyTM in networkpx.googlecode.com
  - Added 'armthumb' r_asm plugin (16 bit mode)
2010-10-06 00:35:33 +02:00
Nibble
04d4053f67 * r_io
- Remove r_io_map_list from r_io.h (deprecated)
* vapi's
  - Update r_io.vapi
2010-10-05 21:43:14 +02:00
Nibble
fbf99edafa * r_asm
- Remove dupped function signature from r_asm.h
* vapi's
  - Fix {r_asm, r_bin, r_util}.vapi
  - Update r_bin.vapi
2010-10-05 20:30:05 +02:00
Nibble
a83355f0b1 * De-warn dyldcache in 32bits
* Add dyldcache.mk to libr/bin/p/Makefile
* Update reloc.vala
2010-10-04 23:05:30 +02:00
pancake
f99e946b9b * Initial import of rasc2 (copypasta from r1) 2010-10-04 19:43:40 +02:00
Nibble
836c91c32a * r_util
- Fix r_sys_rmkdir
* rabin2
  - Generate folder structure on extract operations
2010-10-04 13:57:48 +02:00
Nibble
b1cdfcc889 * Fix build 2010-10-04 12:46:27 +02:00
pancake
e8f8e72896 * Added r_bin_get_object() to cache binary information
* Initial work in r_core_bin_load()
  - Integrating rabin2 inside core
2010-10-04 10:55:43 +02:00
Nibble
afedad76bb * Fix memory leak in bin_mach0 2010-10-04 04:20:19 +02:00
Nibble
a1d0887ca8 * Fix build (update core/anal.c with the last changes in r_bin)
* Implement extract in rabin2
2010-10-04 04:01:25 +02:00
Nibble
cec1f3fa73 * r_bin
- Refactor r_bin to work better with big fatbins
  - Don't load all sub-bins in memory
    Only load the fatbin and the selected sub-bin
  - Add r_bin_set_archidx() and r_bin_list_archs()
  - Update t/{rpathdel.c, test_meta.c}
* rabin2
  - Use '-f str' to select sub-bin by name
2010-10-04 03:46:58 +02:00
pancake
ee39ba239a * Add 'FS' #define for w32 and *nix
* Add support for thumb mode ARM disassembler
  - Workaround a warning in r_vm for arm-16
* More work on drx.c, but still not integrated
2010-10-04 00:42:11 +02:00
Nibble
fd084aca33 * Fix segfault in dyldcache 2010-10-02 18:20:46 +02:00
Nibble
d65ad968d7 * r_bin
- More work on dyld cache plugin
  - Rewrite headers, commands and segments
  - Fix offset for syms, imports, sections...
* r_util
  - Add r_buf_append_bytes
  - fix r_sys_rmkdir
* Update TODO
2010-10-02 17:21:51 +02:00
pancake
17a6fde707 * Add r_sys_rmkdir and make r_sys_mkdir a define 2010-10-01 19:05:07 +02:00
Nibble
a7d6fc0cc7 * Detect bin sizes in dyld cache plugin 2010-10-01 13:22:37 +02:00
Nibble
48dd408e45 * Merge
* Minor fixes in r_bin
2010-10-01 11:58:11 +02:00
pancake
8081f02601 * Fix uninitialized variable in rabin2
* Fix null pointer handling in rbin when no xtr plugin found
* Initial draft code for the x86 debug registers implementation
* Fix avr* command
2010-10-01 11:10:59 +02:00
Nibble
41bd2fd0ea * rabin2
- Show filesize in '-x' output
  - Select "sub-bin" using '-a arch_bits' and '-n filename'
* r_bin
  - Add argument "name" to r_bin_set_arch
2010-10-01 10:09:50 +02:00
Nibble
4b558bec3b * rabin2 -x uses filename.arch_bits as output file
* store full path in dyld cache filenames
2010-10-01 08:12:43 +02:00
Nibble
987d8599f9 * Initial implementation of the RBin extractor for dyld cache
* Add bin_xtr_dyldcache to plugins.def.cfg
* Show bin name in the output of 'rabin2 -A'
* Minor fix in rabin_list_archs() in rabin2
2010-10-01 04:26:52 +02:00
Nibble
e02c81ddf1 * r_core
- Minor fixup in r_core_asm_strsearch
* vapi
  - Add asmsearch.vala
  - Some updates
2010-09-30 20:55:20 +02:00
Nibble
df9434b1ec * Make r_core_asm_strsearch more API-friendly
- return RList of RCoreAsmHit's
  - Add helpers for list handling
* Add type RCoreAsmHit
* Show hit code as comment with '/c', eg:
    [0x00402350]> "/c jmp e; ret"
    f hit0_0 @ 0x004078e8   # jmp eax; ret 0xffbc;
    f hit0_1 @ 0x00409416   # jmp ebx; ret 0x8b48;
    f hit0_2 @ 0x0040ded4   # jmp ecx; retf ;
* Update r_core vapi
2010-09-30 19:25:47 +02:00
Nibble
4369761655 * Fix typo in printf 2010-09-28 19:57:02 +02:00
Nibble
7d1303292e * r_anal
- Fix segfault in anal_x86_x86im (64bits)
  - always show analysis warnings
* r_core
  - Fix /a output
2010-09-28 18:52:46 +02:00
Nibble
697490a661 * r_core
- Implement 'ar' commands
  - Show XREFS in disassembly
* r_anal
  - Add r_anal_xref_get
2010-09-28 18:05:31 +02:00
Nibble
eb811bbf08 * r_core
- Deprecate ah and add anal.plugin
  - e anal.plugin=? list available plugins
  - Add the command 'ar' to handle refs/xrefs
  - Remove old CX and Cx stuff
  - Remove afg (done by af)
* r_anal (& r_meta)
  - Remove refs/xrefs stuff from r_meta
  - Handle refs from r_anal
  - Add r_anal_ref_{add, del}
* rabin2
  - Add 'e anal.plugin' to the output of rabin2 -Ir
2010-09-28 13:58:03 +02:00
Nibble
e5bc46da65 * Update r_anal with the changes introduced in r_bin 2010-09-24 21:30:33 +02:00
Nibble
483ab6160b Apply @earada's patch (thx!)
* Improving rax2
  - Support for many bases.
  - Add -s flag for transform byte to bin (ej: "48454c4c4f" to "HELLO")
  - Add -e flag for endian swap.
* New r_num_to_bits converts nums into binary representation.
2010-09-24 21:25:23 +02:00
Nibble
793dae395d * Massive refactoring of r_bin
- Add support for fatbins (currently only fatmach0)
  - Minimize creation of r_buffers
* rabin2
  - Add flag -A for listing archs
  - Add flags -a and -B for selecting arch
  - In the next commit -A and -B will be removed and -a will work
    with the following format:
    [-a arch bits] for selecting arch
	[-a] for listing them

--HG--
rename : libr/bin/p/bin_fatmach0.c => libr/bin/p/bin_xtr_fatmach0.c
2010-09-24 21:23:13 +02:00
pancake
d71fcd2708 * Do not show color prompt in windows
* Fix build on w32
* Finish the symgraph script
2010-09-24 19:04:33 +02:00
pancake
124786c1ac * Added 'drd' command to show only modified regs
* Added r_list_foreach_prev()
* Add RSyscallPort to handle Hardware I/O ports
* Remove libr/TODO and refactor /TODO
* Link with 'ld' in rarc2-tool for nasm
2010-09-24 16:45:56 +02:00
pancake
eb6dbb2245 * Initial draft implementation of hardware breakpoints
- use specific ptrace() calls in linux/freebsd to change regs
  - hwbp are not yet working, just basic DRX get/set
  - generic interface to handle hw bps in x86-32/64
  - needs to import DR# handling code from r1
2010-09-24 05:41:54 +02:00
pancake
84dd63b743 * Add 'bf' command to change block size based on flag size
- Added help in 'b?'
* Added support for bit-collection registers
  - eflags is now displayed as a string
  - debug/p/debug_native.c needs a correct x86 flag string
* Fix segfault when listing empty register sets
2010-09-24 04:09:39 +02:00
pancake
46aa9f5f7e * Implement stacked register storage
- Add support for register diffing
  - Colorize modified registers are step/cont
  - Add command 'dro' to show old register values
  - requires make clean
2010-09-23 20:42:35 +02:00
Nibble
cbdfff3dda * Minor fixup in anal_x86_x86im
- swapped dst src in *_MM_RG
2010-09-23 13:56:08 +02:00
Nibble
69d08e1514 * Huge refactoring of x86_x86im using r_anal_value
- next step is integrate it in the analysis engine and deprecate old stuff
* Add field "imm" (immediate value) to RAnalValue
2010-09-23 13:25:46 +02:00
pancake
022e6c96f0 * Add pt command for print times (Thanks @earada for the patch)
- pt prints times in unix format
  - ptd prints times in dos format
  - ptn prints times in ntfs format
* Add cfg.datefmt in global config to define the format output of 'pt'
2010-09-23 12:59:54 +02:00
Nibble
49dceaaffd * More work on anal_x86_x86im refactoring 2010-09-22 18:31:15 +02:00
pancake
b339189b5f * Added r_reg_arena_set and r_reg_cmp in order to implement regdiffing
* Added R_DBG_REASON enums
2010-09-20 14:02:45 +02:00
pancake
1356a9bdd1 * Highlight destination offset when cursor on jmp/call in visual
* Show call decompilations under the opcode as a comment
* Rename RRegister as RReg
  - Deprecate r_reg_init and use r_reg_new
  - Rewrite the list.h dependency in r_reg in order to use r_list
  - Fix some memory leaks
* Implement push/pop methods in RReg class
  - add test case using it
  - will be used for register diffing and tracing
2010-09-18 02:51:17 +02:00
Nibble
441456767a * Fix define types in r_types_base.h
- now swig assigns const types correctly in go bindings
  - simplify fixgoswig.sh while the patch I've done for
    swig adding iterators support is not commited
2010-09-16 13:20:35 +02:00
pancake
6072a14eef * Simplify and fix rarc2-tool script
* Add support for /**/ style comments in rarc2
* Fix libr2.a warning message
* Fix .string "" directive in rasm2
  - Now works like in GAS. escape chars are handled
  - and quotes are stripped
2010-09-15 13:10:10 +02:00
pancake
9b2d428d1b * Initial hello world for rarc2 in ARM with GAS working
- Few changes needed to work with rasm
* Cleanup some warnings
* Handle foo() as a function definition, so emit frame in rarc
2010-09-15 10:50:43 +02:00
pancake
1b1599c6df * Support for some push/pop arm opcodes with 2 regs
* More fixes for rarc2 on ARM
* Implement .fill directive in r_asm
* Added asm.profile in r_core
* Added r_str_bits as a helper to display register flags
2010-09-14 11:22:31 +02:00
pancake
a9f8d52e59 * Many fixes in ARM assembler and rarc2 support for ARM
- Still not yet usable, but
* Add .byte and .hex in r_asm as directives
* Add test case for r_word api
  - Fix r_word_count()
* Also handle .globl (and .global) to keep GAS compatibility
  - TODO: add .word .fill .align and others
2010-09-14 01:29:09 +02:00
Nibble
5733497a0b * Add bindings for go
* Add swig/go/test-r_bin.go for testing r_bin from go
* Fix build for r_bp and r_search bindings
* Rename enum VarType to VarClass in r_anal.vapi to avoid conflicts
* Add flag -R to rabin_cmd in r2 start up
2010-09-12 12:31:18 +02:00
pancake
f4ada2309f * Handle numeric values as radix=10 by default in ollyasm
- Fixes rarc ATT output format for x86
* Fix commandline flags parsing in rarc2
  - Honor intel syntax with ".intel_syntax noprefix" header
    - GAS can now compile att and intel syntax rarc2 output
* Handle .intel_syntax and .att_syntax directives in rasm2
2010-09-10 13:17:24 +02:00
Nibble
09f5ca50a6 * Minor fixup in r_bin_elf 2010-09-10 11:46:30 +02:00
Nibble
159165fa13 * Add vapi/t/reloc.vala
- Print address for each relocation entry
* Update r_bin.vapi
* Minor fixup in r_bin_elf_get_relocs()
* Update TODO
2010-09-10 11:32:49 +02:00
Nibble
5567da9538 * Add support for parsing relocs to r_bin
* Add flag -R to rabin2 to list relocs
* Implement reloc resolution in r_bin_elf for 32 & 64 bits
2010-09-10 11:11:38 +02:00
pancake
2d2131607c * Error on invalid hexpair strings in rasm2
* Fix assemble of str/ldr opcodes in ARM assembler
  - add more opcodes: nop, push, pop
2010-09-10 10:50:53 +02:00
Nibble
b344f96e21 * More work on r_bin_mach0
- Parse local symbols
  - Resolve non-lazy symbol pointers
  - Set import type to FUNC or OBJECT
  - Refactoring of get_imports
  - Add field type to r_bin_mach0_{import, symbol}
2010-09-10 01:17:55 +02:00
pancake
45c7167491 * Add r_sys_cmdf 2010-09-10 00:08:53 +02:00
pancake
76476e89ed * Many fixes and more opcodes supported for the ARM assembler 2010-09-09 23:54:56 +02:00
pancake
a7e77e78ee * More work on the arm assembler 2010-09-09 01:39:15 +02:00
pancake
183dffcd6b * Fix push immediate opcode analysis in basic x86 analysis
* Import simple arm assembler
* Some fixes for the brainfuck disassembler plugin
2010-09-08 19:49:34 +02:00
Nibble
59ac6a7c8b * Refactoring of /a
* ptrdepth works right with code and data refs
* More work in x86im plugin
  - Fill op.refs for more opcodes
  - Next step is a massive refactoring using r_anal_value
2010-09-08 11:52:10 +02:00
Nibble
a7a4a674f0 * Fix segfault parsing mach-o 2010-09-07 21:38:54 +02:00
Nibble
f7693a14d2 * Huge refactoring of anal_x86_x86im
* Add comments in anal_x86_x86im explaining how x86im parse the opcodes
* Implement analysis for more opcodes
* Rename R_ANAL_OP_TYPE_RCALL into R_ANAL_OP_TYPE_UCALL (more generic)
* Update anal_mips.c and r_anal.vapi
* Update TODO
2010-09-05 21:20:56 +02:00
pancake
50f229c93d * Add hash-like access to linked lists
* Add R_BETWEEN macro
2010-09-01 20:32:24 +02:00
Nibble
3aeade1fa7 * Fix build of anal_x86_x86im 2010-08-27 18:38:51 +02:00