Commit graph

1831 commits

Author SHA1 Message Date
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
pancake
6c9a44baf1 Fix oob reads in versioninfo for ELF 2016-03-04 12:08:29 +01:00
pancake
cacef87fcb Fix crash introduced in the rabin2 -V thing 2016-03-04 02:19:30 +01:00
pancake
b7ed999581 Use eprintf in the rabin2 -V versioninfo (for now) 2016-03-04 01:25:04 +01:00
Adr1
611c3d1752 RBin: Display File Version info 2016-03-04 01:15:56 +01:00
pancake
3624931cde Use proper endianness in SMD plugin 2016-03-03 14:15:17 +01:00
pancake
7a1993b057 Fix str_case regression 2016-03-03 11:45:04 +01:00
pancake
5234d3c1ac Do not use size_t for iterators 2016-03-03 11:29:41 +01:00
pancake
c4e8864e7d Build fixes 2016-02-29 00:04:31 +01:00
Martin Heistermann
ba9657df83 Fix relocation parsing for malformed files. 2016-02-28 02:43:25 +01:00
Martin Heistermann
fbd0905c56 Add initial indirect relocation (irel, ifunc) support. 2016-02-28 02:43:25 +01:00
Martin Heistermann
e528ce8dfe Refactor elf_specs.h to use the original glibc 2.22 elf.h.
Previously, elf_specs.h was an old(!) copy of glibc's elf.h with a few
additions accumulated over time.

This commit introduces a clear separation between an unmodified (save
one explanatory comment and a removed #include) copy of elf.h called
glibc_elf.h (elf.h already exists here), and elf_specs.h, which includes
the former file and only contains the required changes.

Updating glibc_elf.h in the future should be as easy as copying the file
from glibc and potentially deleting obsoleted parts of elf_specs.h.
2016-02-28 02:43:25 +01:00
Anton Kochkov
faf789b4e8 Fix CID 1351416 2016-02-25 13:21:06 +03:00
pancake
3e1590f4d9 More fixes for MIPS and ESIL emulation 2016-02-22 01:43:45 +01:00
pancake
100df3bb32 Better MIPS32BE ELF relocs, add Rx regs in mips.cs and add scr.wheelnkey, nN defaults to flag now 2016-02-21 01:56:50 +01:00
pancake
3c1a4eb040 Implement relocs for MIPS32 big endian ELF binaries (openwrt) 2016-02-21 00:56:01 +01:00
Riccardo Schirone
5d08aee9af bin/demangle: fix possible SEGV when dereferencing binfile 2016-02-18 13:52:31 +01:00
William Robinet
0c7cacc2dc Fix typos 2016-02-16 23:21:24 +01:00
pancake
3140749266 Fix #4095 - Export RBinSection info for mach0.la_symbol_ptr 2016-02-16 02:58:29 +01:00
pancake
384cfb1042 Fix last coverities 2016-02-16 02:08:09 +01:00
pancake
a93805475d Add VideoCore support in RBin.ELF 2016-02-15 16:04:37 +01:00
pancake
d8ab2fb55f Handle LANAI in the ELF plugin 2016-02-15 14:12:30 +01:00
Álvaro Felipe Melchor
feaaab517b demangle afl and disassembly 2016-02-11 01:32:36 -06:00
Jeffrey Crowell
aaf92c4e8e Gesmdis isn't a thing. Should be Genesis. 2016-02-10 13:16:08 -05:00
pancake
d0f0629655 Remove unnecessary memcpy 2016-02-06 22:44:51 +01:00
pancake
f2079db4ad Fix fatmach0 2016-02-04 18:02:09 +01:00
pancake
f5181c4d90 Initial rework for dyldcache 2016-02-04 15:44:49 +01:00
pancake
b08892dbb3 Fix Tricore warnings and handle in ELF 2016-01-30 02:58:45 +01:00
pancake
7d91280e5c Handle EM_XTENSA bit in ELF header 2016-01-29 00:06:28 +01:00
deffi420
0113d2a0d3 Add missing quotation mark in elf_version enum
Silences a warning on loading ELF definitions
2016-01-28 23:17:44 +01:00
pancake
44a86928cc Fix some of the warnings in #4013 2016-01-27 03:14:19 +01:00
Jeff Muizelaar
995409bfe2 Parse SHORT PDB type 2016-01-26 21:51:03 +01:00
deffi420
f4bce2b425 Handle elf_phdr/elf_shdr enums in elf.c
... and refactor a little.
2016-01-26 09:39:22 +01:00
deffi420
028df44c9d Add type and flags enums to elf_[ps]hdr structs 2016-01-26 09:39:22 +01:00