Commit graph

869 commits

Author SHA1 Message Date
Álvaro Felipe Melchor
c372743315 xnu: get rid of ptrace even for attach and detach
some rework in order to handle mach message as mach_exc_server and alike does
api change in plugin debug, now the function detach receive a pointer to RDebug
trying to deallocate port when are not needed any more
2016-01-23 22:50:28 +01:00
condret
5a300e09e8 fix r_io_section_rm 2016-01-22 15:38:12 +00:00
pancake
de22aa46f2 Fix COV with boolified r_io_creat 2016-01-19 13:16:24 +01:00
Álvaro Felipe Melchor
d9e77ca0d1 xnu: first series of patches to use mach exceptions
* use set_trace_bit and clear_trace_bit macros

* use PT_ATTACHEXC since PT_ATTACH will be deprecated in the future
and we are interested in receiving mach exceptions

* first attempt to handle mach exceptions

* api change: added a parameter to r_core_setup_debugger
at least in OS X this function was producing double attachment.
I've added a boolean value to indicate when use dpa.

* added pipe to communicate between main process and traced process
by far this is not a good implementation. We should develop a better
approach/design to save all the exceptions and handle them accordingly.
This is the initial implementation

* bring back ptrace for stability and in order to merge this into master
2016-01-18 22:24:16 +01:00
pancake
d2a192cffc Fix #3760 - Honor iOS/OSX pre-map memory reads in io.mach 2016-01-07 01:23:14 +01:00
DZ_ruyk
0e8b42787a Boring typo fixes
Can't -> Cannot (since most of error messages use second form)
2016-01-07 00:13:54 +01:00
pancake
6f47901a06 Clarify r_io_section_mget->_in api and use the heap for section->name 2016-01-03 03:08:58 +01:00
pancake
42acaa7596 Softly kill boolt type 2016-01-03 02:05:26 +01:00
pancake
4c4bfd11c2 Enforce size in section.findMatching 2016-01-03 01:40:09 +01:00
pancake
a93ecf2b69 Fix #3898 - Persistent section name in project files 2016-01-03 01:36:16 +01:00
pancake
6f346b6d6d Fix #3901 - Cannot debug directories and follow symlinks 2016-01-03 01:28:02 +01:00
Ricardo Quesada
2c3fdba551 Fix for bug 3788
- `r_io_read` calls `r_io_read_at` with vaddrs, and not with maddr
- `r_io_section_maddr_to_vaddr` uses a reverse iterator to check the
  sections
- adds `r_io_section_mget_prev`: this function can be removed if the
  behavior of `r_io_section_mget` is changed to use a reverse iterator

Squashed commit of the following:

commit a31d359bf1c79b92f518fa8237c7f9d4cf146577
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Wed Dec 9 11:40:54 2015 -0800

    fetches sections starting from the back

commit 0b687439ea6225c8db9f387cc93bc53300e297a7
Merge: 8485676 92c1631
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Tue Dec 8 23:40:35 2015 -0800

    Merge branch 'master' of https://github.com/radare/radare2 into revert_3788

commit 8485676cf5c042d8c4e10c798b4fadb1a43df50c
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Tue Dec 8 23:09:05 2015 -0800

    This seems to be the "correct" patch...

    ...but it breaks some tests... apprently searches a few bytes
    out of the section creating some false-positives hits

    I'm just commiting this PR to give an idea of where the bug is

commit 2e4b8de397a4ef23c02c3e08113cf6b984479275
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Tue Dec 8 22:46:29 2015 -0800

    not good... reverting

commit 324afba7e2853ddb72750f7f8b38bf59af310873
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Tue Dec 8 22:09:25 2015 -0800

    workaround for bug 3788

commit 6e6283eaa18edcca1987a8f4227f163a6926c430
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Tue Dec 8 15:14:12 2015 -0800

    Reverts fix for bug #3788

    please, reopen bug #3788
2015-12-09 22:20:54 +01:00
pancake
92c1631a06 More indent fixes 2015-12-09 00:41:44 +01:00
pancake
cfb03d3772 More indentation fixes 2015-12-09 00:27:31 +01:00
pancake
a4fc08b401 More auto-indentation enhancements 2015-12-08 23:55:23 +01:00
pancake
b5e093fc45 Indent io/io.c and fix an issue in the .sh 2015-12-08 22:35:39 +01:00
pancake
75ea729679 Fix regression in t.anal/x86/emu 2015-12-08 16:49:15 +01:00
pancake
0880d7d4f5 Some refactor/cleanup for agf and io cache (wip) 2015-12-08 14:59:30 +01:00
pancake
aac116bc8f Fix r_io_map_get 2015-12-08 01:54:05 +01:00
pancake
61fba1e663 Fix #3807 - write on maps issue 2015-12-07 22:35:34 +01:00
pancake
cc402a76c5 More refactorings towards a ptrace-free iOS/OSX debugger 2015-12-04 02:44:36 +01:00
pancake
fb8345276a Kill child if no perms to debug after spawn in OSX 2015-12-04 00:21:06 +01:00
pancake
40e08dbd89 Get rid of _Bool 2015-12-01 12:39:12 +01:00
skuater
513200a7fa Fixes for the w32 debugger 2015-11-24 23:28:50 +01:00
pancake
07c6a1e41d Fix rabin2 -k crash 2015-11-24 10:17:24 +01:00
pancake
50f8ecaba4 Fix 2015-11-22 02:07:28 +01:00
pancake
f188ef836e Fix java build 2015-11-20 16:08:24 +01:00
pancake
e0de679118 Fix #3691 - Fix unitialized memory in 32bit esil write op 2015-11-16 10:29:03 +01:00
pancake
2b519dee07 Fix #3599 - save/restore file map address 2015-11-12 10:33:20 +01:00
Álvaro Felipe Melchor
b1583d5b24 Fix more issues reported by clang-analyzer 2015-11-03 22:14:00 +01:00
pancake
afb5c93e49 Fix iOS debugger attach 2015-10-31 00:48:08 +01:00
Álvaro Felipe Melchor
8aa6086ed3 Fix #3474 2015-10-29 18:51:44 +01:00
Riccardo Schirone
7323e0ef05 socket/run: split r_run_start to make debugging easier
During the environment configuration we may fork and spawn other
processes that we don't really care about. Splitting r_run_start, allows
to call ptrace only after this initial work is done.
2015-10-29 08:21:24 +01:00
pancake
6c4bfb94b1 Fix windist, r2pipe and plugins paths 2015-10-23 02:58:48 +02:00
Claude Hemberger
3929091bf5 Incompatible pointer type warning during make
wind_va_to_pa wants a different struct for 64 bit int. Since the value
is never used, I just replaced it
2015-10-16 13:16:49 +02:00
Álvaro Felipe Melchor
11ce2c5031 fix aligned issue with S= 2015-10-15 21:57:08 +02:00
pancake
9f522a4a9b Fix seek for ptrace and mach IO 2015-10-14 13:42:15 +02:00
Álvaro Felipe Melchor
82e02d15b0 Fix S= issues with paddr and vaddr 2015-10-14 00:11:35 +02:00
Álvaro Felipe Melchor
feb11b7861 Fix #3440 2015-10-14 00:11:35 +02:00
Álvaro Felipe Melchor
a7022f01a5 coding style and fix paddr in S= 2015-10-14 00:11:35 +02:00
pancake
f9b661f839 Hardcode pagesize for arm64 in native iOS debugger 2015-10-12 19:18:00 +02:00
pancake
747c7bbacb More fixes for io.mach.write 2015-10-11 03:07:53 +02:00
pancake
f6b19c6762 Fix many bugs in io.mach.write, add =!perm for mach debugger 2015-10-11 01:07:36 +02:00
Álvaro Felipe Melchor
d9fb954dec Added string in drr and pxr 2015-10-06 18:23:27 +02:00
Álvaro Felipe Melchor
1d3df40c0c Fix dbg.args for linux 2015-10-04 16:46:28 +02:00
Álvaro Felipe Melchor
ac965a56c0 Fix #3359 2015-10-01 11:01:55 +02:00
Álvaro Felipe Melchor
fb04e33acc Fix #3208 2015-09-30 10:46:52 +02:00
Ole André Vadla Ravnås
f47da1c545 Fix fork_and_ptraceme() on Darwin
It's better to let `posix_spawnp()` spawn the child process instead of
forking ourselves.
2015-09-22 10:03:16 +02:00
pancake
486c88954f Darwin: start debugging suspended. Fixes in lm32 2015-09-22 02:28:04 +02:00
pancake
5d874bc8d5 Remove io.zeromap 2015-09-16 23:35:11 +02:00
pancake
4e47d86de0 Honor wheelspeed, fix oob in vmenus and more boolification 2015-09-14 16:22:57 +02:00
pancake
49975ccf95 Fix #3286 - Use stdbool.h 2015-09-14 02:08:31 +02:00
Riccardo Schirone
2e048b3272 socket/run: implement fork option 2015-09-13 10:46:09 +02:00
Riccardo Schirone
ffdbf919b1 io/section: add r_io_section_vaddr_to_maddr_try API
* fix r_io_section_vaddr_to_maddr
* rename r_io_section_maddr_to_vaddr and vaddr_to_maddr
2015-09-10 01:59:40 +02:00
NighterMan
16548bddee Do not allocate more than one RIODesc for io_gdb
This fixes an issue where we end up with multiple connections to the gdb stub
which only supports one connection, ending up with one connection for debug
which works and another connection for IO which doesnt.
2015-09-08 23:27:43 +02:00
Riccardo Schirone
9f3539023e io/section: r_io_section_offset_to_vaddr get section with mget, not vget
* core/cmd_print: adapt to io/section change
* core/cmd_print: print newline in print string json command
2015-09-07 13:40:49 +02:00
jvoisin
f7e426d281 Minor fixes for the previous commit 2015-09-04 15:35:37 +02:00
jvoisin
fbe8b6d938 Once again, clang-analyzer strikes! 2015-09-04 15:12:42 +02:00
Álvaro Felipe Melchor
1d4ebdeb25 some refactoring & added threads field in RDebug 2015-09-01 18:45:08 +02:00
Riccardo Schirone
eeef82c2b8 bin: use R_BIN_SCN_MAP flag when a section should be mapped by IO
- io/section: filter sections by looking at R_IO_MAP flag
- util/str: consider (m)apped flag when printing/parsing srwx info
2015-08-26 14:12:46 +02:00
pancake
48542c4b0a Linux: Close all filedescriptors except 0,1,2 on spawn 2015-08-26 03:18:50 +02:00
pancake
1efa0f2f7e Add asm.slow eval config var to speedup disasm
- Useful for slow io backends
2015-08-26 03:27:34 +02:00
pancake
53189dd87a Implement dd for OSX/iOS and Fix dd- and gs on OSX 2015-08-26 03:07:20 +02:00
pancake
030cb34f6d Add DebugPlugin->keepio to fix ffff regression in debugger 2015-08-24 16:44:09 +02:00
pancake
6aa8de37d6 Some code cleanup to enable emulator plugins read memory 2015-08-24 04:45:04 +02:00
pancake
ba49c8cefc Fix the tfp0 workaround for OSX (thanks @gdbinit) 2015-08-21 15:15:42 +02:00
pancake
f6c03ae340 Fix iOS build and integrate http://newosxbook.com/articles/PST2.html 2015-08-21 14:52:33 +02:00
pancake
dadc293986 Fix character devices support on FreeBSD (f.ex: /dev/da0) 2015-08-19 20:56:41 +02:00
pancake
701dd4a80e Add io.aslr and set it to false by default (used only for OSX atm) 2015-08-16 17:45:23 +02:00
yetmorecode
667cdecd37 Enhanced shell output for win32 native debugging
Fixed multiple whitespace issues
Removed unnecessary include for string.h
2015-08-11 09:17:23 +02:00
shuall
0807686d86 #3052 all printf member functions changed to cb_printf 2015-08-09 03:25:05 +02:00
pancake
83b9633ac2 Add iobind.section_vget 2015-07-28 03:29:16 +02:00
Álvaro Felipe Melchor
050c2fe9f8 Fix some COVS 2015-07-25 01:26:54 +02:00
pancake
0639261e26 Add more details for OSX code signing 2015-07-23 03:34:46 +02:00
pancake
fc0dc1ca1b Fix af in debugger mode 2015-07-21 13:38:34 +02:00
pancake
bdfbc4f076 Fix several COVs, and build issues related to appveyour 2015-07-13 11:21:21 +02:00
Jonathan Neuschäfer
ecf6792318 Fix #2927 and random code cleanups
- asm_dcpu16: remove an obsolete comment
  It was obsoleted in 5285d1bdea.
- Indentation fixes
- fix a few typos
- remove "#define NEW_ESIL"
- move comment about r_bin_filter_name to the right place
- README.md: Add V810 to the list of supported architectures
- Also, de-duplicate LH5801
- Add attribution to randomart.c, fixes #2927
2015-07-12 19:20:36 +02:00
Jonathan Neuschäfer
523aa3af5c add .version to all plugins 2015-07-12 19:05:33 +02:00
pancake
3eaef17d59 Fix COVs in r2web:// 2015-07-09 23:30:39 +02:00
pancake
ef29dd5f11 Refix the io analysis issues 2015-07-09 22:48:33 +02:00
pancake
a53b68deac Fix autocomment memref string regression 2015-07-09 21:46:18 +02:00
pancake
85752a5a44 Honor io.sectonly and fix mips tests mapping code without sections 2015-07-09 20:11:15 +02:00
pancake
8201fb3e3a Increase maximum ioread buffer to filetype id issue
- This must be fixed later for even bigger files
2015-07-08 21:41:17 +02:00
pancake
cae1d3c8cc Initial work to support ios-arm64 builds 2015-07-07 00:23:08 +02:00
pancake
c334632809 Add anal.noncode to avoid analyzing data by default
Fix double-free in core/anal.c
2015-07-05 01:44:45 +02:00
pancake
b5d40d11c0 Fix last coverities issues 2015-07-02 09:33:05 +02:00
Riccardo Schirone
d43080e679 io/p/io_debug,io/p/io_mach: use strtol instead of strcmp + atoi 2015-07-02 09:14:50 +02:00
pancake
3b5f5f3e5d More fixes for tfp0 and iOS codesign 2015-07-02 02:06:25 +02:00
pancake
02ab1d68a1 Add support for iOS tfp0 debugging 2015-07-01 20:05:47 +02:00
Álvaro Felipe Melchor
ccef928dfe Fix some COVs 2015-06-28 20:15:35 +02:00
pancake
e35274d31e Remove ior2pipe debug printf 2015-06-24 13:11:10 +02:00
pancake
04a2718657 Add version field in plugins, and check it before loading 2015-06-21 10:09:12 +02:00
pancake
8f25a9b344 Fix iOS build, crashes in reflines, analysis issues on OSX debugger and more! 2015-06-21 00:50:53 +02:00
pancake
26b579a600 Fix mach io issue that was showing up in analysis 2015-06-20 23:37:25 +02:00
jvoisin
9a7bf7751b Coverifix 2015-06-19 21:30:57 +02:00
pancake
c4d9f4ede9 Fix readblock issue in io_rap 2015-06-13 23:23:27 +02:00
pancake
f8b1f8e807 Fix iorap bug, disasm glitch, and comments are red now 2015-06-12 02:11:07 +02:00
pancake
57771a1ce4 Bump capstone, and fix a bug in io:rap 2015-06-11 13:59:20 +02:00
pancake
03aa69b261 Implement reverse rap for system() 2015-06-09 01:45:39 +02:00
pancake
9bbaa981b6 Initial import of r2web:// io plugin 2015-06-06 03:02:35 +02:00
pancake
96af02492a Add doc/rap 2015-06-06 01:49:27 +02:00
Álvaro Felipe Melchor
78d5a78609 Fix COVS 2015-06-04 21:27:41 +02:00
jvoisin
7c096bb1f4 Fix various coverity issues 2015-06-01 21:10:37 +02:00
pancake
5a32e683c8 Catch null in r2pipe json 2015-05-15 14:45:08 +02:00
pancake
0d3e8dd50c Fix buffer overflow in io-r2pipe 2015-05-15 12:35:32 +02:00
pancake
345ecce576 Fix some covs for io-r2pipe 2015-05-15 12:04:22 +02:00
pancake
967067ea9c Refactor r2pipe API into r_socket and fix w32 build 2015-05-14 02:50:57 +02:00
pancake
c9d10560b9 Initial import of the r2pipe-io plugin 2015-05-13 12:39:51 +02:00
condret
fcf4a5f081 fix #2443 2015-04-29 18:36:36 +02:00
Anton Kochkov
7e79b198b1 Fix some more Coverity issues
Fix CID 1171365
Fix CID 1211169
Fix CID 1230038
Fix CID 1295063, 1295062, 1295061
Fix CID 1295070
Fix CID 1295068
Fix CID 12950067
2015-04-19 04:53:08 +03:00
pancake
122ae7ea08 Fix oo use-after-free 2015-04-17 18:26:49 +02:00
pancake
6ff92a2b1d Fix afa- and o--;r- 2015-04-16 17:57:36 +02:00
pancake
997dda6e5b Add support for iOS-simulator and static-OSX builds 2015-04-14 17:14:43 +02:00
jvoisin
882a43994c Two simple coverifix 2015-04-11 21:07:12 +02:00
pancake
882a0ee164 Add --without-fork and r_sys_fork() 2015-04-11 05:00:05 +02:00
pancake
b4bbb2220c Fix visual regression and add dummy dalvik regprofile 2015-04-11 04:45:09 +02:00
condret
d619c9efc6 fix #2339 2015-04-10 13:12:05 +02:00
Jeffrey Crowell
6b2879c206 fix broken build
the last commit must have been 2 juicy for everyone
2015-04-02 21:59:11 -04:00
pancake
0e91eaaeda Fix some of the crashes produced by #2220 2015-04-01 16:07:23 +02:00
pancake
1a73f5e807 Handle <directory> in r2 as an alias for cd /path;r2 --
Remove noisy eprintf and fix another crash
2015-03-23 00:41:50 +01:00
pancake
ebbe450f38 Fix r2 -c 'o-*;s++' - use-after-free and other from #2220 2015-03-23 00:32:31 +01:00
pancake
ef6c71208d Fix tons of input crashes reported in #2220 2015-03-22 23:24:13 +01:00
pancake
b14bfc0be2 Fix #2185 - r2 -d shm://123 crash 2015-03-22 22:41:46 +01:00
pancake
515b2e77bc Fix about 40 COVs related to memleaks and buffer overflows 2015-03-21 01:27:54 +01:00
condret
55798119c7 fix #2206 2015-03-19 01:39:24 +01:00
fenugrec
752435bf1b io_ihex: Fixed >64k blocks parsing 2015-03-18 22:10:55 +01:00
fenugrec
0a515ae217 io_ihex: removed debugging output 2015-03-18 22:10:55 +01:00
fenugrec
a9b01e8410 io_ihex : read() and write() work, but write() always re-generates the file 2015-03-18 22:10:55 +01:00
fenugrec
cafcf4b0ab WIP: ihex:// plugin rework for sparse buffers & extended records 2015-03-18 22:10:54 +01:00
pancake
103ab99dc9 Fix some null derefs on io.write when no files opened
- Add missing wB in w?
- Make sys/duktape.sh happy for OSX
2015-03-17 20:27:59 +01:00
pancake
ce797309f5 Aim to fix #2185 2015-03-16 03:11:39 +01:00
pancake
595db83d93 Add RBufferSparse API and sparse:// io plugin 2015-03-16 01:19:25 +01:00
condret
c5bf697f03 fix a very evil bug that broke vio 2015-03-14 14:36:23 +01:00
condret
6a4edf5398 don't close all maps when closing 1 fd, add r_io_open_at to RIOBind for esil-init 2015-03-12 20:51:07 +01:00
Clément Vuchener
705e4d56bf Fixing arguments (bugs #1814 and #2117) #2143
Added proper escaping of command line
Creating a command line from arguments when debugging on Windows
Keep backslashes when not escaping a character
Assuming that the path of the binary should be in desc->name and not the command line in ptrace IO plugin
Print the backslash when it is at the end of the command line
2015-02-26 03:05:37 +01:00
condret
baae9b98d3 fix #2084 2015-02-24 14:45:52 +01:00
Kamil Rytarowski
345403f0ea Honor zip configure linkage 2015-02-23 01:07:05 +01:00
pancake
66ead9b96b Add ate command for the anal trace logs with ESIL (and backstepping)
- r2 -e dbg.trace=true -e anal.trace=true -d ls
> 10ds  # perform 10 steps
> ate   # show anal trace logs
> .ate `atek idx` # backstepping
> ate-* # clear logs
2015-02-22 11:40:55 +01:00
pancake
d21367f2ef Implement prg command to print raw gunzipped contents of block 2015-02-20 01:16:17 +01:00
jvoisin
defd2d0e96 Coverifix 2015-02-18 13:05:37 +01:00
pancake
4f24447620 Fix chrdev read and write support for OSX and iOS 2015-02-17 00:46:18 +01:00
pancake
ae367b65be Add support for UNIX Character devices 2015-02-16 22:40:05 +01:00
condret
6ae594b426 fix #2064 2015-02-12 22:48:11 +01:00
condret
ffd082fd5c fix a tiny io.cache-bug 2015-02-12 20:41:08 +01:00
jvoisin
b8cdd7c0f7 Even more coverifix 2015-02-11 21:51:13 +01:00
jvoisin
5ad3afb628 Coverifix 2015-02-11 17:55:25 +01:00
pancake
345f3be74e Fix possible null deref in r_io_read CID 1269284
- Remove unused r_yara.h
2015-02-11 11:25:23 +01:00
condret
0a7b7ed91e remove io.va=2 for vio to fix analysis for vio 2015-02-10 14:07:12 +01:00
condret
b93d08ebb7 enable switching to vio at runtime 2015-02-09 23:17:05 +01:00
pancake
f2351636fe Fix r_cons_readline() signature and some code cleanup 2015-01-31 00:50:05 +01:00