This will count the amount of bytes in a given AOB. Useful for readmem function and perhaps others. I felt that the process could be more simplified without having to manually count the bytes for a given AOB so made this.
Installation
Copy byteCounter.lua to X:\Program Files\Cheat Engine 7.2\autorun folder, where X is your main drive and restart Cheat Engine.
Usage
Step 1.
[Link]
Step 2.
[Link]
Step 3.
[Link]
Step 4.
[Link]
If this helped in any way, I would appreciate it if you could rate this post.
Thanks to all here that have shared their knowledge with this community. Without it, I would not have been able to accomplish this extension.
Thank you
[Lua]AOB counter
[Lua]AOB counter
- Attachments
-
- byteCounterv1.1.zip
- Update: Added byte count in hex
PW: fearlessrevolution - (581 Bytes) Downloaded 302 times
-
- byteCounter.zip
- PW: fearlessrevolution
- (534 Bytes) Downloaded 212 times
Last edited by LeFiXER on Sun Jul 25, 2021 10:42 pm, edited 1 time in total.
Re: [Lua]AOB counter
This was something I wanted/wondered about not even 12h ago lol
Thanks!
Thanks!
Re: [Lua]AOB counter
Might I suggest having the output show both decimal and hex. So it can be used to calculate offsets for AOBs scripts as well.
Re: [Lua]AOB counter
Thanks for the suggestion. I've updated to reflect that .
Re: [Lua]AOB counter
Hi ,
so I was just browsing the tools topics, and I saw AOB SIGNATURE GENERATOR AND SCANNER by ShyTwig16, and there was a way to determine how many AOBs in the selection so I tried to use those functions with your code, here the results.
CODE
Code: Select all
function countBytes()
local dv_address1 = getMemoryViewForm().DisassemblerView.SelectedAddress
local dv_address2 = getMemoryViewForm().DisassemblerView.SelectedAddress2
local startAddress = math.min(dv_address1, dv_address2)
local startAddressBytes = getInstructionSize(startAddress)
local endAddress = math.max(dv_address1, dv_address2)
local endAddressBytes = getInstructionSize(endAddress)
local length = endAddress + endAddressBytes - startAddress
if length > startAddressBytes then
ShowMessage('Bytes at Start: ' .. startAddressBytes .. ' (0x'.. string.format("%X", startAddressBytes) .. ')\nBytes at End: ' .. endAddressBytes .. ' (0x'.. string.format("%X", endAddressBytes) .. ')\nAOB Length: ' .. length .. ' (0x'.. string.format("%X", length) .. ')')
return
else
local sBytes = inputQuery('Count bytes in AOB', 'Selected Address has: ' .. startAddressBytes .. ' (0x' .. string.format("%X", startAddressBytes) .. ') Bytes\n\nEnter bytes to count: ', readFromClipboard())
if sBytes ~= nil then
_,count = sBytes:gsub("%S+","")
local hex = string.format("%X", count)
ShowMessage('The AOB has '..count..' bytes.' .. '\nDec : ' .. count .. '\nHex : ' .. hex)
end
end
end
function addByteCountMenu()
local parent = getMemoryViewForm().Component[113].Items
byteMenu = createMenuItem(parent)
parent.add(byteMenu)
byteMenu.Caption = 'Byte Counter'
byteMenu.ImageIndex = 74
byteMenu.OnClick = countBytes
end
addByteCountMenu()
if you select only one line
Who is online
Users browsing this forum: No registered users