Kingdoms of Amalur: Reckoning™

Kingdoms of Amalur: Reckoning™

Not enough ratings
Hex Editing the Save File (to remove annoying bugged quest items)
By GenC 🐱‍👤
This edit to your save file will enable quest/unsellable items in your inventory to be sold.
Required programs: Cheat Engine.
Estimated time to complete: 5 minutes.
Does not work for everyone. (I'm limited on info so I don't know what causes these failures)
   
Award
Favorite
Favorited
Unfavorite
Preface
NOTE: This fix might not work for everyone. I am limited on data so I can't determine why it's like that.

  • By removing annoying bugged quest items, I mean enabling them to be sold.
  • I made a script to automate the hex editing process (which would be painfully slow if done manually).
  • Spoilers = extra info. These are safe to skip reading.
  • Completely read through "The Fix" section. Everything not contained in spoilers is stuff you should know.
  • All other sections are background info/extra.
The Fix
Before you edit your save file, make a copy.
Then, preferably, move the save file that you want to edit into an isolated folder.

Save file location
<steam installation directory>/userdata/<some number>/102500/remote
Tip: sort by date modified, descending, so your latest save appears at the top of the list.




You need Cheat Engine
I used Cheat Engine 6.6 for this guide.
If you are using Cheat Engine 6.7, step 4 will be a little different for you. (Thanks to Missilemike for his help in recognizing this important difference)
Cheat Engine has powerful automation with its Lua scripting engine; using a hex editor to edit files manually will be painfully slow and confusing.



Step 0: MAKE A COPY OF THE SAVE IF YOU HAVEN'T YET!
███╗ ███╗ █████╗ ██╗ ██╗███████╗ █████╗ ██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ████╗ ████║██╔══██╗██║ ██╔╝██╔════╝ ██╔══██╗ ██╔════╝██╔═══██╗██╔══██╗╚██╗ ██╔╝██║ ██╔████╔██║███████║█████╔╝ █████╗ ███████║ ██║ ██║ ██║██████╔╝ ╚████╔╝ ██║ ██║╚██╔╝██║██╔══██║██╔═██╗ ██╔══╝ ██╔══██║ ██║ ██║ ██║██╔═══╝ ╚██╔╝ ╚═╝ ██║ ╚═╝ ██║██║ ██║██║ ██╗███████╗ ██║ ██║ ╚██████╗╚██████╔╝██║ ██║ ██╗ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝
Personally, I make 2 copies of the original save, and rename one of the copies to something like "12345save01.sav.bak" and then move the copy that I will work on to an isolated folder where none of the other saves are located. This way, if I pasted the isolated, edited save file back into the original folder and it replaces the original save, and then I find out that the edited save causes my game to crash on load, then I can simply rename the "12345save01.sav.bak" to "12345save01.sav" and replace the corrupted save.


Step 1: Open the save file in Cheat Engine
Start up Cheat Engine (AS AN ADMINISTRATOR) and go to File -> Open File. Find and select your save. Be careful with what you do now, because any changes in file mode means that the change is written to the file instantaneously without any means to undo mistakes, hence the need for a backup file.
Really, if you don't believe me, just edit the value of the first byte of a copy of the save file and then close Cheat Engine without saving. Open the file back up, the edit is still there. Remember to restore the backup.

Step 2: Open the Lua Engine window in Cheat Engine
After the file is opened up in Cheat Engine (you won't visually see anything on Cheat Engine change except the text above the search progress bar will read "Physical Memory" instead of "No Process Selected"), press control+alt+shift+L to bring up the Lua Engine window.
Note that pressing control+alt+L (no shift) will bring up a similar Lua scripting window, and that is fine too.

Step 3: Paste the script into the Lua Engine
Now, copy the code below and paste it into the Lua Engine window. It's a script that turns off the 0x80 bit of byte at offset 41 for every item [stack] in your inventory (continue reading the guide for more details). The in-game effect of this script is that it makes all items sellable.

--Kingdoms of Amalur: Reckoning - Bugged Item Fix Script - v1.1
--Author: General Cellist (https://gtm.steamproxy.vip/id/General_Cellist/)
--CE Scripting documentation: http://wiki.cheatengine.org/index.php?title=Help_File:Script_engine
local itemStackList = {}
local ms = createMemScan()
local fl = createFoundList(ms)
ms.firstScan(
soExactValue, vtByteArray, rtRounded,
"* * * * 0B 00 00 00 68 D5 24 00 03 * * * * 68",
nil, 0, 0xffffffffffffffff, "", fsmNotAligned, nil, true, false, false, false)
ms.waitTillDone()
fl.initialize()
local i, maskByte
for i = 0, fl.Count - 1 do
itemStackList[i] = {}
itemStackList[i]["Address"] = fl.Address[i] --string
itemStackList[i]["Value"] = fl.Value[i] --string
itemStackList[i]["NumStats"] = readInteger(itemStackList[i].Address.."+"..string.format("%X", 21)) --int
itemStackList[i]["AdjustedFixOffset"] = itemStackList[i].NumStats * 8 + 41 --int
itemStackList[i]["AdjustedFixAddress"] = itemStackList[i].Address.."+"..string.format("%X",itemStackList[i].AdjustedFixOffset) --string
maskByte = readBytes(itemStackList[i].AdjustedFixAddress, 1, false) --int
if maskByte & 0x80 == 0x80 then
writeBytes(itemStackList[i].Address.."+"..string.format("%X",itemStackList[i].AdjustedFixOffset), maskByte & 0x7F)
end
end

print(fl.Count .. " items changed")

fl.destroy()
ms.destroy()

print("done")

Step 4: Execute the script
Press the "Execute" button, and wait until the script finishes processing (it will print "done" to the output window when it finishes). You can close the scripting window and Cheat Engine now.
Now, depending on your version of Cheat Engine:
  • Cheat Engine 6.6 and older: Changes are automatically written, so don't save. You can close Cheat Engine.

  • Cheat Engine 6.7 and newer: You will need to manually save the file before exiting Cheat Engine.




Step 5: Finishing Up
  • Your modified save is now ready to use. Make sure you place it back in the save folder before you start up the game.
  • When the game starts, make sure to manually load the modified save. Pressing "Continue" might load an autosave that you didn't edit.

Enjoy!
Now that practically every item that you own can be junked now, be careful to not mass destroy items in the junk inventory without checking for needed quest items.
I sell all my ex-quest items to my Gravehal Keep vendor; it keeps things tidy.

I haven't tested this fix completely, so perhaps there will still be a few items that may crash the game if they were tried to be sold/stashed/etc when they originally weren't meant to.

DOT NOT try to sell your reagent bag/alchemical recipes/component case/sagecraft pouch/key ring.

If your game crashes when loading the save, restore your backup save.

Quest items collected after you modify your save will not be able to be sold to vendors. Another run of this fix will be required.

Rate this guide up if you liked the fix!



The fix is done! Anything below is NOT the fix!
**************************************************************************************************
I already stopped giving the steps for the fix! You can stop reading this guide now unless if you want to know more info about the data that the script manipulates!
**************************************************************************************************
Info about the data structure
If you want to make your own custom edits, here's the info to get you started down that path.

This is one of the data structures that contain item info in the save file (Bytes counted in dec, examples in hex)
Byte
Example
Description
0
9A
4 bytes, variable, probably a specific inventory item stack
1
04
(2 stacks of the same potion will differ in these 4 bytes)
2
3D
3
07
4
0B
4 bytes, constant, unknown purpose
5
00
(these first 8 bytes have multiple occurrences
6
00
throughout the save file)
7
00
8
68
5 bytes, constant, unknown purpose
9
D5
note: elsewhere in the file, if the top 8 bytes are searched,
10
24
and if these 5 bytes are different, then the structure
11
00
of data below will be completely off
12
03
13
23
4 bytes, variable, unknown purpose
14
00
some items that I have found match in this part
15
00
I have only seen the last 3 bytes here to be 00 00 00
16
00
17
68
2 bytes, variable, unknown purpose
18
00
19
D8
2 bytes, variable per system?, unknown purpose
20
03
21
01
4 bytes (int), variable, number of equipment bonus stats
22
00
(items such as books don't have equipment bonus stats)
23
00
0x01 0x00 0x00 0x00 in swapped endianness is 0x00000001
24
00
24+1
81
4 bytes, variable, equipment bonus ID
24+2
1E
in this case, this is +5% armor
24+3
1D
(skip to byte offset 25 if there are no equipment bonus stats)
24+4
00
24+5
FF
4 bytes, constant, buffer?
24+6
FF
24+7
FF
24+8
FF
etc
(keep repeating the previous 8 bytes for however many weapon bonuses there are)
25
00
4 bytes, variable, unknown purpose
26
00
I have only seen the last 3 bytes here to be 00 00 00
27
00
28
00
29
00
4 bytes (float), variable, current durability
30
00
items other than weapons and armor
31
F0
usually have 100 current durability
32
41
33
00
4 bytes (float), variable, maximum durability
34
00
items other than weapons and armor
35
F0
usually have 100 or 0 or -1 max durability
36
41
37
01
4 bytes (int), variable, probably item count in stack
38
00
39
00
40
00
41
24
1 byte, variable, probably a bitmask that handles several boolean values such as whether the item is salvageable, sellable, etc.
42
00
1 byte, variable, unknown, perhaps level requirement?
43
00
1 byte (bool), variable, HasCustomName
43+1
00
4 bytes (int), variable, custom name length
43+2
00
(skip to the stop if this item does not have a custom name
43+3
00
as specified in byte offset 43)
43+4
00
43+5
00
char array (ascii) for the item name starts here
etc
the array stops at byte offset 43+4+n where n is the length specified as an int starting at byte offset 43+1 (if the item has no equipment bonuses)
stop
??
The next item stack starts here, or more likely after padding 00's.
  • Note: When it says constant/variable, it means that the values for those bytes don't change/do change respectively for every data structure that replicates this format (see description at byte offset = 8)
  • Don't change anything that is labeled as constant.
  • Bytes are numbered as if byte offset 24 and byte offset 43 both contain 00 (= false) so the data at 24+etc and 43+etc are treated as circumstantially required.
  • The example used is an uncommon (green) leg armor with a might-based level requirement (greater than 20) that has 1 equipment bonus (+5% armor) and 2 sockets, nothing socketed yet, (haven't found the data for sockets yet), has a durability of 30/30, and is salvageable and sellable and stashable and whatnot.
Offset 41
At byte offset 41, this is where people have fixed their House of Ballads armor sets and such to be able to junk them. They changed 0x84 (binary: 1000 0100) to 0x24 (0010 0100).
This feels unsafe now that I have learned that this structure is used for both equipment and unequipable items; you wouldn't want to salvage a book and crash your game, huh?

We will be changing 0x84 to 0x04 instead (and 0xC4 to 0x44; we're just turning off the 0x80 bit). By doing this, it should enable the selling of those items.

Values I have seen for this byte: 0xC8, 0xC4, 0xC1 (Legend of Dead Kel building items), 0xC0, 0x88, 0x84 (example: House of Ballads set), 0x80, 0x48, 0x44, 0x40, 0x24 (example: salvagable equipment), 0x04, 0x01 (very rare), and 0x00.
Bitmask
Hex
Description
0000 0001
0x01
Unknown purpose, possible DLC correlation
0000 0010
0x02
I have not seen this bit set for any item.
0000 0100
0x04
So far, I have seen this bit set for equipable items
0000 1000
0x08
I have only seen this bit set for item stacks with count = 1
0001 0000
0x10
I have not seen this bit set for any item.
0010 0000
0x20
Possibly indicates that the item can be salvaged
0100 0000
0x40
Unknown purpose, but commonly appears
1000 0000
0x80
THE FIX BIT! On = can't sell item
Refresher: if the 0x80 and 0x40 bits are set, then the value of the byte would be 0x80 + 0x40 = 0xC0
Stuff I want to find out later
Stuff I hope to find out later on:
  • The bytes for buy/sell value
  • The bytes for Might/Finesse/Sorcery requirements
  • The data for sockets
  • How weapons/armors/accessories/items/consumables/reagents/components/etc are differentiated
  • The byte that differentiates common/uncommon/rare/unique/set equipment
  • The byte or bit or whatever that determines if the weapon/armor/accessory is being worn or not (and if it is a ring, which slot)
  • The byte or bit that determines if an item is stolen or not
  • The byte or bit that determines if an item can be mapped to the radial menu (consumables)

Note that these things may or may not be found in the data structure table I listed.

Thank-you's
Thanks to RenYue for his Kingdoms of Amalur Save Editor + source code.
Thanks to Raziel123x for translating the save editor + source code (mostly).
https://github.com/APK-Multi-Games/Kingdoms-of-Amalur-Reckoning-SaveEditer-PC
It would have taken me much longer to figure out how data in the save file was organized if I didn't have that code to reference.
Thanks to DarkByte for Cheat Engine.
36 Comments
LC-BX 13 Apr, 2024 @ 7:08am 
This is an IMPORTANT tip for anyone who is trying to get rid of all the junk that are stuck in your inventory:

For stuck weapons or armors, use "Kingdoms of Amalur (Re-)Reckoning Save Editor"
https://www.nexusmods.com/kingdomsofamalurreckoning/mods/10

For NON weapon/armor items, use the "Quest item unstick" script written by weaaddar:
https://www.nexusmods.com/kingdomsofamalurreckoning/mods/18?tab=description

NOTE: the author of this script made rather simple instructions and you may run into issues, so let me clear it up:

-Download and extract the mod file
-Put "unstick.lua" file in game root directly!! like "D:\Program Files\Kingdoms of Amalur Re-Reckoning"
-Run the game, switch to f2console, type run('.\unstick.lua'), NOT "run unstick" like the author wrote.
-Back to the game, check your inventory and see if the NON-weapon/armor items can be sold now.

You can get f2console from:
https://www.nexusmods.com/kingdomsofamalurrereckoning/mods/14
WelfareRecipient 14 May, 2020 @ 3:47pm 
I've updated the save editor to add this functionality so that you don't have to rely on a cheat engine script. Thanks for posting this byte layout.
https://github.com/mburbea/koar-item-editor/releases

However, what eludes me is how to figure out the core component locations for an item.
G1ZM02K 16 Aug, 2019 @ 8:24am 
Since I couldn't get this to work on my Deer Heads, Searstalk, and Poison Glands, I've just spent four hours trying to wrap my head around the save files editing before giving up and removing the items directly from the game memory while running.

The sad part is that as I was removing them - same principle, toggle the junk flag - I noticed they don't actually use any inventory slots while flagged as quest items...

Just wanted to say thanks for everyone's help for getting me on the right track to clearing that crap out! Esp. SotiCoto for the Inv/Stash nod that got the ball rolling!
NullDev 8 Jul, 2019 @ 6:23am 
Seems like this is the best resource for some programming talk re: data structures of save files. Has anyone figured out a perfect offset for inventory size? I forked and am currently rewriting the item editor and the inventory size is escaping me.

One solution I currently am looking at is to search the bytes between two strings and try to locate the inventory size from there based on user input.

I am also hijacking the data structure explained here to add additional functionalities to the editor (if I can).
Revengeance 4 Jul, 2019 @ 2:14pm 
Anyone find how to make this work? I've tried using CE6.6 and it's reporting 0 items changed.
snoufleur 26 May, 2019 @ 12:21pm 
Is there a way to cancel quests by editing the save-game? Unfortunately no one seems to care about this in the past :-(

I guess for this one would need:
- a list of all quest names internally
- the knowledge of how quests are stored in the save file
(I saw something like "quest started", "quest finished")
- checking this out
(I guess, if I "delete" a quest, it should internally marked as new again - so that the person who gives the quest has a mark over his head again)

Does someone know something about this topic?
KleinGrrmpf 13 May, 2019 @ 11:23am 
Hey there, this sadly doesn't work for me either. I don't know, why... I very new to editing save games (the only save games I can edit are the minecraft ones xD). What I tried until now is using your two different scripts and different versions of Cheat Engine (the newest one 6.8.3 and 6.6).
I was also looking for some way to manually edit the hex values like some people discribed in the comments, but I couldn't figure out, how... So if anyone is still active in this guide please help ;)
SotiCoto 4 Feb, 2019 @ 8:47am 
Update to previous statement:

I gave up on the quick fix lua script, but I was able to tweak it manually.
I've confirmed a few things about that 41st byte though:

40 sets an item as unstashable
80 sets an item as unsellable / unjunkable

So their combination, C0, which is common for most quest items, indicates they can't be stashed, junked, nor sold. As such, I'd recommend setting all such items to 00 instead of 40. At least then they can be stored away safely in the home stash in case they're needed again.

That aside, bytes 17 to 20 seem to vary between items in the personal inventory and those in the stash. My items generally have 67 00 4C 02 when in my inventory, but 87 04 04 05 for those items stored in my home stash. I'm guessing these are some sort of container IDs or something, which would make them differ by character / playthrough.

SotiCoto 2 Feb, 2019 @ 4:27pm 
This doesn't seem to work for me at all.
I wanted to use it to get rid of non-equippable quest items (since I could change equippable ones in that Chinese equipment editor)...

I always get "0 items changed" when I run the script though...

I've tried changing the "68" at the end of the search part to a wildcard since it is usually 67 on my saves (but not consistently), but still.... 0 items changed.

Additionally, I'm not sure Cheat Engine 6.7 can even save properly. As in I click "Save Item", but on the window it opens up, it says "Open" instead of "Save" ... Am I doing something completely wrong there? Maybe I should get an older version of Cheat Engine...
GLITTERLICH 8 Apr, 2018 @ 6:04pm 
Thank you for the answer. This is all a bit above my ability, so I'll probably just suck it up, but others may find it useful.