❔ Converting String to an integer with a Hexadecimal Value
Hello Folks,
I got a process with a prefered imagebase equal to 002E0000.
I would like to store that value assigned to an integer since its a hexadecimal value which can be stored as it.
What is more I would like the value to be have a prefix "0x" so in full format the integer should look like this
I have a following code that gets the value from process and saves it as an integer however here is my issues:
- it does not store it in hexadecimal value
- I need it stored as an hexadecimal integer value with pre-fix "0x"
It prints it out as a INT32 value.
I need to print out hexadecimal value with a prefix "0x"
I tried converting it to string and adding "0x" but after that I cant convert it back to hexadecimal integer that represent exactly what string was showing.
8 Replies
https://stackoverflow.com/questions/16999604/convert-string-to-hex-string-in-c-sharp First result on google
its converting string to hex-string.
I need hex-int.
for an example
theburningmonk.com
Converting Hex string to Int in C# | theburningmonk.com
Learn to build production-ready serverless applications on AWS
Checking it out.
Since a lot of these answers where posted back in 2015 the languaged developed and I guess we dont have to use such a complicated method anymore.
First print, prints out correctly - still without prefix but its not a big issue. I can solve it later.
Second print, after conversion to int it prints out still INT32 number.
troy236#2361
REPL Result: Success
Result: bool
Compile: 300.657ms | Execution: 24.072ms | React with ❌ to remove this embed.
They are the same thing, theres no hex int
Passing 32 is the same as 0x20 to a function. its seen no differently
No such thing as a "hexadecimal integer"
An integer is an integer
Ah, it's already been mentioned I see
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.