 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
StarfireTBT Advanced Cheater
Reputation: 1
Joined: 15 Aug 2015 Posts: 66
|
Posted: Wed Jul 01, 2026 3:54 pm Post subject: One byte endian |
|
|
Can someone create a 1 byte big endian feature? I'm using retroarch to emulate windows 98 in Dosbox pure and the only value type it reads is one byte.
I know 2 byte endian works for dosbox pure emulating dos games but if I was to emulate windows 98 it doesn't.
I do know 1 byte does work because it works for values under 255 and for values over 255 cheat engine will read a different number under 255.
For example, If I search for 105,000 cheat engine will show the number 40 but if I change it to 5,000 I get the number 136. Cheat engine finds the correct address because if I keep changing it from one number to the other it keeps giving a consistent 40 and 136.
If I check the active box to freeze it, the number changes to 4,959 or 104,959. If I try to change it the number in cheat engine changes but not in game. So instead of cheat engine reading 40 and 136 I might get 255 and 95.
I know cheat engine found something because I can keep going back and forth, changing the number and cheat engine will remain consistent.
|
|
| Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 155
Joined: 06 Jul 2014 Posts: 4774
|
Posted: Wed Jul 01, 2026 4:23 pm Post subject: |
|
|
Endianness only applies to values that take up more than 1 byte.
Enable the big endian custom types somewhere in Edit -> Settings and use those.
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
| Back to top |
|
 |
Corroder Grandmaster Cheater Supreme
Reputation: 75
Joined: 10 Apr 2015 Posts: 1672
|
Posted: Wed Jul 01, 2026 10:11 pm Post subject: |
|
|
Auto Assembler + Lua Script
Activate this script through the Tools -> Auto Assembler menu, then add it to your Cheat Table (File -> Assign to current cheat table).
| Code: |
{$lua}
[ENABLE]
-- Remove custom type if it already exists to prevent duplication
local oldType = getCustomTypeManager().getCustomType("1 Byte Big Endian (Pseudo)")
if oldType then oldType.destroy() end
-- Register New Custom Type
registerCustomTypeLua({
name = "1 Byte Big Endian (Pseudo)",
bytesize = 1,
-- Convert memory byte to a human-readable integer value
bytestovalue = function(b)
-- Since it is only 1 byte, the value is taken directly from index 0 without reversing the order
return b[0]
end,
-- Convert user input integer value back into memory byte
valuetobytes = function(v)
local b = {}
-- Ensure the value stays within the 1-byte range (0-255)
v = math.max(0, math.min(255, math.floor(v)))
b[0] = v
return b
end
})
[DISABLE]
-- Remove custom type from the list when the script is disabled
local myType = getCustomTypeManager().getCustomType("1 Byte Big Endian (Pseudo)")
if myType then
myType.destroy()
end
|
How to Use in Cheat Engine
1. Copy the script above into the Auto Assembler window
2. Click File -> Assign to current cheat table, then close the Auto Assembler window.
3. Activate the script by checking the box next to it in your Address List.
4. Right-click on any memory address in your table, then choose Change info -> Type
5. Select Custom, then choose 1 Byte Big Endian (Pseudo) from the available drop-down menu.
Cheers..!!
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 474
Joined: 09 May 2003 Posts: 25956 Location: The netherlands
|
Posted: Thu Jul 02, 2026 2:13 am Post subject: |
|
|
maybe use 2 or 4 byte little endian and disable fast scan (maybe it's a 3 byte value)
_________________
Tools give you results. Knowledge gives you control.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
Corroder Grandmaster Cheater Supreme
Reputation: 75
Joined: 10 Apr 2015 Posts: 1672
|
Posted: Thu Jul 02, 2026 3:29 am Post subject: |
|
|
| Code: |
{$lua}
[ENABLE]
-- Delete old custom type if it exists
local oldType = getCustomTypeManager().getCustomType("3 Byte Little Endian")
if oldType then oldType.destroy() end
--Register new custom type value for 3 byte
registerCustomTypeLua({
name = "3 Byte Little Endian",
bytesize = 3,
-- Convert memory bytes to a human-readable integer value
-- Little Endian: b[0] = lowest byte, b[2] = highest byte
bytestovalue = function(b)
local val = b[0] + (b[1] * 256) + (b[2] * 65536)
return val
end,
-- Convert the user return value
valuetobytes = function(v)
local b = {}
v = math.max(0, math.min(16777215, math.floor(v))) -- Batas maksimum 3 bita (2^24 - 1)
b[0] = v % 256
b[1] = math.floor(v / 256) % 256
b[2] = math.floor(v / 65536)
return b
end
})
[DISABLE]
--Delete custom type from list when script deactivated
local myType = getCustomTypeManager().getCustomType("3 Byte Little Endian")
if myType then
myType.destroy()
end
|
Important: How to Disable Fast Scan in Cheat Engine
Since 3-byte data types are unaligned with the standard memory structure (which usually aligns by 2, 4, or 8 bytes), you must manually disable the Fast Scan feature in the main Cheat Engine window so the value can be found during the scanning process.
1. Open the main Cheat Engine window.
2. Look at the bottom-right section of the scan area (just below the Value text box).
3. Uncheck the Fast Scan option.
4. In the Value Type drop-down menu, select your new custom data type: 3 Byte Little Endian.
5. Perform the scanning process as usual (First Scan / Next Scan).
Here is the complete Cheat Engine Lua script. It registers the 3 Byte Little Endian custom type and automatically configures the scan settings by disabling Fast Scan and setting the Value Type dropdown when activated.
| Code: |
{$lua}
[ENABLE]
-- 1. Register New Custom Type
-- Remove old custom type if it already exists to prevent duplication
local oldType = getCustomTypeManager().getCustomType("3 Byte Little Endian")
if oldType then oldType.destroy() end
registerCustomTypeLua({
name = "3 Byte Little Endian",
bytesize = 3,
-- Convert memory bytes to a human-readable integer value
-- Little Endian: b[0] = Least Significant Byte (LSB), b[2] = Most Significant Byte (MSB)
bytestovalue = function(b)
local val = b[0] + (b[1] * 256) + (b[2] * 65536)
return val
end,
-- Convert user input integer value back into memory bytes
valuetobytes = function(v)
local b = {}
v = math.max(0, math.min(16777215, math.floor(v))) -- 3-byte max limit (2^24 - 1)
b[0] = v % 256
b[1] = math.floor(v / 256) % 256
b[2] = math.floor(v / 65536)
return b
end
})
-- 2. Automatic Cheat Engine Settings Modifier
-- Disable Fast Scan automatically
MainForm.cbFastScan.Checked = false
-- Set the scan Value Type dropdown to our new custom type
-- Loops through the dropdown list to find and select the correct item match
for i = 0, MainForm.FormatList.Items.Count - 1 do
if MainForm.FormatList.Items[i] == "3 Byte Little Endian" then
MainForm.FormatList.ItemIndex = i
break
end
end
[DISABLE]
-- Remove custom type from the list when the script is disabled
local myType = getCustomTypeManager().getCustomType("3 Byte Little Endian")
if myType then
myType.destroy()
end
-- Optional: Re-enable Fast Scan and reset type to 4 Byte on disable
MainForm.cbFastScan.Checked = true
MainForm.FormatList.ItemIndex = 2 -- Default index for 4 Byte Integer
|
Explanations:
1. Automatic Scan Adjustment: Modifies MainForm.cbFastScan.Checked to turn off Fast Scan instantly upon activation.
2. Dropdown Selection Sync: Automatically scans your FormatList item list to switch your active scan type to the newly registered 3 Byte setting.
3. Clean State Restore: Re-enables Fast Scan and defaults back to standard 4 Byte values when the script is checked off.
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|
| Back to top |
|
 |
StarfireTBT Advanced Cheater
Reputation: 1
Joined: 15 Aug 2015 Posts: 66
|
Posted: Fri Jul 03, 2026 8:07 am Post subject: |
|
|
| Corroder wrote: | Auto Assembler + Lua Script
Activate this script through the Tools -> Auto Assembler menu, then add it to your Cheat Table (File -> Assign to current cheat table).
| Code: |
{$lua}
[ENABLE]
-- Remove custom type if it already exists to prevent duplication
local oldType = getCustomTypeManager().getCustomType("1 Byte Big Endian (Pseudo)")
if oldType then oldType.destroy() end
-- Register New Custom Type
registerCustomTypeLua({
name = "1 Byte Big Endian (Pseudo)",
bytesize = 1,
-- Convert memory byte to a human-readable integer value
bytestovalue = function(b)
-- Since it is only 1 byte, the value is taken directly from index 0 without reversing the order
return b[0]
end,
-- Convert user input integer value back into memory byte
valuetobytes = function(v)
local b = {}
-- Ensure the value stays within the 1-byte range (0-255)
v = math.max(0, math.min(255, math.floor(v)))
b[0] = v
return b
end
})
[DISABLE]
-- Remove custom type from the list when the script is disabled
local myType = getCustomTypeManager().getCustomType("1 Byte Big Endian (Pseudo)")
if myType then
myType.destroy()
end
|
How to Use in Cheat Engine
1. Copy the script above into the Auto Assembler window
2. Click File -> Assign to current cheat table, then close the Auto Assembler window.
3. Activate the script by checking the box next to it in your Address List.
4. Right-click on any memory address in your table, then choose Change info -> Type
5. Select Custom, then choose 1 Byte Big Endian (Pseudo) from the available drop-down menu.
Cheers..!! |
I think you might be on to something, but when I ctrl+alt+a and enter the script I get this error message...
Lua error in the script at line 1:[strink "local syntaxcheck,memrec=...
..."]:3: attempt to call a nil value (global 'get CustomTypeManager')
|
|
| Back to top |
|
 |
|
|
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
|
|