83 Commits

Author SHA1 Message Date
Aswin C
8c8c318d5c
Add internal help for dmhj ##cons (#17902) 2020-11-10 13:19:37 +08:00
Anton Kochkov
87b10ed586 Fix formatting warnings 2020-11-02 18:58:37 +08:00
Anton Kochkov
afba51ce98 Fix format warnings in libr/core 2020-10-22 13:37:25 +08:00
meowmeowxw
3ffe3f88d2
Add commands to parse mangling pointers glibc heap ##heap (#17534)
* Add dmhtm for tcache mangling pointers

* Add dmhfm for fastbins with mang ptrs

* Add dmhfm <n> for fastbins

* Pointer mangling support to dmh

* Fix spacing for PROTECT_PTR

* Add fastbins checks for dmh

* Clean code for next_pointer

* Use ternary operator when possible

* Add dbg.glibc.demangle option

* Set correct initial_brk for multi-glibc support

* Remove comments and unneeded variables

* Remove 'm' commands, use demangle variable

* Update description of dbg.glibc.demangle

* Test for tcache 2.32 and remove old ones

* Force tests

* Solve insidious bug of filenames

* Fix dmh test and more tcache testing

* Remove unused variables
2020-09-01 00:45:12 +08:00
meowmeowxw
118e5bbefd
Speedup (10x) glibc's main arena resolution using malloc hooks ##debug (#17187) 2020-07-22 14:20:06 +02:00
meowmeowxw
4b02987666
Fix tcache parsing on glibc version < 2.30 (#17206) 2020-07-08 20:16:27 +08:00
meowmeowxw
1faed017c7
Heap glibc resolve main_arena using symbol (#17018) 2020-06-18 12:14:21 +02:00
Alexis Ehret
ef07476e38
Fix various lgtm warning (#16497)
* Wrong type of arguments to formatting function root/shlr/mpc/mpc.c
* Overflow in uncontrolled allocation size ./libr/socket/run.c
* Multiplication result converted to larger type ./libr/core/cmd_print.c
* Multiplication result converted to larger type ./libr/bin/p/bin_dyldcache.c
* Multiplication result converted to larger type ./libr/core/linux_heap_glibc.c
* Multiplication result converted to larger type ./libr/core/visual.c
* Comparison of narrow type with wide type in loop condition ./libr/core/p/core_java.c
* Fix various warning -Wall ./libr/core/p/core_java.c
* Multiplication result converted to larger type ./libr/bin/format/mach0/mach0.c
* Multiplication result converted to larger type ./libr/util/print.c
* Multiplication result converted to larger type ./libr/asm/asm.c
* Fix small warning python
* Fix type error and declaration inside loop
* Reset mpc
* replace size_t
* Fix space missing, type and format
2020-04-12 20:45:24 +02:00
Florian Märkl
9a2effd5ed
Use RPVector for io->maps - speedup map traversal ##io
- The 64K section bin now loads in 15s instead of 26s
2020-04-07 12:43:41 +02:00
radare
5e4cdaaa04
Always use r_getopt, do not depend on libc (not just on windows) ##core (#16325) 2020-03-27 17:06:40 +01:00
Khairulmizam Samsudin
80f59a7c5f
Fix dmht for glibc caused by wrong tcache offset and definition (#16247)
* Add new function to obtain tcache chunk size

* Fix tcache address and offset in print_tcache_instance()

* Fix tcache_perthread_struct definition

* Update fc_offset to actual size of tcache

* Add test

* Rename test bin filename
2020-03-26 00:27:36 -05:00
pancake
6af14d7a80 Fix coverity 2020-03-25 13:00:27 +01:00
Khairulmizam Samsudin
4a5161e454
Test dmha/dmh for glibc x64 (#16307)
* Minor printing fix
* Test for dmh/dmha
2020-03-25 17:43:57 +08:00
Khairulmizam Samsudin
2e85324bba
Minor fix to get dmh to work with riomap (#16286) ##debug 2020-03-23 16:25:55 +01:00
Khairulmizam Samsudin
6a327d95de
Detect glibc version and set dbg.glibc.tcache accordingly (#16255) ##debug 2020-03-19 15:26:12 +01:00
Khairulmizam Samsudin
676cd8a49c
Fix chunk listing with tcache and add test (#16239) ##debug 2020-03-17 12:05:41 +01:00
Anton Kochkov
0c46c3e1e3 Some coverity fixes 2020-01-08 14:16:11 +01:00
Anton Kochkov
e11b2a9145
Some Coverity defect fixes (#15626) 2019-12-13 11:25:19 -06:00
pancake
c1ebfa5d1b Fix crash in dmh on Frida 2019-05-02 12:53:03 +03:00
MK
6030783c7a Code refactoring for the theme based colorization to reduce derefs - dmh commands set ##cons (#13906) 2019-04-27 10:55:18 +02:00
t1t0
6e87777b69 Displaying chunk flags as bits ##debug
The 'display' routine of the malloc_chunk should display each field of
flag field as bits.

So prior to this proposal, `dmhc` could yield following information:

```
struct malloc_chunk @ 0x7f5462ed4000 {
  prev_size = 0x0,
  size = 0x1112000,
  flags: |N:4 |M:2 |P:1,
```

The flags should be displayed as: `flags: |N:1 |M:1 |P:1`
2019-03-14 11:50:36 +01:00
pancake
38a0343e62 Implement visual decompiler and fix the RConfigHold API ##disasm 2019-03-04 02:44:13 +01:00
d-we
57e63d8f82 Fix regression in dmh's brk_end calculation (#12791) 2019-01-15 10:38:08 +01:00
radare
ab3a7be704
Almost completely kill RIOSection from io and core (-218LOC) ##refactoring
* Use RBinSection, RDebugMap or RIOMap instead
* Remove omps command
* Fix segfault in ?E+
* Improve anal.eobjmp (bug spotted after almost killing iosections)
2019-01-13 03:07:51 +01:00
lzutao
50320592a6 Fix #12060 and #12072 - Rewrite r_num_abs and r_num_units ##core
r_num_abs:

- Make r_num_abs static inline
- Use unsigned long long type when defining TB macro
- Use st64 instead of long long

r_num_units:

- Add len argument for buf in r_num_units
- Add PB and EB for r_num_units
- Always display one number after decimal point

  * This change simplifies the code
- Use long double type as assigning from ut64 to double cause data loss

r_num_tail_base:

- Use isxdigit (fast) instead of isHexDigit (slower)
- Rename nth to get_nth_nibble

Update all functions to use with new r_num_units:

- Remove side effect when using in other functions like cb_printf

* Trim trailing .0 when input is power of 2
2018-11-14 23:35:44 +01:00
Collin Reilly Clark
c595ebe447 remove duplicate word
This address is is not part of the arenas -> This address is not part of the arenas
2018-10-21 01:23:50 +02:00
radare
e7d3706b8f
Fix gcc8 warnings and rename core/asm.c to casm.c ##refactor 2018-10-20 01:23:15 +02:00
MK
3c74828055 Fix #11856 dmh puts "No Heap section" error msg twice (#11857) 2018-10-19 02:02:38 +02:00
Riccardo Schirone
ab4578a546
remove random warnings when compiling (#11767)
* remove random warnings when compiling

* debug_native: provide r_debug_handle_signals on windows
2018-10-08 13:21:50 +02:00
pancake
816463ed70 Fix warnings in dmh 2018-10-08 11:33:51 +02:00
morbith-dqtz
6c34858e56 linux_heap_glibc: debug heap at core file and avoid using symbols for global_max_fast assuming always the max sixe for the arch (#11632) 2018-09-25 09:59:05 -07:00
morbith-dqtz
387b9d964b linux_heap_glibc : locate main_arena without computing symbol offsets (#11615) 2018-09-22 00:11:22 +02:00
morbith-dqtz
5c6b976343 linux_heap_glibc: refactor (#11541) 2018-09-17 02:00:39 +02:00
morbith-dqtz
1ee0b58709 11471 Quick fix, setting dbg file via config (#11476) 2018-09-12 11:56:01 +02:00
morbith-dqtz
0baadb414c linux_heap_glibc: fix dmhf and allows dmhf @thread_arena (#11441) 2018-09-08 12:29:31 +02:00
morbith-dqtz
a95fb331da linux_heap_glibc : dmha and dmht, check threaded arenas free status (#11390)
Only parse tcache if isn't freed otherwise parses trash
Print free if the threaded malloc is
free'em all!
2018-09-05 11:24:41 +02:00
morbith-dqtz
2806266c36 linux_heap_glibc : (#11382)
Fix first chunk offset for tcache mmaped heap
Frees temporary sctruct at tcache checkout
Removes "size_tmp > top_size" :
   This control declare chunk as corrupted if its size is grather
   than size that figures in the top_chunk size filed
2018-09-03 23:53:38 +02:00
Riccardo Schirone
70aa10fc08 linux_heap_glibc: variable should be declared outside if/else blocks 2018-09-03 11:19:26 +02:00
morbith-dqtz
a8433785b9 Update two preprocessor directives left (#11366) 2018-09-03 10:43:33 +02:00
morbith-dqtz
909a502847 Parsing tcache at threaded arenas (#11357) 2018-09-03 02:49:46 +02:00
morbith-dqtz
89edd04cec Fix dmh at addresss with tcache (#11359) 2018-09-02 22:05:03 +02:00
morbith-dqtz
5c0eaa71f1 linux_heap_glibc: Fix threaded arenas following (#11328) 2018-09-01 03:05:47 +02:00
David CARLIER
0c83963f79 Fix warning. (#11330) 2018-08-31 13:51:09 +02:00
Riccardo Schirone
12f70b2169 linux_heap_glibc: avoid var declaration inside for (#11324) 2018-08-31 12:23:15 +02:00
morbith-dqtz
3afc8cd8c1 heap tcache flgs fixes (#11282)
* now glibc tcache parsing if checked by a config flag, no more preprocessor

* * calls r_resolve_symbol to recompute malloc_state offset
* fix cpu autodetect for tcache flags
2018-08-28 13:00:38 +02:00
morbith-dqtz
e09306ab99 Make glibc tcache parsing if checked by a config flag, no more preprocessor (#11266) 2018-08-26 22:50:30 +02:00
morbith-dqtz
fcb5a3e07f Fix offset to main_arena in libc6-2.27 x64_32 (tested in debian and kali 32 bits) (#11147) 2018-08-19 15:50:31 +02:00
pancake
95d346b611 Fix #10674 - pzq and gcc build 2018-07-09 01:13:29 +02:00
morbith-dqtz
a7b9b7e37a two fixes for working with heap in 32bits (#10625)
* fix hash calculation of libc-dbg file (debian9 32bits)
fix heap dmh for tcache in 32bits (debian9 testing 32bits)
2018-07-08 15:19:45 +02:00
Rene Laemmert
ce9039da8b Removed bin_load from linux_heap_glibc.c (#10635) 2018-07-08 01:08:36 +02:00