December 2017
Intermediate to advanced
860 pages
16h 1m
English
While working with exploits and modules, we will require tons of conversion operations. Let us see some of the conversions we will use in the upcoming sections:
It's quite easy to convert a value to decimal from hexadecimal in Ruby using the inbuilt hex function. Let's look at an example:
irb(main):021:0> a= "10" => "10" irb(main):022:0> a.hex => 16
We can see we got the value 16 for a hexadecimal value 10.
The opposite of the preceding function can be performed with to_s function as follows:
irb(main):028:0> 16.to_s(16)
=> "10"
Read now
Unlock full access