* Fix r_sys_mkdirp with absolute path on Windows
* Fix build with --with-openssl
* Use RBuffer in r_socket_http_answer()
* r_socket_http_answer: Fix read for big responses
* Implement r_str_escape_sh()
* Cleanup r_socket_connect() on Windows
* Fix socket being created without a protocol
* Fix socket connect with SSL ##socket
* Use select() in r_socket_ready()
* Fix read failing if received only protocol answer
* Fix double-free
* r_socket_http_get: Fail if req. SSL with no support
* Follow redirects in r_socket_http_answer()
* Fix r_socket_http_get result length with R2_CURL=1
* Also follow redirects
* Avoid using curl for downloading PDBs
* Use r_socket_http_get() on UNIXs
* Use WinINet API on Windows for r_socket_http_get()
* Fix command injection
* Fix r_sys_cmd_str_full output for binary data
* Validate GUID on PDB download
* Pass depth to socket_http_get_recursive()
* Remove 'r_' and '__' from static function names
* Fix is_valid_guid
* Fix for comments
* Fix wrong computation in get_next_not_analysed_offset
* Uses virtual address in read_reloc and use elf_v2p to convert it to
the right offset in the file, instead of relying on base->baddr
directly. Dynamic info contain virtual address, not offsets.
* get_next_not_analyzed_offset should return the offset starting from
section_vaddr, to ensure the offset can never be decremented.
* use num_relocs to possibly limit the number of stored relocations
Using num_relocs works both as a defensive measure in case the initial
size computed by get_num_relocs_approx is wrong and as a way to limit
the number of relocation entries read by the parser, in case the
relocation section is so big that we can't allocate enough memory
(probably a fake section).
* Add support for AARCH64 reloc entries
* Fix runaway scrolling in Visual mode after mashing down movement key on Windows Terminal
* Reindent
* Use is_mintty() instead
* Use flush_stdin() instead
* Add a comment
* rabin2 could not detect go in non-elf binaries
* better comparison for go detection
* updates based on suggestions by ret2libc. re-tested accordingly after updates
* updates based on suggestions by ret2libc. re-tested accordingly after updates
Co-authored-by: Alex Useche <alex.useche@nvisium.com>
* Improve handling of Mach-O bind opcodes
- Reset state between regular binds, lazy binds, and weak binds.
- Stop parsing when encountering the DONE opcode, except for when
processing lazy binds.
- Rework handling of THREADED opcode to match Apple's behavior, where
the segment index isn't used. Also fix the page_count calculation.
- Eliminate redundant boundary checks to improve clarity.
* Fix symbol comment logic for zero-sized symbols
* replace repeated code in sign.c with new function
The functions r_sign_diff and r_sign_diff_by_name had repeated code to create
a list of deserialized signatures from a sign space. This commit moves that
code into a helper function.
* Update libr/anal/sign.c
* Update libr/anal/sign.c
Co-authored-by: Dennis Goodlett <dennis@hurricanelabs.com>
The expression (x > y) returns 1 or 0.
strcmp(..) returns 1, 0 or -1... and is valid RItemComparator.
I.e. one can't give a boolean answer where {1,0,-1} is expected.
This bug impacts the order of enumeration of locals and args in
functions. Starts occuring from mid-sized and bigger funcs
(~50 locals, then the sorting algo switches to mergesort); leads
to unstable and incorrectly-sorted vars dumps in the project file.
A motivating unit test is added as well.
A little algebra trick keeps it simple and efficient:
using no branching, with two antisymmetric bool→int conversions
we achieve the required {-1,0,1} codomain.
TL;DR: if you write a comparator function (to sort with),
make sure it returns 3 distinct values, not just 1 & 0.
* Added comments for functions in RAnnotatedCode
* Modified code to follow coding style
* Added more documentation and changed the name of core_annotated_code.c
* Fixed memory leaks