Sie sind auf Seite 1von 4

Terraria: 3DS Inventory Editing

Extracting Save:
The save files can be extracted from the 3DS using SaveDataFiler or other home-brew
alternatives.

1. The save data is under “EXT” with the label “000016a9” (using SaveDataFiler)

2. Once extracted the folder should look something like this:

I’ll explain the files real quick:


(1) CONFIG.DAT
(a) Your settings. Haven’t snooped around in it :/

(2) *File name*.w


(a) These are world files
(b) Too much data to understand without a few days worth of work, and then
editing this would be a nightmare

(3) *File name*.p


(a) These are your player data files
(b) Pretty small in comparison to world files
(c) So far I’ve figured out how to change inventory items
i) In the future, player skin, coin count, player name, etc. can be studied

(4) scratch.dat
(a) Beats me….. but this file takes forever to extract

rev.1
Inventory Editing “.p” files:
The player save files contain many things, including the items the player is carrying. So
far I’ve been able to understand how these items are recorded in the file. Future study
can be done to examine how other player attributes are stored, like player skin, coin
count, player name, etc.

Hex view of the “.p” files:


To begin, I’ll explain where things are stored in the file.

Here I’ve opened the file in HexFiend 2:

This is where the player name is stored, I suspect the player appearance is also determined
here

This is an array of zeros. As stupid as it sounds, it’s important. This marks the start of the
player’s inventory. In my experience, it’s always 39 bytes long

This is where the items are stored. I’ll explain later how exactly they’re stored. This section
will always be 200 bytes long, starting after the array of zeroes.

The uncharted area…. Idk at all what this is.

Editing the inventory items:


Now that we’ve isolated the values we want to edit, let’s talk about how to do it.

So first of all: items are stored in 5 byte sections. Each item and it’s amount, and attributes are
held in a five byte section.

rev.1
Let’s look at the first 5 bytes in the section:

03 00 01 00 00
1. What item is it?
a. This is stored in the first two bytes “03 00”
b. The item id is actually the decimal equivalent of [the second byte][the first byte]
(So basically 0003 as a decimal: so just 3)
a. Item ID’s can be found at http://terraria.wikia.com/wiki/Data_IDs, under “Positive IDs”
c. Editing the item: The Terra Blade has an item id of 757, according to the above website.
a. first convert 757 to hex: 02 F5
b. Flip the bytes: F5 02
c. Replace 03 00 with F502
d. you now have a terra blade

2. How much is there?


a. This is stored in the third and fourth bytes “01 00”
b. You again have to flip the bytes to get the real hex value (0001)
c. Editing the amount: Say you want 999 terra blades (can do a max of 32767)
a. Convert 999 to hex: 03e7
b. flip the bytes: e7 03
c. Replace “01 00”
d. Now you have 999 terra blades (if you did step 1 :P)

3. Modifiers?
a. This is stored in the fifth byte “00” (:/ I should have picked a better example haha)
b. You just replace this with the hex version of the modifier id you want
a. Mod ids can be found at http://terraria.gamepedia.com/Prefix_IDs
c. Editing the modifier: Say you want 999 *Legendary* terra blades
a. The mod id for legendary is 81
b. convert 81 to hex: 51
c. Replace the last byte with 51

Result: goes from “03 00 01 00 00” to “F5 02 E7 03 51”

*YOU CAN DO THIS TO EMPTY SLOTS AS WELL

rev.1
Proposed Flowchart:

START

Ask user to point to .p


file. Make backup
(or auto scan for file in
SD card)

Search .p file for 39


bytes of “00…”

Isolate the next 200


bytes

Divide 200 bytes into 5


byte sections/variables

Ask user what items


need to be changed

Finished? no

Yes
Alter hex values, and
replace the original 200 FINISHED
bytes
rev.1

Das könnte Ihnen auch gefallen