Commit Graph

1864 Commits

Author SHA1 Message Date
Álvaro Felipe Melchor
db28a0b20d fix hang in version info ELF 2016-06-21 16:42:34 +02:00
Álvaro Felipe Melchor
c5b6c78637 fix oob in dex 2016-06-21 12:44:43 +02:00
pancake
55e0804d1d Fix some null-terminated strings issues in the procfs parsing 2016-06-20 18:22:25 +02:00
pancake
414aef609f Refix the ELF phdr max size issue 2016-06-10 11:00:40 +02:00
Álvaro Felipe Melchor
93105250ab Handle bad PE files 2016-06-19 00:19:03 +02:00
pancake
43781f390a Code cleanup 2016-06-18 01:15:52 +02:00
pancake
e2ab783250 Fix for regression in thumb/arm detection 2016-06-17 23:05:13 +02:00
pancake
a46689b1b4 Fix oobread in ELF with 70d23ff5faa2716094f1fd1f081f9281678455dd 2016-06-17 17:16:41 +02:00
pancake
1629dd2b64 Remove two unused fields in RAnalOp and some deadcode 2016-06-17 14:26:24 +02:00
pancake
281d79da58 Remove some DEAD code and a copypaste error in coredump 2016-06-17 12:53:21 +02:00
pancake
f96f00d62d Fix #5158 - Merge r_db into r_util 2016-06-17 12:19:16 +02:00
pancake
48e5f8fc7e Fix ELF crash (null deref when missing shdr 2016-06-16 22:18:10 +02:00
Joshua J. Drake
176054c006 Fix ELF section size validation (#5148) 2016-06-16 16:43:04 +02:00
pancake
d3cae9d5a9 Show classname for static methods in DEX 2016-06-16 12:30:38 +02:00
pancake
b843aaf054 Fix imports and enhance parsing virtual methods in DEX 2016-06-16 05:04:00 +02:00
pancake
1111c00ea2 Better names for virtual Dalvik methods 2016-06-16 02:42:54 +02:00
pancake
b50a06f57c Load virtual methods from Dex files 2016-06-16 02:33:59 +02:00
Jeffrey Crowell
2f6d778aef cleanup usages of r_str_newf to meet style guide 2016-06-15 19:42:03 +00:00
pancake
794c60bf18 Fix #5138 - huge load times for fuzzed versioninfo ELFs 2016-06-15 15:30:51 +02:00
pancake
0e9e80c578 Fix #5138 - crash in elf parser 2016-06-15 15:13:41 +02:00
pancake
f5cb1db49b Fix identifying classes#.dex as DEX (not a BIOS) 2016-06-14 17:00:42 +02:00
pancake
e4af7f9b23 Fixes for ELF/Thumb detection handling 2016-06-14 14:36:03 +02:00
pancake
69e7b3df28 Fix UAF in bin.psxexe 2016-06-14 02:44:52 +02:00
pancake
59f94c63aa Fix some critical COVs in RBin 2016-06-14 02:42:24 +02:00
pancake
b25c520428 Do not realign non-code ARM symbols (strings and such) 2016-06-10 12:18:32 +02:00
pancake
24aec5be8c Fix all latest COVs 2016-06-07 10:03:04 +02:00
pancake
0845add4cf Implement relocs for ELF-powerpc 2016-06-07 00:12:45 +02:00
pancake
e8b8831b83 Fix elf-ppc endian bit 2016-06-06 23:18:21 +02:00
Álvaro Felipe Melchor
ecb0734988 Fix #5069 2016-06-06 22:58:07 +02:00
pancake
eb9feef231 Fixes for powerpc endian in mach0 and other issues 2016-06-06 22:57:22 +02:00
pancake
6b3fea1344 Fix #5068 - stack overflow in bin.xbe 2016-06-06 17:42:56 +02:00
oblique
f06e11b6f4 Fix warnings (#5078)
* Fix gcc warnings

* Fix strtoull return
2016-06-06 00:33:11 +02:00
pancake
2702c3f346 Initial regload support for linux-x32/64 coredumps 2016-06-02 14:16:57 +02:00
pancake
88b71663c0 Fix more trailing spaces in dwarf and comments 2016-05-31 23:37:17 +02:00
Álvaro Felipe Melchor
fa15260d21 some refactoring in pe format code (#5039) 2016-05-31 12:16:57 +02:00
Álvaro Felipe Melchor
8939958569 Fix #5040
oob read in init_dynamic_section elf format code
2016-05-30 21:51:18 +02:00
Sven Steinbauer
547f8bbc5c Infer fixes Round 2 (#4993) 2016-05-24 22:22:15 +02:00
pancake
d9636a9738 Fix some more clang analyzer warnings and cleanup 2016-05-24 14:54:34 +02:00
Anton Kochkov
9ff4056539 Fix CID 1356017 2016-05-24 08:59:26 +03:00
Anton Kochkov
5bc6323591 Fix CID 1356008 2016-05-24 08:57:36 +03:00
andrey.torsunov
2c25a8d503 Reduce memory leak for commands: oo, doo 2016-05-23 20:17:41 +02:00
Sven Steinbauer
8da8ad740f Cleanup fixes
* For commit comments and compiler errors
* Fixes for PR comments
* fix some "infer fixes" commits

Signed-off-by: Riccardo Schirone <sirmy15@gmail.com>
2016-05-23 11:25:44 +02:00
Sven Steinbauer
5cbcdf1da7 Infer fixes for bin
Signed-off-by: Riccardo Schirone <sirmy15@gmail.com>
2016-05-23 11:25:44 +02:00
pancake
5ae9f9b17f Fix endian issue in the ELF parser 2016-05-19 17:28:01 +02:00
pancake
f11eac73a9 Fix calloc(0) in mach0 spotted by clang-analyzer 2016-05-17 12:23:39 +02:00
Álvaro Felipe Melchor
6ea6301846 fix indentation mach-o/loader.h 2016-05-15 23:41:39 +02:00
Álvaro Felipe Melchor
aad08a0002 fix oob parse_signature in mach 2016-05-15 23:41:39 +02:00
Álvaro Felipe Melchor
647b4f29b5 Fix #4808 2016-05-13 21:52:28 +02:00
pancake
d898e8e201 Fix segfault in swift demangler 2016-05-13 17:53:31 +02:00
Álvaro Felipe Melchor
56099e9b67 fix issue when checking for oob - coverity scan 2016-05-11 23:14:51 +02:00
pancake
1b135bc93a Fix #4710 - Fix command injection in swift-demangle 2016-05-10 00:50:09 +02:00
Álvaro Felipe Melchor
b7cc6c04d7 LDID parse signature in mach0 binaries
* added iC command to show signature info

in the case of mach it shows entitlements

* added rabin2 -OC to get signature info from binary

* change swap to r_read_bleX new API

* change eprintf to r_cons_printf

* add const char in plg->signature
2016-05-09 23:42:28 +02:00
Damien Zammit
5e1ad580db build: fix warnings 2016-05-08 12:21:11 +02:00
pancake
cafc19f5a3 Demangle two more tests in Swift 2016-05-08 00:09:14 +02:00
Jeffrey Crowell
056f8a7efa fix div by 0 and memleak in elf.c
CID 1338361
CID 1355149
2016-05-07 00:39:28 -04:00
Álvaro Felipe Melchor
6c7d91c5c4 Fix #4749 - fix parsing dynamic section 2016-05-06 22:24:41 +02:00
pancake
51955396c2 Add comparator demangling in swift-sd 2016-05-06 10:39:44 +02:00
Damien Zammit
af0a865d9f WIP - Totally remove host endianness dependence
- Adds endian aware functions
- Removes references to host endian
- Uses binary detected endianness else tries LE and restricts by RAsmPlugin
- Fixes gdb debugger endianness when debugging BE qemu gdbserver

Signed-off-by: Damien Zammit <damien@zamaudio.com>
2016-05-04 23:42:17 +10:00
pancake
1b29487ba6 Fix all swift demangler oob reads 2016-05-04 15:32:57 +02:00
pancake
32fc67d63e Add support to demangle function extensions for Swift 2016-05-03 22:25:40 +02:00
pancake
bac256c65c Add support for protocol extension in Swift demangler 2016-05-03 05:26:23 +02:00
pancake
5014da9f1c Fix crash and autodetection in Swift demangler 2016-05-03 04:45:17 +02:00
pancake
6261fe32fb bugfixes + testsuite for the Internal Swift demangler 2016-05-03 04:31:36 +02:00
Álvaro Felipe Melchor
149c7567ed improve arm/thumb detection for .so 2016-05-02 23:00:53 +02:00
Álvaro Felipe Melchor
e805d701db Fix #4649 2016-05-02 18:24:34 +02:00
Riccardo Schirone
26fc8f92ef libr: remove some unused variables and functions 2016-04-27 12:59:45 +02:00
iessa alkuwari
cf39e0f12b load_omf_lname: char overflow 2016-04-25 19:05:58 +02:00
pancake
2b52b9a3e6 Demangle Swift classnames in rabin2 -c 2016-04-25 18:59:27 +02:00
pancake
d2fb776e8f Enhancements in demangler performance and for relocs 2016-04-23 02:02:03 +02:00
pancake
41cfbde641 Check once for xcrun/swift-demangle in PATH 2016-04-23 01:01:22 +02:00
pancake
fafc626b55 Performance optimization for rabin2 (request vs all) 2016-04-23 00:47:00 +02:00
pancake
a6e97491cb Fix #4666 - xcrun errors on swift binary 2016-04-23 00:13:34 +02:00
pancake
d1a409268d Fix #4686 - Segfault in ELF parser 2016-04-23 00:06:09 +02:00
NaveenBoggarapu
4c04b98b47 few memory leaks fixed 2016-04-13 21:55:48 +02:00
mkosmach
70f00feb8e Add reloc_type to "Unsupported relocs" message 2016-04-13 21:52:56 +02:00
pancake
910ec5d000 Fix conditional warning regression in format.pe 2016-04-11 13:14:35 +02:00
pancake
5ef2b3cc0f Fix many warnings 2016-04-11 12:22:15 +02:00
Álvaro Felipe Melchor
2f9229af43 fixed pe version info 2016-04-10 21:25:56 +02:00
Álvaro Felipe Melchor
8cd86c367e Fix oob read in pe 2016-04-10 18:43:32 +02:00
pancake
ddd6c18974 Fix #4572 - Fix heap bof in elf versioninfo parser 2016-04-10 02:00:52 +02:00
Álvaro Felipe Melchor
63990bef32 Fix #4589 2016-04-09 20:05:18 +02:00
skuater
917bd004cc r_bin_per_import fixed for tiny files 2016-04-09 19:54:12 +02:00
Álvaro Felipe Melchor
400664a25c Fix #4571 - thx revskills 2016-04-09 19:09:09 +02:00
Álvaro Felipe Melchor
8009d35f13 Fix #4576 - thx revskills 2016-04-09 17:07:20 +02:00
Álvaro Felipe Melchor
8ba4c5b959 Fix #4585 2016-04-09 16:28:45 +02:00
Álvaro Felipe Melchor
79c7e5ec1f Fix #4587 - thx @revskills 2016-04-09 16:19:54 +02:00
Álvaro Felipe Melchor
60e64d49bf Fix #4563 - thx @revskills 2016-04-09 13:46:08 +02:00
Álvaro Felipe Melchor
fe0ea49a6f Fix #4577 - thx @revskills 2016-04-09 13:01:15 +02:00
Álvaro Felipe Melchor
38452b4052 Fix #4581 - thx @revskills 2016-04-09 12:49:09 +02:00
Álvaro Felipe Melchor
68d4a43aad Fix #4578 - thx @revskills 2016-04-09 12:28:26 +02:00
Álvaro Felipe Melchor
c711dfabdd remove another stray character 2016-04-09 12:06:38 +02:00
Álvaro Felipe Melchor
e7d4fdfd30 remove annoying stray character 2016-04-09 11:49:05 +02:00
Álvaro Felipe Melchor
df4cb535f0 Fix #4580 - thx @revskills 2016-04-09 11:47:35 +02:00
Álvaro Felipe Melchor
91e161a626 Fix #4568 - thx @revskills 2016-04-09 11:39:49 +02:00
Jeffrey Crowell
0503b3e741 fix #4579
ty revskills
2016-04-08 21:41:22 -04:00
Álvaro Felipe Melchor
041fc7423a fix #4539 - null dereference 2016-04-07 21:16:55 +02:00
pancake
5867365cd5 Add dummy work for mach0 in rabin2 -O 2016-04-07 15:42:06 +02:00
Anton Kochkov
c481971fc8 Fix CID 1353776 2016-04-06 00:49:14 +03:00
Anton Kochkov
858d06c361 Fix CID 1331116 2016-04-06 00:46:55 +03:00
Anton Kochkov
45720df1ef Fix CID 1353771 2016-04-06 00:41:07 +03:00
pancake
c834239830 Find strings in more sections for PE binaries 2016-04-05 13:30:10 +02:00
Anton Kochkov
5b3f52f0b6 Fix CID 1353777 2016-04-05 11:59:58 +03:00
Álvaro Felipe Melchor
114ad79b95 fix xtr dyldcache 2016-04-04 23:28:02 +02:00
Álvaro Felipe Melchor
fc4f2a2a38 fix minor things to be able to load dyld 2016-04-04 23:28:02 +02:00
Álvaro Felipe Melchor
b0c6ae4409 Fix #4295 and #4155
This commit is the first attempt to improve relocation
recognition when dealing with relocatables elf-files
2016-04-04 23:09:58 +02:00
pancake
32162ef393 Add r_buf_new_file API 2016-04-04 22:30:11 +02:00
pancake
d0ddc1a226 Fix crash in bin.elf.has_canary 2016-04-04 02:15:31 +02:00
pancake
740e43eadd Fix some segfault and consistencies 2016-04-04 01:59:30 +02:00
pancake
54fe1ae941 Fix uaf and another memleak 2016-04-04 00:36:18 +02:00
pancake
e8263655be Fix more memleaks 2016-04-04 00:17:57 +02:00
pancake
c9514302bf Fix some lifecycle memory leaks 2016-04-03 23:52:36 +02:00
Álvaro Felipe Melchor
593b6c85e5 Fix #4481 2016-04-03 17:02:47 +02:00
pancake
05c5ffe23e Add two missing MH flags for mach0 binaries 2016-04-01 12:10:30 +02:00
Álvaro Felipe Melchor
cd85e12a31 fix some memory leaks 2016-03-31 23:01:02 +02:00
pancake
c2b151f8c8 Fix a lot more covs 2016-03-31 13:21:51 +02:00
pancake
ef317a026b Fix #4462 - null deref in elf parser 2016-03-30 22:54:48 +02:00
michalbednarski
dfb3680298 Fix NULL dereference of Elf_(Verdaux) *aux 2016-03-30 16:03:52 +02:00
pancake
33d6a27441 Add more op.val for x86 2016-03-30 16:01:16 +02:00
pancake
fa8fc09843 Add support to load MACH0 Core files 2016-03-29 18:40:29 +02:00
pancake
d629165ec8 Remove unnecessary = NULL in bin/p/*.c 2016-03-27 23:02:29 +02:00
pancake
c451637967 Chop swift-demangle output 2016-03-24 16:27:00 +01:00
pancake
5ed68fbb72 Enhance swift-demangle support 2016-03-24 12:27:23 +01:00
pancake
8abcab79d3 Support xcrun swift-demangle for OSX 2016-03-24 00:49:43 +01:00
pancake
273b20294e Add support for swift-demangle if found in PATH 2016-03-24 00:20:59 +01:00
Adrien Garin
10de21de7e RBin: fix PE and ELF versioninfo
PE parser is now able to get the StringTable value even if the
wValueLength of the structure is incorrect.

Fix a regression with ELF versioninfo.
2016-03-18 18:35:05 +01:00
Evan Shaw
2ad75b67ec Fix NES memory mirroring
The mirror lists were never actually allocated.
2016-03-18 13:43:43 +01:00
pancake
bab0eb62c8 Fix sdb leaks in elf versioninfo 2016-03-17 11:11:12 +01:00
Álvaro Felipe Melchor
7e5fd3d11f Fix versioninfo crashes elf 2016-03-16 18:10:49 +01:00
Adr1
ab5792d132 RBin: improving versioninfo
Store ELF versioninfo in Sdb.
Display VS_FIXEDFILEINFO for PE.
2016-03-16 18:10:49 +01:00
Dax89
b9c34953a1 PSX Plugin: Use capstone disassembler, look for strings in TEXT segment 2016-03-16 16:45:49 +01:00
Evan Shaw
9f1ef0d721 Reduce OMF format false positives
While developing the SNES bin plugin, I noticed some SNES ROMs were wrongly
detected as OMF.

This commit adds two additional checks to check_bytes:

* Check that record size and string size in the first record agree with each other
* Check that the string in the first record is valid ASCII

Regression tests still pass.

This commit also fixes an assumption that the host is little endian.
2016-03-16 10:36:26 +01:00
Álvaro Felipe Melchor
9feae374f4 Fix oob read when demangling stripped binary 2016-03-13 19:19:03 +01:00
Álvaro Felipe Melchor
73a7427396 Fix #4302 - dynamic segment struggles 2016-03-13 19:19:03 +01:00
Aneesh Dogra
236fc3213d Fix protype warnings for pe checksum. 2016-03-13 01:35:20 +01:00
Álvaro Felipe Melchor
879e7f411f Fix build 2016-03-12 13:38:17 +01:00
Álvaro Felipe Melchor
bbd597228e Fix segfaults in pe checksum 2016-03-12 13:30:41 +01:00
Aneesh Dogra
5c3f5904ea Add a way to compare claimed CRC (in header) of PE files with the actual CRC. 2016-03-12 11:22:55 +01:00
pancake
977aeb8173 Show entrypoint type info in rabin2 -e and ie 2016-03-12 11:16:42 +01:00
Aneesh Dogra
0e3d4bf773 PE: Add support for parsing TLS and add TLS callback addresses to the list of entry points.
Only add the address if its valid.
2016-03-12 11:04:25 +01:00
Álvaro Felipe Melchor
b567b72171 added IFDBG on version info code to avoid those annoying messages 2016-03-09 23:15:43 +01:00
Jeffrey Crowell
f6739ec3be fix memleak in elf.c 2016-03-09 00:55:16 -05:00
Álvaro Felipe Melchor
19068d41d6 Fix oob read improving version info code elf - thanks @revskills 2016-03-08 22:16:10 +01:00
Maijin
e25992278c Add cabinet.dll ordinal file 2016-03-07 17:58:29 +01:00
pancake
02abba69f1 Fix #4253 - 1 byte oob read in mach0 2016-03-07 13:23:01 +01:00
pancake
588e264f9f Fix latest COVs 2016-03-07 12:54:40 +01:00
pancake
f7e99c93e7 Fix #4241 - OOB read in rabin2 -V (versioninfo for ELF) 2016-03-07 00:37:27 +01:00
Matthieu Tardy
bb84bbc276 Fix memory leaks in rabin2 and libr 2016-03-06 23:17:44 +01:00
pancake
92ad561fea Fix latest coverities 2016-03-05 20:46:04 +01:00
pancake
bb79d30444 Fix two infinite loops in the version info parsing for ELF 2016-03-04 16:15:00 +01:00
pancake
36d7e5a412 Fix warns in smd bin plug 2016-03-04 15:45:54 +01:00