Serge Lamikhov-Center
c22276ec1a
Modernize 'segment' implementation
2022-08-31 22:14:32 +03:00
Serge Lamikhov-Center
156cac5fa1
Modernize the section implementation
2022-08-30 19:42:28 +03:00
Serge Lamikhov-Center
af080f739e
Use unique_ptr instead of raw pointers
2022-08-29 08:20:07 +03:00
Kamay Xutax
7227a0913f
Fix sign-compare error
...
I just noticed that on my compiler;
probably due to recent version, not sure.
2022-07-18 19:01:22 +03:00
Serge Lamikhov-Center
07ef317550
Check out of the file boundary access attemps
2022-06-16 17:30:22 +03:00
Serge Lamikhov-Center
090444309f
Address casting on MSVC++
2022-02-11 09:20:38 +02:00
Serge Lamikhov-Center
ed2523f095
Adjust stream size when section data changes
2022-01-19 01:24:46 +02:00
Serge Lamikhov-Center
0cf852e561
Make get_stream_size() public
2022-01-15 00:16:11 +02:00
Serge Lamikhov-Center
69fc128bd5
Make set_stream_size() public again
2022-01-14 23:43:34 +02:00
Matthew McRaven
0a229d80fd
Respect maximum value of size_t in set_stream_size
...
When size_t is 32-bits (like in a WASM project), passing in a 64-bit constant leads to compile-time warnings.
2022-01-01 08:12:08 -08:00
Serge Lamikhov-Center
766559537a
Hide non interface methods
2021-09-20 20:43:27 +03:00
Serge Lamikhov-Center
fbb852198e
Use standard defined value for max ULL
2021-09-20 00:44:01 +03:00
Serge Lamikhov-Center
dad4b434c8
Use a different notation for the address translation
2021-09-20 00:03:21 +03:00
Serge Lamikhov-Center
511086598a
Implement address translation for segments
2021-09-19 23:26:58 +03:00
Serge Lamikhov-Center
b527ea992a
An attempt to implement memory translation for sections
2021-09-19 11:28:35 +03:00
Serge Lamikhov-Center
1343e5f979
modernize-use-equals-default
2021-08-26 13:01:12 +03:00
Serge Lamikhov-Center
da4f857e07
modernize-use-override
2021-08-26 12:57:31 +03:00
Serge Lamikhov-Center
4a84319bb8
modernize-use-nullptr
2021-08-26 12:52:23 +03:00
Serge Lamikhov-Center
becd79d05c
Support stringstream by filling gaps in output stream
2021-03-27 21:14:56 +03:00
Serge Lamikhov-Center
57e614a486
Remove postfix underscore in parameter names
2021-02-05 10:40:18 +02:00
Serge Lamikhov-Center
762c59a2bb
Change copyright period
2021-01-19 09:43:01 +02:00
Serge Lamikhov-Center
937978973f
Remove usage of try/catch blocks
2020-08-28 22:38:40 -07:00
Serge Lamikhov-Center
9c739b49a0
Reformat sources by using clang-format
...
It is not perfect (and, probably, it is worser than it was before), but, it is automatic
2020-08-21 07:56:08 -07:00
Serge Lamikhov-Center
c6e5eb0aad
Update Copyright period
2020-08-19 13:47:20 -07:00
Serge Lamikhov-Center
b1961db18b
Fix compilation warnings in VS 2019 v16.7.0
2020-08-07 20:27:13 +03:00
Serge Lamikhov-Center
b56b93de1b
Remove implementation functions from section interface
2020-06-09 23:46:41 -07:00
Serge Lamikhov-Center
46d081d5df
Add autoxxx tools to the ELFIOTest directory
2020-02-15 23:24:20 +02:00
Serge Lamikhov-Center
cdafaa0abf
Prevent potential dereferencing of NULL pointer
2019-04-19 15:05:50 +03:00
Serge Lamikhov-Center
858b7a3b70
Names and tabs refactoring
2019-04-19 14:52:20 +03:00
Tobias Klauser
37ebcd91b8
Fix two gcc -Wignored-qualifiers warnings
...
Fix the following two gcc warnings:
elfio/elfio_section.hpp:50:36: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
const size_t get_stream_size() const
^
elfio/elfio_segment.hpp:99:23: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
get_stream_size() const
2018-05-05 19:30:09 +03:00
alvaro
1a3cb25a7c
Fix oob read terminating data with 0
...
Fix crash e3c41070342cf84dea077356ddbb8ebf4326a601
==12073==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6110000003bb at pc 0x0000004c234c bp 0x7fcf6359ec30 sp 0x7fcf6359e3
e0
READ of size 11 at 0x6110000003bb thread T0
#0 0x4c234b in __interceptor_strlen.part.30 /home/alvaro/tools/llvm/llvm/projects/compiler-rt/lib/asan/../sanitizer_common/sanitize
r_common_interceptors.inc:301
#1 0x7165e6579d87 in std::char_traits<char>::length(char const*) /build/gcc-multilib/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3
/include/bits/char_traits.h:269
#2 0x7165e6579d87 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std
::allocator<char> const&) /build/gcc-multilib/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.h:495
#3 0x5c3333 in ELFIO::elfio::load_sections(std::istream&) /home/alvaro/fuzzers/elfio/ELFIO/examples/libfuzzer/../../elfio/elfio.hpp
:413:44
2017-10-04 20:47:51 +03:00
alvaro
39f8614f17
Added stream_size into section
...
This will allow to perform some security checks when reading size values
from ELF file
Fix crash e1ce7cecf01cf800397a4302854d9d76fa19763c
2017-10-04 20:47:51 +03:00
Martin Bickel
d0cb172474
Expose getter for section.offset
2017-01-16 20:38:37 +02:00
Serge Lamikhov-Center
8e7a29e128
Refactoring
2016-04-23 17:58:34 +03:00
Tim Strazzere
812f7299b3
Avoid SIGABRT due to over allocating during new instance of objects.
2016-04-23 16:37:48 +03:00
Serge Lamikhov-Center
9e4502d90e
Copyright year update
2015-02-13 20:51:07 +02:00
Mario Werner
c743d0bf74
separated layout generation and saving
...
Many example elfs (hello_32, hello_64, asm ...) require that the
first section directly follows the program header table. The
section header is then placed between segments or at the end.
This change prepares the late placement of section header table.
2014-11-14 13:06:39 +01:00
Serge Lamikhov-Center
33dcaf063f
Use [i|o]stream instead of [i|o]fstream; The patch was provided by Jason Hiser
...
Test's fixes
2014-02-26 18:02:30 +02:00
Serge Lamikhov-Center
17f03740e6
Using macros for header fields access functions
...
Set segment's index upon its creation
Move to VS2013 projects
2014-02-26 17:30:43 +02:00
Mario Werner
5dd8ba29bd
assign sections to the segments during load based on the offsets
2014-02-13 18:59:16 +01:00
Serge Lamikhov-Center
2ced96026d
Remove 'mutable' specification in 'section' class
2013-03-21 02:13:50 +02:00
Serge Lamikhov-Center
79ecb3fabc
Data size boundary check for dynamic section reader
...
Permit section data allocation for size equal to 0
2013-01-30 14:45:35 +02:00
Serge Lamikhov-Center
4b7061dc92
Dynamic section accessor is implemented
...
Fix segment header position when no segments are present
Dumper - dynamic section output added
Dynamic section reader tests are added
Signed-off-by: Serge Lamikhov-Center <to_serge@users.sourceforge.net>
2013-01-13 04:29:43 +02:00
Serge Lamikhov-Center
b78c0aca3d
Convert all files to UNIX EOL
2012-11-27 11:45:28 +02:00
Serge Lamikhov-Center
d3a0732983
Use <elfio/> prefix for \#include files
2012-11-25 14:37:09 +02:00
Serge Lamikhov-Center
2d514544fc
- Add const attribute to several functions of section interface
...
- Doc change
2012-09-18 14:21:21 +03:00
Serge Lamikhov-Center
3203483e34
Prevent compilation warnings when compiled x64 target with VS2008
2012-07-24 12:10:16 +03:00
Serge Lamikhov-Center
e1d554978d
Trim trailing space and remove tabs
2012-06-24 09:02:32 +03:00
Serge Lamikhov-Center
2cddbab258
To make memory_size bigger than file_size, set memory_size prior calling 'save' function
2012-06-24 08:50:29 +03:00
Serge Lamikhov-Center
b3b7aed245
Declaration uses macro for section and segment
2012-06-23 19:41:42 +03:00