2764 Commits

Author SHA1 Message Date
pancake
4410e26070 Implement Computed CDHash for mach0 binaries 2018-09-16 21:05:51 +02:00
Paul I
bf29250ddd Fix #11487 (#11534) 2018-09-15 22:52:12 +02:00
Dimitris Karagkasidis
e238026086 Fix #11399 Use-after-free and a memory leak in handling of WASM binaries (#11533)
* Fix issue #11399: use-after-free in symbols()

Commit 7e083b57f introduced the issue #11399. The list referenced by
`codes` in entries(), is the same list that bf->g_codes is pointing at.
By freeing it, we introduce a use-after-free condition in a later call
to symbols(), where we try to iterate over the list that bf->g_codes
was supposed to be referencing.

* Fix memleak during loading of WASM binaries

A memory leak is reported by ASAN when handling WASM binaries. It is
caused by multiple allocations of RBinInfo structure. First, RBinInfo
is allocated within a call to size() from r_bin_object_set_items(). Then
there is another, explicit allocation of an RBinInfo structure through
a call to the info() callback of the WASM RBinPlugin. This causes loss
of reference to the initial structure, and subsequently a leak.

There are no apparent uses of RBinInfo structure inbetween these two
points, and the size() result is in no way dependent on this structure,
therefore I resolved the memory leak issue by removing the allocation
from within the size() function.
2018-09-15 22:51:38 +02:00
David CARLIER
fc2d054505 Fix golang binaries support. (#11525)
Spotted with go_stripped t/case
2018-09-15 13:53:08 +08:00
fcasal
0ad81b1a7f Detect golang by looking at golang sections. (#11520) 2018-09-14 14:54:00 +02:00
David CARLIER
7ecbaafed3 Little update for sanitizer detection for ELF (#11521)
Spotted with FreeBSD and asan/tsan.
2018-09-14 13:00:40 +02:00
pancake
d521843ae7 Use RStrBuf in pkcs/x509/asn1 APIs, use RCons from RCore to print that 2018-09-14 10:29:49 +02:00
Giovanni
899719389f ASN.1 BER support, with pF[apx] (#11517) 2018-09-14 01:44:04 +02:00
David CARLIER
c64fb327e7 Detect binaries compilers with sanitizers (#11479) 2018-09-13 12:11:09 +02:00
pancake
885f9efeb0 Fix last covs and add $e{} in RNumCallback 2018-09-13 11:16:27 +02:00
Neven Sajko
4a722e80d8 Add braces to if, else, for, while ... (#11504) 2018-09-13 10:17:26 +02:00
pancake
35bd0fbf06 Add pFo, parse certs from mach0's cdhash and minor x509 cleanup 2018-09-13 01:15:18 +02:00
radare
3cc11aa9fe
Some cleanup in ASN1/X509/PKCS7 to make pF work (#11499) 2018-09-12 18:43:59 +02:00
radare
4bb4a2ce30
Parse CodeSign blobs and compute sha1/sha256 in mach0 binaries (#11491)
- rabin2 -OC # wip requires proper refactoring and redesign
2018-09-12 16:03:36 +02:00
Maijin
394d125b79
Check canary with symbols fix #11477 2018-09-11 14:00:12 +02:00
Maijin
2b8c94c2cf Fix #11418 dbg_file in full (#11453) 2018-09-10 16:25:50 +02:00
Giovanni
1dbdabf83c C-Sky and MCore support for r2 (#11448) 2018-09-08 19:52:33 +02:00
Maijin
e935992de5 More verbose idpd 2018-09-08 13:11:10 +02:00
David CARLIER
09e8ccead3 Redo the previous PR. (#11415)
Fix couple of memory leaks only removed
one faulty line which led to garbage.
2018-09-06 12:43:50 +02:00
Riccardo Schirone
1b32083995 Travis was green (#11408)
* anal_x86: keep same syntax and POP value out of esil stack in push sp

NOTE: The other syntax was causing issues in afta, not sure why

* Revert "Further mem leak fixes (#11398)"

This reverts commit 38d9170f5da82ece05d1b90e366763999e633e34.

* anal_x86_cs: just use one expression for the PUSH x86 operation

* libr/core/cmd: set core_sysenv only when calling external scripts
2018-09-06 03:51:02 +02:00
David CARLIER
38d9170f5d Further mem leak fixes (#11398) 2018-09-05 14:56:29 +02:00
David CARLIER
89d6b8138c Fix couple of minor issues. (#11388) 2018-09-05 11:01:07 +02:00
radare
69e5499f69
Fix last coverity issue found in the ELF parser (#11369) 2018-09-03 23:47:02 +02:00
Riccardo Schirone
eee1385466
Meson private (#11331)
* meson: refactor library cflags
* meson: use visibility=hidden by default
* remove unused var
* magic/meson: replace tabs with spaces
2018-09-03 10:07:28 +02:00
Khairul Azhar Kasmiran
e5b5715be3 Fix #11307 - Fix an ELF clusterfuzz crash (#11354) 2018-09-02 10:41:32 +02:00
Khairul Kasmiran
25d3aa97f9 Add confidence-building promotion 2018-08-30 20:48:20 +08:00
Neven Sajko
d8784641ee Add parentheses in macros where needed for safety (#11290) 2018-08-30 13:16:50 +02:00
Fangrui Song
c69682c001 Extract bin_pe{,64}.c common parts to bin_pe.inc (#11292) 2018-08-29 20:20:05 +02:00
Khairul Azhar Kasmiran
7300d12505 Fix #11235 - Fix one more clusterfuzz crash (#11296) 2018-08-29 20:19:06 +02:00
Riccardo Schirone
6a66a9701e mdmp: fix googlefuzz crash (#11298) 2018-08-29 20:17:28 +02:00
Riccardo Schirone
e6e12f42d5
Fixes #10903: slow bins (#11294)
* mach0: use ut32 because those fields are unsigned in Mach0
* bin_mach0: do not process section if it cannot be read
* bin_vsf: detect infinite loop
2018-08-29 15:19:21 +02:00
Khairul Azhar Kasmiran
65ebf72e66 Fix #11227 - Fix another clusterfuzz crash (#11291) 2018-08-29 10:19:33 +08:00
Khairul Azhar Kasmiran
4042f87239 Fix iM paddr when it's from the main symbol (#11253) 2018-08-27 16:09:32 +02:00
Fangrui Song
05fd10fd53 Fix memleak in elf.c symbols_by_ord_size (#11255) 2018-08-26 14:15:36 +02:00
Fangrui Song
703ae306cc Extract bin_write_elf.c common parts to bin_write_elf.inc 2018-08-24 15:57:05 +02:00
Fangrui Song
e7de8b082f Extract bin_elf.c common parts to bin_elf.inc and #include bin_elf.inc instead of bin_elf.c 2018-08-24 15:57:05 +02:00
Khairul Azhar Kasmiran
6436cc5934 Fix rabin2 -ee paddr (#11210) 2018-08-23 14:33:26 +02:00
Khairul Azhar Kasmiran
8a5d6195a0 Fix bin_mdmp.c -Wstringop-truncation warnings for #10338 (#11192) 2018-08-22 13:19:27 +02:00
radare
1c83586844
Fix rabin2 -H on 32bit mach0 binaries (#11190) 2018-08-22 13:15:43 +02:00
pancake
6d05365f30 Make RAsmOp use RStrBuf instead of fixed-size buffers
* Seems to work, but there are many things to improve and fix
* Fixed some bugs (overflow, sandbox bypass, ..)
* Exposes some memleaks and bad api usages.
* Refactor all the things! \o/
* Fix z80, tms320 disasm and x86.as
* Care about memleaks
* Support meson
* And fix more tests related to pda and pdj and m68k
2018-08-22 11:43:05 +02:00
Khairul Azhar Kasmiran
2413ef6d93 Fix #11150 - Fix clusterfuzz mdmp crash (#11183) 2018-08-22 11:01:16 +02:00
Khairul Azhar Kasmiran
4da4f4bb0f Fix #11126 - fix clusterfuzz dex crash (#11169) 2018-08-22 02:48:28 +02:00
Paul I
620affc89e Fix some warnings (#11152) 2018-08-20 14:52:02 +08:00
Fangrui Song
5baec7197d bootimg: rename ALIGN to ROUND_DOWN to avoid conflict with /usr/include/machine/param.h on FreeBSD (#11153) 2018-08-19 21:58:29 +02:00
pancake
bfecffe2fe file is not yet bfile 2018-08-19 17:20:48 +02:00
pancake
26d50c31da Fix memleaks in RBin 2018-08-19 16:39:55 +02:00
Fangrui Song
2ea5f62d14 Remove #pragma pack to suppress -Wpragma-pack-suspicious-include (#11114)
These structs are defined in the way that no #pragma pack is needed.
2018-08-18 03:43:46 +02:00
pancake
40c97aacc3 Fix underflow in omf 2018-08-18 03:39:13 +02:00
pancake
10052884ec Fix crash in dex parser 2018-08-18 03:38:53 +02:00
pancake
7e083b57fb Fix last coverities (2 memleaks) 2018-08-17 17:38:24 +02:00