Posted: Thu Apr 17, 2025 4:01 pm Post subject: How can I convert this string to work with math?
How would I change a variable type from string into hex without actually changing the content? For example I have a variable that is considered a string but contains 2F58B0, so I just want to make it so that 2F58B0 can be used like a number and have math performed on it. I've tried some format/changing methods such as ("%02X"),("%8X"),stringToByteTable,readBytes,etc... in the missing 4th line below but can't make it so the result stays the same actual value while also being interpreted as a number. In some cases, I was getting a printed result of 1,INF instead of the desired result.
Unlike yesterday's somewhat similar situation I was in, this script will need the game module and its offset once I add on to it, which is why I want to start with the module included and go through the trouble of converting its offset to use with math.
Code:
local stripped = getAddressList().getMemoryRecordByDescription("").Address --grab the base pointer of the memrec that has NO NAME
local stripped = string.gsub(stripped, '%s+', '') --remove white space (maybe not necessary?)
local stripped = string.gsub(stripped, 'Game_x64.exe%+', '') --strip away the game.exe+, leaving only the module offset behind
?? missing line 4 step to change remaining offset from string so math can be performed on it ??
print(stripped+0xA0)
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum