Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

VS 2008 Adding hex to byte array

$
0
0
Hi !
I need some help with this, im getting few addresses from memory that are dynamic and im using a pointer for this.However i noticed that when you read memory to a variable with type of string, the value is reversed and split to bytes (so if the value is B96F then in VB it shows me 6F-B9) i used to split the value and connect it again in reverse order, however its pretty much of code for such an easy operation.
What i need to do is just to add &H30 to the pointer value, until now i was doing it like this:
Code:

'Note thats not the actual code, because im too lazy to write everything properly
Dim val As String = BitConverter.ToString(ReadMemory(&HSomeAddress, 4), 0)

Dim part1, part2, part3, part4 As String
Split val to 4 parts by "-" signs
Dim finalVal as string = "&H" + part4 + part3 + part2 + part1
Dim TheAddressThatIsPointed As String = Hex(finalVal + &H30)

However its lots of writing, isnt there a way to just read from this address and add directly some hex to it ?

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>