Tag: books

  • Chapter 18: Alliance of Convenience

    “Stacy, what did you want to talk about?” asked Chad.

    “I wanted to ask something. Chad, would you officially be my boyfriend?” asked Stacy.

    “What do you mean by boyfriend? Does that change anything between us?” asked Chad.

    “No, it doesn’t change anything between us. We will still be the same great friends we already are. However, I think we should seriously consider spending the rest of our lives together. It solves several problems,” said Stacy.

    “What do you mean by problems?” asked Chad.

    “I have two problems. The first is that my dad and I just had a fight over you. He disagrees with what you are teaching the children about the Bible. Because I fully support what you are doing, he accuses me of being in love with you and taking your side because I am blinded by my feelings. Second, I am tired of church women trying to hook me up with their sons or having guys like Luke repeatedly ask me out on a date when I have made it very clear I am not interested. It would be convenient if people already knew I had a boyfriend,” said Stacy.

    “So, are you in love with me, or is it just socially convenient for people in town to think we are together?” asked Chad.

    “I’m gonna be real with you, Chad. I have never met a Christian as true as you. You spend every second thinking about the right move both in Chess and in life by asking what Jesus would do. If I am falling in love with you, it is because of the person you are and who you have chosen to be. I do love you, but I am not sure in what way. I only ask that we explore where this goes,” said Stacy.

    “And if something goes wrong, will it ruin our friendship?”

    “What could possibly go wrong, Chad? But I promise you that if all else fails, we will remain friends, and I still want to help you explore what it means to be a true Christian and teach the children with you.”

    Chad and Stacy had been talking so long that they completely forgot Matt was still sitting there watching them. He got up from his chair and started walking towards the door.

    “Hey Matt, where do you think you are going?” asked Chad.

    “I will let you two lovebirds finish your conversation privately. I won’t get in the way,” said Matt.

    “Thanks, Matt, but just remember, if Stacy and I have a wedding, you will be my best man,” said Chad.

    “Thanks, Chad. Good night”, said Matt.

    “Are you already planning our wedding, Chad?” said Stacy.

    “A good Chess player needs to think a few moves ahead of the current position”, said Chad.

    “Well said, Chad, but does this mean you agree to be my boyfriend?” asked Stacy.

    "Stacy, you are the only girl in this town I know that is a Vegan who loves animals as much as I do. I also know that you have changed since I met you. You wanted to keep your life private and hesitated to join Soccer Sundays because you didn’t want to be in the spotlight. Here you come asking me, the most famous guy in the town, to be your boyfriend. So yes, I agree, but this is an irreversible decision, and I hope you are prepared for a real commitment, instead of an alliance of convenience.

    “What do you mean, irreversible?” asked Stacy.

    “Your life will change forever once we are known as a couple. You won’t shake the reputation of being the only girlfriend of Chad Isaac, the watermelon and tofu-eating soccer star. Do you think you can handle the gossip that will happen in this small town where everybody and their dog knows what is happening?” asked Chad.

    “I am prepared for whatever comes our way, but what do you mean that I am your only girlfriend?” asked Stacy.

    “Believe me, Stacy, plenty of girls have flirted with me, and their parents have tried to play matchmaker, but I can tell when people are only interested in my money or social influence. I turn them all down because I need someone who matches my values, and you are the only one who talks to me like a person instead of dropping hints and doing the flirty eyes.”

    “Speaking of which, be wary of my father. Reputation and money are all he cares about, but I am not like my father. I hope you understand that”, said Stacy.

    “I figured that out the day you slapped Pastor Mark and told him off after he tried to fire me from being a volunteer Bible story teller. I know you are different, and I am glad you talked to me about this,” said Chad.

    Chad and Stacy continued to talk about many things that night, including their relationship and future things they could do for the animals and the children of Podunk.

  • Chastity’s List of Completed Full Sail University Classes

    This list contains all the classes I completed as part of 3 different programs. My original enrollment was in Game Business and Esports Science, but then I switched to creative writing. After graduation, I took some computer programming classes as part of the ACE (Alumni Continuing Education) program.

    These varied interests I have all have a generic theme. Storytelling as it relates to video games includes two parts. There are the words of the story and how the games are communicated in English to humans. The other side of it is the math that computers understand as well as autistic math nerds like me.

    Joseph Sheckels
    Systems Programming – Online
    SDV3111-O • Term C202603 • Section 02

    Garrett Girod
    Programming II – Online
    COP2334-O • Term C202602 • Section 04

    Davide Bisso
    Career Readiness – Online
    CRR4000-O • Term C202601 • Section 17ACE

    Douglas Arley
    Programming I – Online
    COP1334-O • Term C202601 • Section 08

    Joshua Collier
    Project and Portfolio III: Creative Writing – Online
    CWB338-O • Term C202506 • Section 02

    Matthew Peters
    Publishing and Distribution – Online
    ECW2953-O • Term C202505 • Section 02

    Convert Instructor
    Graduation Launch
    GRAD4000-O • Term C202506 • Section 05

    Joshua Begley
    Literary Genre I: Comedy and Tragedy – Online
    ECW3111-O • Term C202504 • Section 03

    John King
    Project and Portfolio II: Creative Writing – Online
    CWB228-O • Term C202503 • Section 02

    Cory Helms
    Television Writing – Online
    ECW3702-O • Term C202502 • Section 02

    Elise McKenna
    Developing New Worlds: Environment and Historical Research – Online
    ECW2841-O • Term C202501 • Section 02

    Genevieve Tyrrell
    Project and Portfolio I: Creative Writing – Online
    CWB119-O • Term C202412 • Section 01

    Cory Helms
    Writing Workshop I: Film – Online
    ECW4101-O • Term C202411 • Section 02

    Beth Strudgeon
    Introduction to Media Communications and Technologies – Online
    MCM1002-O • Term C202410 • Section 03

    Christopher Ramsey
    Multimedia Storytelling – Online
    ECW1409-O • Term C202410 • Section 01

    Brett Pribble
    Creative Skills Development – Online
    ECW1225-O • Term C202409 • Section 03

    Cory Helms
    Literary Techniques and Story Development – Online
    ECW2123-O • Term C202408 • Section 04

    Becca Godsey
    Professional Development Seminar II: Game Business and Esports – Online
    GBE3222-O • Term C202407 • Section 02

    Aaron Conner
    Project and Portfolio II: Game Business and Esports – Online
    GBE229-O • Term C202407 • Section 01

    Ren Vickers
    Game Business Models – Online
    GBE2501-O • Term C202406 • Section 01

    Shane Marcus
    Physical Science – Online
    PHY3020-O • Term C202405 • Section 05

    Ashley Jones
    Professional Development Seminar I: Game Business and Esports – Online
    GBE1111-O • Term C202404 • Section 01

    Becca Godsey
    Project and Portfolio I: Game Business and Esports – Online
    GBE119-O • Term C202404 • Section 01

    Terry Clark
    College Mathematics – Online
    MGF1213-O • Term C202403 • Section 04

    Otavio Moulin Lessa
    Gaming Culture and Engagement – Online
    GBE2001-O • Term C202402 • Section 01

    Philip Lacinak
    Digital Video and Audio Production – Online
    MCM2416-O • Term C202401 • Section 02

    David Sussman
    English Composition I – Online
    ENC1101-O • Term C202312 • Section 37

    Mike Dunn
    New Media Tools – Online
    MCM1203-O • Term C202311 • Section 09

    Ricky Sellers
    Video-Sharing Platforms – Online
    VID1555-O • Term C202310 • Section 01

    Katherine Coulthart
    Storytelling for Marketing – Online
    MKT163-O • Term C202309 • Section 02

    Alexia Brehm
    Introduction to Marketing – Online
    MKT210-O • Term C202308 • Section 01

    Brandon Morris
    Introduction to Esports Production – Online
    GBE1021-O • Term C202307 • Section 02

    Charles Cardwell
    Introduction to the Gaming Industry – Online
    GBE1001-O • Term C202306 • Section 02

    Jennifer Salzberg
    Psychology of Play – Online
    DEP1013-O • Term C202305 • Section 17

    Eddie Tapia
    Creative Presentation – Online
    GEN1011-O • Term C202304 • Section 26

    Orientation Team
    Full Sail Online Orientation (FSLE) – Online
    GEN2000-O • Term C202304 • Section 06

  • chastelib test suite for 32-bit Linux GNU Assembly Language

    Ever since I figured out the technique for translating NASM source files into GNU Assembler source files, I have been quite excited at the possibilities. I translated the whole chastelib library into this syntax. This means that I could even learn to use these as inline assembly in C programs on Linux. I am not sure what the benefit is unless of course I enter some kind of obfuscated code contest!

    main.s

    # Using Linux System calls for 32-bit
    # Tested with GNU Assembler on Debian 12 (bookworm)
    # It uses Chastity's putstring function for output
    
    .global _start
    
    _start:
    
    
    mov $main_string,%eax # move address of string into eax register
    call   putstring      # call the putstring function Chastity wrote
    
    movl $0x10,radix # set the radix to sixteen or hexadecimal
    movl $1,int_width # set the minimum integer width
    
    mov $input_string,%eax
    call strint
    
    mov %eax,%ebx # copy eax to ebx before we use it in a loop1
    
    movl $0,%eax # zero eax
    
    loop1:
    
    movl $2,radix # set radix to binary
    movl $8,int_width # width of 8 bits
    call putint
    call putspace
    
    movl $0x10,radix # set radix to hexadecimal
    movl $1,int_width # width of 2 hex digits
    call putint
    call putspace
    
    movl $10,radix # set radix to decimal (what humans read)
    movl $3,int_width # width of 3 decimal digits
    call putint
    call putspace
    
    cmp    $0x20,%al
    jb     not_char
    cmp    $0x7e,%al
    ja     not_char
    
    call putspace
    call putchar  # print the character if it is in the range 0x20 to 0x7E
    
    not_char:
    
    call putline
    inc    %eax
    cmp    %ebx,%eax
    jne    loop1
    
    mov    $0x1,%eax      # system call 1 is exit
    mov    $0x0,%ebx      # we want to return code 0
    int    $0x80          # end program with system call
    
    main_string:
    .string	"This program is the official test suite for the Linux Assembly version of chastelib.\n"
    
    input_string:
    .string	"100"
    
    putstring:            # the start of the putstring function
    push   %eax
    push   %ebx
    push   %ecx
    push   %edx
    mov    %eax,%ebx
    
    putstring_strlen_start:
    cmpb   $0x0,(%ebx)
    je     putstring_strlen_end
    inc    %ebx
    jmp    putstring_strlen_start
    
    putstring_strlen_end:
    sub    %eax,%ebx # subtract eax from ebx for number of bytes to write
    mov    %ebx,%edx # copy number of bytes from ebx to edx
    mov    %eax,%ecx # address of string to output
    mov    $0x1,%ebx # file handler 1 is stdout
    mov    $0x4,%eax # system call 4 is write
    int    $0x80
    
    pop    %edx
    pop    %ecx
    pop    %ebx
    pop    %eax
    ret
    
    .data        # must declare data section for mutable memory
    
    int_string:  # storage for the bytes of an integer
    .skip 32,'?' # unknown bytes represented with question marks
    .byte 0      # terminating zero of this string
    
    int_newline: # optional newline to print after a number
    .byte 0xA,0
    
    radix: .long 2
    int_width: .long 8
    
    intstr: # start of the intstr function
    mov    $int_string+31,%ebx
    mov    $0x1,%ecx
    
    digits_start:
    mov    $0x0,%edx
    divl   radix            # divide by number at address radix
    cmp    $0xa,%edx
    jb     decimal_digit
    jae    hexadecimal_digit
    
    decimal_digit:
    add    $0x30,%edx
    jmp    save_digit
    
    hexadecimal_digit:
    sub    $0xa,%edx
    add    $0x41,%edx
    
    save_digit:
    mov    %dl,(%ebx)
    cmp    $0x0,%eax
    je     intstr_end
    dec    %ebx
    inc    %ecx
    jmp    digits_start
    
    intstr_end:
    cmp    int_width,%ecx # see if ecx is above or equal to the integer width we want
    jae    end_zeros
    dec    %ebx
    movb   $0x30,(%ebx)
    inc    %ecx
    jmp    intstr_end
    
    end_zeros:
    mov    %ebx,%eax
    ret
    
    putint: # the putint function calls intstr and then putstring to display any number
    
    push   %eax
    push   %ebx
    push   %ecx
    push   %edx
    call   intstr
    call   putstring
    pop    %edx
    pop    %ecx
    pop    %ebx
    pop    %eax
    ret
    
    # the strint function is arguably the most complicated assembly function I have ever written
    # it can convert any string into a number based on the current radix
    # as soon as it finds a zero byte or a charact that is not a valid digit in that radix
    # it will return the value in the eax register so it can be printed or used elsewhere
    
    strint:
    mov    %eax,%ebx # copy string address from eax to ebx because eax will be replaced soon!
    mov    $0x0,%eax # eax set to zero before digits multiplied in
    
    
    read_strint:
    mov    $0x0,%ecx
    mov    (%ebx),%cl
    inc    %ebx
    cmp    $0x0,%cl
    je     strint_end
    cmp    $0x30,%cl
    jb     not_digit
    cmp    $0x39,%cl
    ja     not_digit
    
    is_digit:
    sub    $0x30,%cl
    jmp    process_char
    
    not_digit:
    cmp    $0x41,%cl
    jb     not_upper
    cmp    $0x5a,%cl
    ja     not_upper
    
    is_upper:
    sub    $0x41,%cl
    add    $0xa,%cl
    jmp    process_char
    
    not_upper:
    cmp    $0x61,%cl
    jb     not_lower
    cmp    $0x7a,%cl
    ja     not_lower
    
    is_lower:
    sub    $0x61,%cl
    add    $0xa,%cl
    jmp    process_char
    
    not_lower:
    jmp    strint_end
    
    process_char:
    cmp    radix,%ecx
    jae    strint_end
    mov    $0x0,%edx
    mull   radix
    add    %ecx,%eax
    jmp    read_strint
    
    strint_end:
    ret
    
    space: .byte ' ',0
    line: .byte 0x0A,0
    
    putspace:
    push   %eax
    mov    $space,%eax
    call   putstring
    pop    %eax
    ret
    
    putline:
    push   %eax
    mov    $line,%eax
    call   putstring
    pop    %eax
    ret
    
    char: .byte 0,0 # where char data is temporarily stored by the putchar function
    
    putchar:
    push   %eax
    mov    %al,char
    mov    $char,%eax
    call   putstring
    pop    %eax
    ret
    
    # This Assembly source file has been formatted for the GNU assembler.
    # The following makefile rule has commands to assemble, link, and run the program
    #
    #main-gas:
    #	gcc -nostdlib -nostartfiles -nodefaultlibs -static main.s -o main -m32
    #	strip main
    #	./main
    
    

  • 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.

  • Professional vs Open Source

    I totally spent 5 hours writing a program in Assembly Language. I realized that what I am doing is something that cannot be done for money in any way. The best that I can do is to learn the technical skills and then continue working on my books and API references I plan to write.

    But as far as my programs themselves, they don’t fit the model of how the world works. In a job, you are constantly pressured to do as much work in as short of a time as possible. Therefore, you are paid, hired, or fired based on how fast the program can be written for the client, regardless of whether it works correctly or has bugs or security flaws.

    But when I write computer software for myself, I am the only one to decide whether it meets my standards. I have said many times over the past 20 years that I would not want a job as a programmer. This is because I am only interested in the things I want to do. I find that I am at peace when the things I do are not attached to the love of money.

    I believe that money and the corporate world actually ruins top quality work. There are also things that the Open-Source Software movement has made possible that could never be done under a company with a proprietary system. Strangers who don’t even know each other offer improvements on programming forums to people out of the goodness of their heart with no financial incentive.

    I see something similar in the world of Chess. People who are playing for fun can enjoy the game at a higher level than those who are stressed out competing in tournaments to win money. I sometimes feel myself pulled in a direction I didn’t know existed. I will work to explore this feeling I get where I achieve inner peace for a moment when I am having pure fun and losing track of the time.

    I used to feel this way when playing video games as a kid. Now I get it from writing books, blog posts, and computer programs. I still enjoy games though. I plan to eventually getting back into my games but I have had a busy life lately.