You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Loading an x64 executable with a base address that doesn't fit in 32 bits will make the code throw an std::out_of_range exception during the call to std::stoi in raw_gadgets_from_file, particularly in the following line:
raw.addr = std::stoi(addr_str, 0, 16);
This happens because std::stoi does not support converting integers that are larger than 32 bits. When parsing executables mentioned above, the gadget addresses won't fit into 32 bits and will cause the exception to be thrown.
I have fixed the issue locally by replacing the std::stoi call with std::stoll or std::stoull. Given that the destination operand is a uint64_t type, I believe using std::stoull would be more correct.
Attached is an excerpt from the .ropium_raw_gadgets.0 temporary file that's generated by ropium during gadget processing. To reproduce the issue, one can make a test with the following line:
Hello,
Loading an x64 executable with a base address that doesn't fit in 32 bits will make the code throw an
std::out_of_range
exception during the call tostd::stoi
inraw_gadgets_from_file
, particularly in the following line:This happens because
std::stoi
does not support converting integers that are larger than 32 bits. When parsing executables mentioned above, the gadget addresses won't fit into 32 bits and will cause the exception to be thrown.I have fixed the issue locally by replacing the
std::stoi
call withstd::stoll
orstd::stoull
. Given that the destination operand is auint64_t
type, I believe usingstd::stoull
would be more correct.Attached is an excerpt from the
.ropium_raw_gadgets.0
temporary file that's generated by ropium during gadget processing. To reproduce the issue, one can make a test with the following line:ropium_raw_gadgets.txt
The text was updated successfully, but these errors were encountered: