Commit graph

385 commits

Author SHA1 Message Date
Álvaro Felipe Melchor
93a721f614 Fix #1846 - full and partial relro elf 2015-10-06 18:27:42 +02:00
pancake
9712a62b62 Fix #3296 - Identify main in thumb-elf bins 2015-10-03 14:16:08 +02:00
pancake
8f79f82048 Fix 0576be2359 2015-09-25 10:49:27 +02:00
jvoisin
0576be2359 Small optimizations and coverity-- 2015-09-25 01:51:29 +02:00
pancake
46f8561986 Fix rabin2 -E crash and filter in elf 2015-09-23 13:24:10 +02:00
pancake
ec0b19e5f8 Fix thumb entry assumption (thx @ret2libc) 2015-09-17 11:13:34 +02:00
pancake
f10c8ec075 Fix #3296 - Thumb ELF entrypoint assumption 2015-09-17 01:32:13 +02:00
pancake
49975ccf95 Fix #3286 - Use stdbool.h 2015-09-14 02:08:31 +02:00
pancake
d9c934f6b4 Fix some recent covs 2015-09-09 11:16:49 +02:00
Riccardo Schirone
6a517aa66b bin/p: add CGC bin format plugin 2015-09-08 23:22:07 +02:00
Riccardo Schirone
ce14b20974 bin/format/elf: remove Elf_ prefix from static functions 2015-09-08 23:22:07 +02:00
jvoisin
dba909b1dd Fix yet-another-batch of clang-analyzer issues 2015-09-01 23:24:11 +02:00
jvoisin
4261075d60 Misc fixes to make clang-analyser even more happy 2015-08-29 18:08:38 +02:00
Maijin
6831dd2f6d Revert "More misc cleanup"
This reverts commit 788a3b02c7.

	modifié :         libr/bin/format/pe/pe.c
2015-08-28 20:58:21 +02:00
jvoisin
788a3b02c7 More misc cleanup 2015-08-28 19:13:27 +02:00
jvoisin
98bb29c4ed Fix some clang-analyzer defects 2015-08-28 17:28:09 +02:00
pancake
1d4b0d8555 Fix some covs 2015-08-28 17:21:04 +02:00
Riccardo Schirone
2169980239 bin/p/bin_elf: fix symbols vaddr 2015-08-26 20:08:12 +02:00
Riccardo Schirone
18eaf1c8c5 format/elf: fix paddr2vaddr and vaddr2paddr conversions 2015-08-26 18:30:33 +02:00
pancake
564fb069be Fix #2991 - Add support for some SPARC ELF relocs 2015-08-19 02:04:07 +02:00
Riccardo Schirone
2518c9e21c core/core: add scr.promptflag variable 2015-08-11 16:03:07 +02:00
pancake
a343109c68 Fix aarch64 elf reloc type 2015-08-11 09:46:28 +02:00
pancake
1931f684a4 Detect ELBRUS ELF binaries and fix arm esil issue 2015-08-11 01:47:51 +02:00
pancake
b630d82548 Parse PLT for imports in ARM64 ELF binaries 2015-08-11 00:54:03 +02:00
Álvaro Felipe Melchor
9dd078dfa5 Fix #2883 2015-07-05 20:44:03 +02:00
Álvaro Felipe Melchor
7c2fd089f3 Fix #2706 & #2705 2015-06-04 13:14:43 +02:00
Álvaro Felipe Melchor
fddb32ccd7 Fix #2683 2015-06-03 12:28:19 +02:00
Álvaro Felipe Melchor
7f467e0162 Fix #2665 2015-06-01 23:19:49 +02:00
pancake
f8384feb6b Initial disassembler support for HP PA-RISC (from GNU binutils) 2015-05-28 11:24:31 +02:00
pancake
4ce609b589 Some llx -> PFMT64x 2015-05-28 11:05:52 +02:00
Álvaro Felipe Melchor
bc271a6691 Fix #2604 2015-05-23 19:07:40 +02:00
Jeffrey Crowell
1fab1e2338 fix relocation on amd64 elf
closes #2607
2015-05-23 10:37:19 -04:00
Álvaro Felipe Melchor
57fb89d9fd Fix #2592 2015-05-20 00:10:29 +02:00
pancake
fc6c788914 Huge speedup loading ELF bins with lot of symbols (1m30s vs 3s) 2015-04-30 16:55:30 +02:00
pancake
40de063d3f Fix some ELF/Dwarf memleaks reported by Coverity 2015-04-29 10:26:31 +02:00
Álvaro Felipe Melchor
ca308085e7 Added checks in elf.c and mach0.c 2015-04-29 01:25:32 +02:00
Álvaro Felipe Melchor
72b30d01b9 CID 1295060
CID 12950549-52
2015-04-26 22:40:42 +02:00
Álvaro Felipe Melchor
4532401066 Enhanced elf bin 2015-04-24 01:08:53 +02:00
pancake
e5b4fc7679 Fix deadcode in elf 2015-04-23 02:25:53 +02:00
pancake
59dcfae4d6 Add support for Blackfin machines in the ELF parser 2015-04-22 15:36:34 +02:00
Álvaro Felipe Melchor
a208cd56e6 Fix #1627 2015-04-22 15:22:24 +02:00
Anton Kochkov
1479aeca8e Fix a few Coverity issues
Fix CID 1205204
Fix CID 1171365
Fix CID 1135001
Fix CID 1134921
Fix CID 1134848
Fix CID 1134840
Fix CID 1134824
Fix CID 1267983
Fix CID 1230038
2015-04-19 03:15:29 +03:00
pancake
2aecde26d2 Tons of free candy. See details below:
- Fix arm-thumb ESIL for the SUB instruction
- Handle Java imports as symbols in code analysis
- Invoke Java instructions reference the imports now
- Fix 71 crashes reported by jn
- Affected bin modules: elf, mach0, java, te, pe, dex
2015-04-13 00:57:32 +02:00
pancake
f1f068f68e Fix #2321 - ELF segfault in strings 2015-04-07 17:12:41 +02:00
pancake
fab078d7a3 Support main in linux64 PIE bins 2015-04-03 18:10:43 +02:00
David Kreuter
8a6e613ee1 libr/bin: completed the heuristic to find main for mips binaries 2015-03-24 15:59:41 +01:00
pancake
12ea9734b5 Fix about 15 more random COVs 2015-03-21 02:04:49 +01:00
pancake
515b2e77bc Fix about 40 COVs related to memleaks and buffer overflows 2015-03-21 01:27:54 +01:00
pancake
5f9d275bb8 Support ELF ARM PLT and mark symbols as Thumb from RBin 2015-02-26 02:48:54 +01:00
jvoisin
a4ba5f64f5 Even more Coverifix 2015-02-19 00:27:00 +01:00
pancake
2e0548b269 EM_MIPS have nothing to do with endianness 2015-02-12 15:59:32 +01:00
Jeffrey Crowell
0cbc69c580 Give proper endianness of MIPS binaries
closes #2078
2015-02-12 01:46:39 -05:00
jvoisin
5ad3afb628 Coverifix 2015-02-11 17:55:25 +01:00
pancake
dc75cb2320 Fix the rest of base64 warnings 2015-02-10 00:05:18 +01:00
pancake
fcbec4091d Fix free(undefined) in elf parser 2015-02-06 02:00:45 +01:00
jvoisin
a2d4bd08bb Fix some memleaks 2015-02-05 11:43:10 +01:00
pancake
33d5fbb358 Fix #2011 - fix crash in ELF relocs parser 2015-02-01 03:07:02 +01:00
mortenoir
33c222778d pf.elf_phdr fix 2015-01-31 23:28:42 +01:00
Roi Martin (@nibble_ds)
7392437491 Fix symbol list regression in ELF parser 2015-01-31 04:42:44 +01:00
pancake
9d7aafc05c Fix #1994 - Fix crash in ELF loader 2015-01-26 03:32:40 +01:00
jvoisin
9681c6fcf7 More coverity 2015-01-25 14:35:46 +01:00
pancake
e11e1a633e Fix #1992 - fuzzed elf + dwarf segfaults 2015-01-25 03:23:30 +01:00
pancake
672b7057a4 Fix #1971 - Segfault in ELF parser 2015-01-17 00:32:20 +01:00
pancake
79e4e25d35 Fix #1919 - Autodetect main in ARM linux/arm programs 2015-01-14 23:47:37 +01:00
pancake
f495b5031a Handle ET_REL ELF relocs, asm.cpu for arm.cs: v8, mcortex 2014-12-28 03:53:39 +01:00
pancake
49446b27c0 Fix #1848 - crash in dex parsing 2014-12-18 01:17:16 +01:00
pancake
f5959d3534 Fix pie main detection with baddr for non-pie 2014-12-12 23:15:16 +01:00
pancake
49af10d42a Fix #1799 - Detect main symbol in Linux ELF PIE bins 2014-12-12 13:21:53 +01:00
pancake
190d8f1aa5 Fixes for the ELF PIE main detect 2014-12-11 03:10:31 +01:00
pancake
a5703d775c Detect 'main' symbol in stripped Linux PIE ELFs 2014-12-11 02:44:55 +01:00
pancake
274f22001d Add initial support for CRIS cpu as suggested by LolyRoP 2014-12-07 23:18:22 +01:00
pancake
ff72e9f0b8 Fix an overflow in r_buf_read 2014-11-19 01:08:46 +01:00
pancake
8c55285b5d Fix #1682 - Fix ELF null deref regression with rabin2 -c 2014-11-16 12:05:49 +01:00
pancake
36f66f07d7 Fix another elf crash thanks to melkor 2014-11-10 13:35:40 +01:00
pancake
b298413192 Fix #1640 - Current ELF is passing all those orcs 2014-11-10 05:42:57 +01:00
pancake
9cf541c582 ELF parser is now fuzzer-proof 2014-11-10 05:02:25 +01:00
pancake
9af7b348d5 Reapply 5870b6376c 2014-11-10 04:27:56 +01:00
pancake
0f6c813079 Revert elf.c to 3d3c5a3a14
- Reverts all latest changes from pancake, montekki and lemonboy
- Aiming to stabilize the ELF parser for the release
- We loose support for syms in phdr bins
- We loose support for relocs
- But we get proper symbol names and tested in real demos which are now broken
- The branch `elf-ng` contains the latest code with all montekki's and lemon's work
- Once this new branch gets fully tested it will be merged into master
2014-11-10 04:04:07 +01:00
Fedor Sakharov
fa64e18391 Do not ignore UNDEF symbols
Fixes #1542
2014-11-06 18:06:32 +01:00
pancake
0142915fb7 Minor code cleanup for the elf parser 2014-11-06 02:12:55 +01:00
pancake
350b13f980 Fix another fuzzed crash in the ELF parser 2014-11-05 23:24:43 +01:00
pancake
5651a8bf85 Fix another boundary check fail in ELF's strtab 2014-11-05 23:19:14 +01:00
pancake
2674032486 Fix another crash in the ELF parser (nightmare) 2014-11-05 22:52:53 +01:00
pancake
5870b6376c Fix strtab read overflow null-terminating all strtab copies 2014-11-05 22:49:43 +01:00
pancake
cf9880568e Fix oob read in ELF 2014-11-05 22:36:10 +01:00
Fedor Sakharov
a08b8833a4 Recognize symbols with type SECTION 2014-11-05 22:29:51 +01:00
pancake
89d4ff828f Fix rabin2 -c elf regression crash (thanks maijin for reporting) 2014-11-05 19:23:37 +01:00
pancake
842b8db4f3 Fix more crashes in DWARF and ELF 2014-11-05 17:15:22 +01:00
pancake
8b86030130 Fix all warnings in the ELF parser 2014-11-05 17:07:56 +01:00
pancake
0764d0bc15 Fix two crashes in the ELF parser 2014-11-05 17:02:08 +01:00
LemonBoy
f990b078a8 Make the elf parser use the phdrs and the DT_DYNAMIC contents 2014-11-05 16:33:34 +01:00
pancake
7b7256d340 Remove boundary checks to fix regression, must redo the patch with more fuzzing 2014-11-05 16:11:01 +01:00
LemonBoy
9dd90c2133 Make the elf parser use the phdrs and the DT_DYNAMIC contents 2014-11-05 16:01:06 +01:00
pancake
3d3c5a3a14 Fix a fancy crash in the ELF parser 2014-11-05 04:20:35 +01:00
pancake
f8595e9abd Fix crash in ELF parser 2014-11-05 03:16:22 +01:00
pancake
1ec7c21ed0 Fix regression in symbol names. 2014-11-05 02:59:15 +01:00
pancake
561555a595 Fix r_str_nlen for trashed symbols 2014-11-05 00:32:55 +01:00
Fedor Sakharov
4c3796a25c Do more proper boundary checking for relocs 2014-11-04 21:56:20 +01:00
pancake
8e78ebfee5 Fix crash in elf relocs 2014-11-04 16:16:47 +01:00
Fedor Sakharov
7ee086326a elf: Fix a typo in elf.c 2014-11-04 13:59:54 +01:00
pancake
4790375679 Random enhacements for RHex apis and relocs 2014-11-04 02:16:40 +01:00
pancake
c2b54c1344 Fix reloc addresses in .o files 2014-11-03 15:59:58 +01:00
pancake
7a1596ebbb Swap paddr <=> vaddr 2014-11-03 13:53:54 +01:00
Fedor Sakharov
6c3b502260 Re-implementation of relocations handling. 2014-11-03 13:43:49 +01:00
pancake
8e381135e4 Add Shdr and struct sizes, fixes for ELF64 with r2 -nn
- Remove debug printfs in 't'ypes
2014-10-16 03:46:58 +02:00
pancake
42232354a7 Add 'ai' - address info, Enhace 'ad' (support patterns and sequences)
- ai shows: exec,read,write,flag,func,stack,heap,reg
- Add r_reg_regset_get()
- Implement r2.cmdj in r2.js
2014-10-15 02:24:22 +02:00
pancake
9201d86558 Fix crash in elf parser 2014-10-11 01:25:45 +02:00
pancake
a4eefac793 More fixes for the ELF loader in get_libs() 2014-10-01 20:11:55 +02:00
pancake
664ae46dc5 Should fix #1457 - ELF rpath oob read 2014-10-01 19:59:50 +02:00
pancake
89c32e5d42 Check null ptr in elf 2014-09-30 12:07:29 +02:00
Maijin
a2693f982c Update elf_header parsing / pf with enum
Update elf_header parsing / pf with enum
2014-09-26 23:59:42 +02:00
pancake
5ff1de1068 Fix another ELF parsing crash (thanks @maijin for reporting) 2014-09-20 16:12:44 +02:00
pancake
4c4173769b Revert "Fixing the issue where file size exceeds size of an integer":
3adb00621b
e2afa84443
0761955fdb
17cc18fad0
135c62fb5d
2014-09-20 15:33:59 +02:00
pancake
143033b5d6 Add PE DOS header struct in r2 -nn (via maijin) 2014-09-20 13:27:54 +02:00
Fedor Sakharov
0592964fe9 propeller initial commit 2014-09-18 18:51:24 +02:00
Adam Pridgen
135c62fb5d Fixing *most* warnings related to the change in r_file_slurp 2014-09-17 22:37:54 -05:00
pancake
73743ae5ae Fix a regression in previous elf change 2014-09-17 15:19:40 +02:00
pancake
9be7cc789c Fix the rest of fuzzed elfs crashes 2014-09-17 13:28:30 +02:00
pancake
ae06dc24b5 Fix file2 and file3 fuzzed ELF files 2014-09-17 11:01:36 +02:00
pancake
dec5580bf4 Fix some ELF OOB crashes (thanks @maijin for reporting) 2014-09-17 00:09:00 +02:00
pancake
7fde96ea63 Add some header structs for MACH0 and fix some for ELF (rabin2 -rk '' related) 2014-09-08 12:20:50 +02:00
pancake
a8d3136bd3 Working demo for 'r2 -nn ..'. See 'pf.' and 'fs *;f' 2014-09-08 04:37:34 +02:00
pancake
4bcb57955f Initial test exposing elf headers into Sdb and fix crash in bin-any 2014-09-08 04:17:38 +02:00
pancake
a0570b4144 More fixes related to paddr/vaddr on PE/ELF/XBE 2014-08-15 12:47:05 +02:00
pancake
5a66d7a4d4 Fix #1203 - ELF64 symbol addresses. 2014-08-15 03:55:37 +02:00
pancake
332f21971a Initial fix to support loading TinyELFs (wip) 2014-08-09 23:53:13 +02:00
pancake
3dfadc0b30 Fixed several issues on PE/ELF/MACH0
- relocs, entry0 vaddr and baddr
- fix tiny.elf crash (null deref on *bin ptr)
2014-06-27 01:20:54 +02:00
pancake
a69f56ffe6 Fix all latest coverity issues except the rsa-find ones 2014-06-24 01:01:27 +02:00
tosh
eb6b86dd4b Some fix in the ELF parser
New functions used to prevent integer overflow when add, sub or mul
Fix an out of bound in r_buf_fcpy_at
2014-06-23 15:34:51 +02:00
pancake
8330ea59fc Fix stale pointer issue in RBinELF. Add r_mem_dup 2014-06-14 00:04:40 +02:00
pancake
2284b04f85 Oops. fix elf.nx 2014-06-05 15:55:19 +02:00
pancake
6883f74d57 Add info/elf.relro sdb instance 2014-06-05 15:38:33 +02:00
pancake
1686073c8b Implement RBinInfo.nx check for ELF (need tests) 2014-06-05 15:26:46 +02:00
pancake
79098f622e Add elf.relro sdb entry 2014-06-05 04:53:00 +02:00
pancake
c0750f62a8 List .rela.text relocations, still incomplete 2014-05-21 03:46:31 +02:00
pancake
796dedf83c Fix close(0) issue in rio 2014-05-21 01:46:01 +02:00
Anton Kochkov
bf9de18c63 Fix CID 1134993, 1135005, 1135004, 1134996, 1134995, 1135002 2014-05-19 06:03:41 +04:00
Adam Pridgen
ccd69e569e Fixing how virtual addresses are assigned to elfs 2014-05-15 00:02:41 -05:00
deeso
1fbc7f2168 Added load_bytes, Pushed curplugin down to RBinObj, Reworking the RBinFIle loading to accomodate RBinObj reworked how all bins are loaded. Needed to hack IO to make
this work with rbinfiles and rbinobjects.

Conflicts:
	libr/bin/bin.c
	libr/bin/p/bin_te.c
2014-05-13 21:54:18 -05:00
pancake
216c183b6e Remove tons of useless 'if (x) free (x)' 2014-05-09 17:40:28 +02:00
Anton Kochkov
c8d4e04792 Fix build 2014-05-02 14:21:59 +04:00
Anton Kochkov
8b25562c39 Fix CID 1135001 2014-05-02 13:46:51 +04:00
Anton Kochkov
b14b7df820 Fix CID 1135006 2014-05-02 13:38:35 +04:00
Anton Kochkov
dbff404a07 Fix CID 1135007 2014-05-02 13:34:02 +04:00
jvoisin
854bf7db87 Revert "Fix CID 1134998"
This reverts commit 44f5b35cb0.
2014-05-01 19:49:33 +02:00
jvoisin
44f5b35cb0 Fix CID 1134998 2014-05-01 19:27:53 +02:00
jvoisin
87c8cffeea Fix CID 1134996, 1135005, 1135002, 1134993 2014-05-01 19:13:52 +02:00
jvoisin
89f0ea4285 Fix CID 1135005, 1135004, 1134995, 61134996 2014-04-30 02:32:04 +02:00
Adam Pridgen
c3d6664756 Adding multi-bin support for files that contain multiple objects and lots of other fixes in libr/bin 2014-04-28 12:11:14 -05:00
Jann Horn
f092afa91f fix some of the biggest memory leaks that happen during startup 2014-03-26 22:29:06 +01:00