AmyGrrl Cheater
Reputation: 0
Joined: 15 Dec 2016 Posts: 31
|
Posted: Mon Dec 02, 2019 1:09 pm Post subject: How do you change the type of a memory record? Solved By Me |
|
|
I'm not sure I am even asking the right question. I wrote a script to check for the version of the program. I have two things in my list.
Version Check set to String[1]
Version Check Hex set to Array of bytes [1]
This work perfectly so for. It does an AOBScan and will always returns only one results. Then offsets the found address by 10 to get the start of the version number. Then counts how long the version number is and stops when it reaches the end. Then it sets the Version Check to the found address. What I don't know how to do is set the String length to count I did so that it changes from String[1] to String [8] for example. Thanks for any help.
Code: | VersionCheckValue=getAddressList().getMemoryRecordByDescription("Version Check")
VersionCheckHexValue=getAddressList().getMemoryRecordByDescription("Version Check Hex")
BedrockServerAOBScan = AOBScan("5D 20 56 65 72 73 69 6F 6E", "-X+W")
memoryrecord_setAddress(VersionCheckHexValue, string.format('%X', tonumber(BedrockServerAOBScan[0], 16) + 10))
VersionCheckCount = 0
while true do
if tostring(VersionCheckHexValue.Value) ~= "0A" then
memoryrecord_setAddress(VersionCheckHexValue, string.format('%X', memoryrecord_getAddress(VersionCheckHexValue) + 1))
VersionCheckCount = VersionCheckCount + 1
elseif tostring(VersionCheckHexValue.Value) == "0A" then
memoryrecord_setAddress(VersionCheckValue, string.format('%X', tonumber(BedrockServerAOBScan[0], 16) + 10))
break
else
end
end |
Found what I was looking for. This fixed the problem.
Code: | VersionCheckValue.String.Size = VersionCheckCount |
I also redid the code a little to make run faster.
Code: | VersionCheckValue=getAddressList().getMemoryRecordByDescription("Version Check")
VersionCheckHexValue=getAddressList().getMemoryRecordByDescription("Version Check Hex")
memoryrecord_setAddress(VersionCheckValue, string.format('%X', tonumber(AOBScan("5D 20 56 65 72 73 69 6F 6E", "-X+W")[0], 16) + 10))
memoryrecord_setAddress(VersionCheckHexValue, VersionCheckValue.Address)
VersionCheckCount = 0
while true do
if tostring(VersionCheckHexValue.Value) ~= "0A" then
memoryrecord_setAddress(VersionCheckHexValue, string.format('%X', memoryrecord_getAddress(VersionCheckHexValue) + 1))
VersionCheckCount = VersionCheckCount + 1
elseif tostring(VersionCheckHexValue.Value) == "0A" then
VersionCheckValue.String.Size = VersionCheckCount
break
else
end
end |
|
|