Commit graph

16 commits

Author SHA1 Message Date
Zach Hilman
c140b6ae2c
Merge pull request #2581 from lioncash/hex
common/hex_util: Combine HexVectorToString() and HexArrayToString()
2019-06-15 16:47:13 -04:00
Lioncash
18c1d91920
file_sys/ips_layer: Remove unnecessary reserve() call
Given 'replace' is assigned to on the following line, this isn't
necessary, given the underlying data is going to be overwritten
entirely.
2019-06-12 18:12:45 -04:00
Lioncash
a62088539e
common/hex_util: Combine HexVectorToString() and HexArrayToString()
These can be generified together by using a concept type to designate
them. This also has the benefit of not making copies of potentially very
large arrays.
2019-06-12 17:54:05 -04:00
Frederic L
7a5eda5914 global: Use std::optional instead of boost::optional (#1578)
* get rid of boost::optional

* Remove optional references

* Use std::reference_wrapper for optional references

* Fix clang format

* Fix clang format part 2

* Adressed feedback

* Fix clang format and MacOS build
2018-10-30 00:03:25 -04:00
Zach Hilman
9a87ece837 ips_layer: Use rle_size instead of data_size in RLE patch application
Prevents a potential bug when using RLE records in an IPS patch.
2018-10-25 14:23:56 -04:00
bunnei
5461b21c7a
Merge pull request #1461 from lioncash/warn
ips_layer: Silence truncation and conversion warnings
2018-10-09 22:30:01 -04:00
Lioncash
465175cdf5 ips_layer: Avoid constructing std::vector instances where not necessary
We can just compare the existing std::vector instance with a constexpr
std::array containing the desired match. This is lighter resource-wise,
as we don't need to allocate on the heap.
2018-10-09 14:10:22 -04:00
Lioncash
9ff743bc0a ips_layer: Remove unnecessary explicit std::pair constructor in std::array
Makes the layout of the array consistent, by making all elements match,
instead of special-casing the first one.
2018-10-09 14:10:22 -04:00
Lioncash
f7d2889fb4 ips_layer: Add missing includes
Adds missing includes to prevent potential compilation issues in the
future. Also moves the definition of a struct into the cpp file, so that
some includes don't need to be introduced within the header.
2018-10-09 14:10:13 -04:00
Lioncash
93ac8d0fea ips_layer: std::move data within PatchIPS() and Apply()
We don't need to make a copy of the read data, so we can std::move it
into the make_shared call here.
2018-10-09 14:06:44 -04:00
Lioncash
567e818440 ips_layer: Silence truncation and conversion warnings
Makes type conversions explicit to avoid compiler warnings.
2018-10-09 13:18:23 -04:00
Zach Hilman
110d578470 ips_layer: Fix inaccuracies with comments and flags
Specifically bugs/crashes that arise when putting them in positions that are legal but not typical, such as midline, between patch data, or between patch records.
2018-10-04 12:23:27 -04:00
Zach Hilman
70bd2bb1d3 ips_layer: Deduplicate resource usage 2018-10-04 11:34:36 -04:00
Zach Hilman
9669cdb710 ips_layer: Add support for escape sequences and midline comments
More accurately follows IPSwitch specification.
2018-10-04 11:34:30 -04:00
Zach Hilman
306739c2c4 ips_layer: Add IPSwitchCompiler to process IPSwitch format 2018-10-04 11:32:10 -04:00
Zach Hilman
21b2411c44 file_sys: Implement function to apply IPS patches 2018-10-01 16:01:46 -04:00