Tag: food

  • Hacking Minecraft Java Edition with chastehex

    The save files on my Linux machine are here:

    /home/chastity/.minecraft/saves/

    I decided to see if my chastehex program would be any use at editing save files of Minecraft.

    The first step is to use chastecmp (another program I wrote) to compare two files of slight differences.

    The first target was the level.dat file. I had created a new world, collected 3 oak logs from a tree, and saved.

    Debian Linux detected that the level.dat file was actually a gzip archive. Therefore, to get the true data, these commands are required. The first copies it so that it has a “.gz” extension. The second decompresses it.

    cp level.dat file0.gz
    gzip -d file0.gz
    

    Now there is a file named file0 which has the raw data uncompressed. The next step is to load up the game, make a small change and then resave the file. I threw away one oak log so that I had 2 instead of 3. Then I saved the game and ran these commands to get the uncompressed data for the second file.

    cp level.dat file1.gz
    gzip -d file1.gz
    

    I compared the two files with chastecmp:

    chastecmp file0 file1

    And the result was:

    file0 Opened OK
    file1 Opened OK
    00000052 48 CF 
    000003E9 48 CF 
    000007FE 48 CF 
    000009F0 03 02 
    000011D2 69 68 
    000011D3 0E 87 
    000011E5 FB 74 
    0000124B 72 81 
    0000124C EE C7 
    0000124D 99 BA 
    file0 has reached EOF
    

    It appears that address 9F0 contains the amount of oak logs in the first item slot in the game.

    I ran this command to change that byte to 20 hex/32 decimal

    chastehex file0 9F0 20

    The next step is to recompress the data into a level.dat file that the game expects to load.

    gzip -k file0
    cp file0.gz level.dat
    

    Amazingly, when I loaded the game, I did in fact have 32 oak logs. Obviously this process requires multiple steps and is painfully slow, however it proves that my command line tools can hack Minecraft because there is compression but no encryption in the files.

    The level.dat file seems to contain the player’s inventory and other important data. I remember this from experiments with it years ago.

    Warning

    The addresses and what they mean can change wildly as new data is added to the file. For example, I found a village and there were 5 iron ingots in a chest. I repeated the steps above to create two uncompressed files.

    The difference between the files in this case were that I threw 3 of the ingots on the ground and so the number had changed from 5 to 2 in the chastecmp file0 file1 output

    00000F5F 05 02

    So then I ran the command to change the count to 64 (40 hex)

    chastehex file0 F5F 40

    Upon recompressing the file and putting it back in the game folder, I did have 64 ingots. I had previously tried numbers higher than 64 but unfortunately the results were not good. I ended up with only one ingot instead. Therefore, it is good to stick within the limits of what the game expects for the cheating to be successful.

    But because the addresses change as new data gets added to the game, cheating by hex editing is painfully slow on Minecraft. This is best done on a brand new world, both because the data is small and also so that you don’t corrupt worlds you have been playing on longer.

    But I did it as a proof of concept just to see if the programs I wrote can be used to hack Minecraft. The answer is yes, with a little help from gzip for decompression and recompression.

    But what if I told you there was an easier way to cheat at Minecraft Java Edition? You see, the secret still lies with the level.dat file. You don’t actually need to use chastehex, chastecmp, or compression. This is because the file contains the player inventory but not the items they have stored in chests in the world! This allows for item duplication.

    So place the items you want to duplicate in your inventory. Then save the game and backup the file.

    cp level.dat backup.dat

    Then place those items in a chest then save again. Restore the file you backed up earlier.

    cp backup.dat level.dat

    When you reload the game, the files will still be in the chest but your player will also be holding them. This means you can infinitely duplicate any item you can obtain in the game normally by just copying save files repeatedly.

    Why then, did I go through the process of showing how to cheat with chastehex? Because the point is not so much about hacking the game, or what the game is, but it is about testing the programs I wrote. I care more about my C and Assembly programming skills than I do the outcome of a game.

    The point is not whether you win or lose the game. The point is that the game was made by humans and can be broken by humans. Sometimes, as in Castle of the Winds or Cave Story, hacking with a hex editor is the most reliable method. In a game like Minecraft, sometimes cheating is easier because of player and world data being in completely separate files.

  • Chapter 10: Consistently Pro-Life

    In this chapter, I know I am going to lose some readers because if there is anything that is more misunderstood than the religious or political debates over LGBTQIA+ rights and identity, it is the abortion debate.

    I know you are not expecting a Transgender person with rainbows all over their social media and book covers to be Pro-Life because the “Pro-Life” movement has traditionally done things that are very “Pro-Death” involving the LGBTQIA+ community.

    Most of the Pro-Life organizations and charities are strictly Anti-Gay and Anti-Transgender. Most of these groups are religiously based, and this causes them to only work with people who meet their standards based on their faith. Since many passages in the bible are interpreted to forbid homosexuality and even imply that homosexuals go to hell, the Christians who believe these things seem to prioritize their fight against LGBTQIA+ people even more than they do their fight against abortion.

    But let me be very clear here: there is nothing Pro-Life about denying gay people the right to marriage. There is nothing Pro-Life about denying the ability of gay couples to adopt children that straight people did not want or could not afford to take care of, and there is nothing Pro-Life about taking away life-saving hormones and surgeries from Transgender and Intersex people who rely on them for their physical AND mental health.

    Nobody has the right to call themselves Pro-Life unless what they are doing actually keeps people alive. You don’t get to murder a transgender person on the street and then go to church and talk about being a follower of Jesus. If you do, you are a hypocrite, and even Jesus would tell you so, just as he did the Pharisees and Sadducees.

    For me, being Pro-Life DOES NOT EQUAL BEING ANTI-ABORTION. Rather, being Anti-Abortion is probably 5 percent of the equation. I follow a consistent life ethic, and this includes Veganism to save the animals and supporting human minorities who face additional challenges because of their race, religion, gender, skin color, disability, or whatever other excuse people use to murder them and take away their jobs, housing, and healthcare.

    Therefore, by writing these chapters about the Rainbow people, I am doing my best to be Pro-Life for the LGBTQIA+ community. I hope that even though you may not agree with my opinion that abortion is immoral because it is murder, you can at least see the parallels to the other topics.

    There are two important Pro-Life organizations I want to share with you. The first is the Rainbow Pro-Life Alliance. I have been a board member since 2022 and attend the Zoom meetings. What I can tell you based on my experience is that all of these people come from different places and don’t share the same opinions on every topic. We do agree that abortion is wrong and that LGBTQIA+ people certainly have a place in the discussion, even though we have been excluded by mainstream Pro-Life organizations and events. After all, most of us are either extremely gay or are straight allies.

    https://www.rainbowprolife.org/

    The second is Vegans for Preborn Rights. Because I am an ethical Vegan who does not eat or wear anything from an animal, I want to be involved with them, too. I don’t know them as well, but their website is full of helpful resources explaining the Pro-Life and Vegan connection. Also, they fully support LGBTQIA+ people.

    https://www.vegansforprebornrights.org/

    Oddly enough, the reason I became a Vegan was because I was Pro-Life for humans, and then I just extended it to other species of animals. I have answered many questions about Veganism over the years. I would say I have faced more criticism from co-workers at the jobs I have worked because I am Vegan than I have for being transgender! However, if I had to choose between being called by my correct pronouns and saving the lives of the animals, I would choose the animals every time.

    If you want more information on Veganism, I recommend the book “Why We Should Go Vegan” by Magnus Vinding. It is available free on Smashwords and is an excellent summary of the reasons it benefits the animals as well as humans if we adopt a vegan diet. I also recommend Magnus Vinding’s other books because most of them are about philosophy and ethics. He is an amazing author, and he introduced me to Smashwords even before Draft2Digital purchased it. Draft2Digital is the company I use to publish my e-books to this day.