* format/elf: fix is_in_pphdr function
That function should check if an address is in the file "side" of the
phdr, so it should check for filesz and not memsz
* format/elf: consider filesz even when looking at virtual space
A virtual address that is included in p_memsz but not in p_filesz, means
that it's an address that has no counterpart in the physical file, does
it makes no sense to look at memsz when converting an address from
virtual to physical.
* bin/demangle: demangle names that end with @@CXXABI
After last commit, we get correct mangled names that, according to other
tools, include also the @@CXXABI part. This patch removes the @@CXXABI
suffix because the cplus_demangle_v3 function is not able to deal with
it.
MDMP format store permissions of the memory in a specific stream,
but it seems to be absent by default. So we should at least assume
that the memory is readable unless explicitely specified otherwise
by the dump.
Fix#10992
* Fix issue #11399: use-after-free in symbols()
Commit 7e083b57f introduced the issue #11399. The list referenced by
`codes` in entries(), is the same list that bf->g_codes is pointing at.
By freeing it, we introduce a use-after-free condition in a later call
to symbols(), where we try to iterate over the list that bf->g_codes
was supposed to be referencing.
* Fix memleak during loading of WASM binaries
A memory leak is reported by ASAN when handling WASM binaries. It is
caused by multiple allocations of RBinInfo structure. First, RBinInfo
is allocated within a call to size() from r_bin_object_set_items(). Then
there is another, explicit allocation of an RBinInfo structure through
a call to the info() callback of the WASM RBinPlugin. This causes loss
of reference to the initial structure, and subsequently a leak.
There are no apparent uses of RBinInfo structure inbetween these two
points, and the size() result is in no way dependent on this structure,
therefore I resolved the memory leak issue by removing the allocation
from within the size() function.
* anal_x86: keep same syntax and POP value out of esil stack in push sp
NOTE: The other syntax was causing issues in afta, not sure why
* Revert "Further mem leak fixes (#11398)"
This reverts commit 38d9170f5da82ece05d1b90e366763999e633e34.
* anal_x86_cs: just use one expression for the PUSH x86 operation
* libr/core/cmd: set core_sysenv only when calling external scripts