Chastity Windows Reverse Engineering Notes


The Windows version of FASM includes header files for the Windows API. It also includes some examples, but not a single one of them were a simple “Hello World” console program.

Fortunately, I was able to find one that actually assembled and ran on the FASM forum. Below is the source code.

format PE console
include 'win32ax.inc'
.code
start:
invoke  WriteConsole, <invoke GetStdHandle,STD_OUTPUT_HANDLE>,"Hello World!",12,0
invoke  ExitProcess,0
.end start

To get it working required me to keep the include files in a location I remembered and set the include environment variable. I found this out from the FASM Windows documentation.

set include=C:\fasm\INCLUDE

However, there was another problem. The example that I found online and got working uses macros, most specifically, one called “invoke”. While this works if you include the headers, it hides the details of what is actually happening. Therefore, I decided to reverse engineer the process by using NOP instructions to sandwich the bytes of machine code.

90 hex is the byte for NOP (No OPeration). So to extract the macro call that exits the program, I use this.

db 10h dup 90h
invoke  ExitProcess,0
db 10h dup 90h

Then I disassemble the executable and find the actual instructions given.

ndisasm main.exe -b 32 > disasm.txt

As simple as this method is, it actually works. For example, this output is given as part of the output.

0000022D  90                nop
0000022E  90                nop
0000022F  90                nop
00000230  90                nop
00000231  90                nop
00000232  90                nop
00000233  90                nop
00000234  90                nop
00000235  90                nop
00000236  90                nop
00000237  90                nop
00000238  90                nop
00000239  90                nop
0000023A  90                nop
0000023B  90                nop
0000023C  90                nop
0000023D  6A00              push dword 0x0
0000023F  FF1548204000      call dword near [0x402048]
00000245  90                nop
00000246  90                nop
00000247  90                nop
00000248  90                nop
00000249  90                nop
0000024A  90                nop
0000024B  90                nop
0000024C  90                nop
0000024D  90                nop
0000024E  90                nop
0000024F  90                nop
00000250  90                nop
00000251  90                nop
00000252  90                nop
00000253  90                nop
00000254  90                nop

There can be no mistake that it is that location between the NOPs where the relevant code is. Therefore, I replaced the macro that exits the program with this.

;Exit the process with code 0
 push 0
 call [ExitProcess]

What I learned

As I repeated the same process for the other macros, I found that the way system calls in Windows work is that the numbers are pushed onto the stack in the reverse order they are needed. I was able to decode the macros and get a working program without the use of “invoke”. Here is the full source!

format PE console
include 'win32ax.inc'

main:

;Write 13 bytes from a string to standard output
push 0              ;this must be zero. I have no idea why!  
push 13             ;number of bytes to write
push main_string    ;address of string to print
push -11            ;STD_OUTPUT_HANDLE = Negative Eleven
call [GetStdHandle] ;use the above handle
push eax            ;eax is return value of previous function
call [WriteConsole] ;all the data is in place, do the write thing!

;Exit the process with code 0
push 0
call [ExitProcess]

.end main

main_string db 'Hello World!',0Ah

I don’t know much about the Windows API, but I did discover some helpful information when I searched the names of these functions that were part of the original macros.

https://learn.microsoft.com/en-us/windows/console/getstdhandle
https://learn.microsoft.com/en-us/windows/console/writeconsole

Why I did this

You might wonder why I even bothered to get a working Windows API program in Assembly Language. After all, I am a Linux user to the extreme. However, since Windows is the most used operating system for the average person, I figured that if I write any useful programs in Assembly for 32-bit Linux, I can probably port them over to Windows by changing just a few things.

Since my toy programs are designed to write text to the console anyway and I don’t do GUI stuff unless I am programming a game in C with SDL, I now have enough information from this small Hello World example to theoretically write anything to the console that I might want to in an official Windows executable.

Obviously I need to learn a lot more for bigger programs but this is the first Assembly program I have ever gotten working for Windows, despite my great success with DOS and Linux, which are easier because they are better documented and ARE TAUGHT BETTER by others. People programming Assembly in Windows have been ruined by macros which hide the actual instructions being used. As I learn how these things work, I will be sure to pass on the information to others!

Repost: Life Update


This is a post on my main blog about current projects and life goals.

Life and Career Update

Life and Career Update

A lot of cool things have been happening in my life lately. Most of it is good news. I have not been posting on my blog much because I have not had the time. I started a new department at Walmart and so far I enjoy it better than stocking. I work in Maintenance which really means I am helping clean the store. Sometimes emptying trash, sometimes sweeping or scrubbing the floor, and sometimes cleaning the bathrooms, which is difficult only because there are a lot of little things to remember such as filling the supplies and also mopping the floor in the correct way.

But I think what I love most about my new job as a Maintenance Mop Monkey is how my brain is free to think of other things while I am working because it takes a lot less concentration than stocking does. What am I thinking of during this time? The image below is a fine example of my thoughts!

dos-chartest-dosbox.png

I have been programming in Assembly Language for DOS lately. I find Computer Programming to be suspiciously relaxing because the world of math and computers is one where humans can’t hurt me.

The only risk I face while on my computer is when I get on social media and see hateful things directed at Transgender people, immigrants, or people in other countries. There are plenty of things I could say about what is going on in the world. However, I am not going to do any of that because I have realized that to become a better writer, programmer, and Chess player, I must maintain my supreme autistic focus because that is my gift from God.

Anyway, when computer programming, there are only numbers. The arithmetic operations of addition, subtraction, multiplication, and division never change and I can count on them more than I can people. My time is better spent improving my code and working on my current book project for teaching DOS Assembly Language. I have even created a simple cover for it.

aaa-dos-cover-front.png

The theme is black background with white text because this is the way the DOS (Disk Operating System) looks.

The goal of this book is a little bit different than most of my books. In fact the target audience for this book is very niche. People don’t write programs for DOS unless it it for fun. There is no money in being able to write programs for DOS because the rest of the world has moved to Windows, MacOS, and Linux which support 32 and 64 bit systems with more capability and 16 bit DOS.

Instead, this book will be my first computer programming book for the purpose of both teaching Assembly Language to the nerds of the world and as an exercise of my Technical Writing skills. This will be the third technical writing book.

The first book was Chastity’s Chess Chapters for teaching Chess to people of every kind.

The second was Minimal Markdown for Authors for teaching other writers how to format and publish their books using similar methods to what I have used.

This next book, Assembly Arithmetic Algorithms, will be my entry into publishing books about computer programming. This special interest of mine has gone largely ignored because people who write computer programs are *not normal people at all! Computer programming takes concentration, lack of a social life, and the ability to read a lot! I read programming tutorials and books when I have free time. Some of them are free online and others I have bought from various sources in paperback and digital form.

I can’t claim to be a great programmer, but what I can do is squeeze the information I have learned into a form that allows other people to learn the same things faster. Aside from teaching Chess, I also volunteer to teach computer programming to friends who are interested in learning. I can easily throw together lessons based on questions they have. Where I will find the time for this? I don’t have a clue.

But the goal of writing books and recording video tutorials is so that eventually I can have a career that does not depend on working at Walmart forever. Although Walmart is going fairly well, I know that the wrong people in management can take away my job if they feel like it. What they cannot take away is my writing, math, and computer skills which I hope will make a difference for people even after I am long dead.

Also, my Creative Writing diploma finally came!

chastity-creative-writing-full-sail-degree.png

I found my time with Full Sail University to be quite positive. I was inspired as I learn the potential there is for someone with the patience to write. My experience with Open Source Software will also be an asset to me because I can use tools that no college or tech company even will know about.

As I think about possible careers, I think how much potential I have in terms of experience at previous jobs but also skills of writing and technical details that most people simply haven’t learned because it takes someone with the willingness to learn for the fun of it even when there is no promise of financial gain. If I do make money in a future career using my skills, that is great, but it is not the primary motive.

I remember the words of Carol Keepes who used to be my Assistant Manager back in 2012 when I was a courtesy clerk at Hy-Vee. She said “90% of what people do, they wouldn’t be doing if it wasn’t about money.” I think about this often and it is the reason I have made decisions in life that look foolish to most of the world. I want to make sure that I did things because I really loved the process rather than viewing them as a means to an end.

See my post The Prayer of Saint Chastity for clarification on my priorities.

How The Chandler Caterpillar Evolved into a Chastity Butterfly


Chastity’s Journey into a career in writing began in 2013 when she published a book titled “Confessions of a Confused Virgin”. This book project was intended to teach Chastity about the process of self-publishing a book so that she could help her mother, Judena Klebs, publish the books she had written.

However, the people on Facebook enjoyed Chastity’s different points of view on dating, marriage, and sex. After that, Chastity started blogging on a WordPress blog about whatever she had on her mind at the time. Eventually, these small posts became content for future books she would publish.

The majority of her writing was a series of conversations she had with a unicorn in a dream. The series remains forever published as “Chandler’s Honesty” because Chandler is her legal name even though she is known by her preferred name of Chastity White Rose. Unlike most transgender people, Chastity does not consider Chandler to be a “dead name” but instead a name of historical importance as she evolves from a caterpillar to a butterfly and yet remains the same person.

butterfly.png

Chastity is a simple person who prefers playing Tetris or Chess much more than writing. However, she began a project in Pride month of 2025 with a focus on educating the public about the LGBTQIA+ community that is different than the hype you would hear from mainstream media.

Chastity graduated with a Creative Writing Degree in July of 2025 after attending Full Sail University as an online student while working full-time at Walmart in Lee’s Summit, Missouri.

Her best paperback books and ebooks can be purchased from Amazon, Apple Books, Google Play books, and many others. These works cover a range of topics, such as opinions on politics or religion, her Journey as an Asexual Transgender woman (Chandler’s Honesty), and even a 100-page book about the board game of Chess (Chastity’s Chess Chapters).

But beyond writing books and blog posts, Chastity is offering services to help others write and publish their books, blogs, and websites. Those who have a story to tell but who may not be as technologically inclined may benefit from her experience using Kindle Direct Publishing, Draft2Digital, WordPress, and writing content with Markdown and HTML.

Chastity writes on two main websites that she pays to keep free of ads and distractions.

You can also follow her author profiles for updates on the latest books she publishes.

The Long Term Effects of Abuse


Chastity White Rose's avatarChastity White Rose

This is not something I have talked about much but recently I have become aware of just how permanent the psychological effects are from when I was sexually abused as a child.

I also have decided to officially break my silence on who it was that sodomized me at the age of two. It was my older brother who was adopted into our family. There are two reasons I finally knew that I needed to tell about this.

First of all, I was recently informed that he also abused his daughter as well. I do not know the details of that exactly but he does have a long criminal record. I do hope that something can be done to guarantee he is no longer allowed to hurt anyone else.

The second reason is that if I don’t tell who it was, then perhaps someone would assume that it was someone…

View original post 755 more words

ET Cannon Jimothy’s List


Chastity White Rose's avatarChastity White Rose

This post contains pictures of all 13 of Jimothy’s solutions to the ET Cannon bag 5 as well as their reverse forms. This list was made for my quick reference but others may find it helpful.

Perfect 1

Perfect 2

Perfect 3

Perfect 14

Perfect 23

Perfect 26

Perfect 28

Perfect 36

Perfect 39

Perfect 40

Perfect 41

Perfect 50

Perfect 61

The actual work of laying these out was done by me, Chastity White Rose. However the solutions were originally hand picked by the player Jimothy. If he is correct, then these solutions allow for 100% perfect clear when doing the ET cannon. I am the first to show the reversed form because there are times when it is required to built the opening backwards if your first two pieces are the S and T.

View original post

National Coming Out Day


Chastity White Rose's avatarChastity White Rose

My roommate, River, informed me that October 11 is national coming out day. In celebration of this I thought I would share some happy moments we have had recently.

The checkerboard dress you see in these pictures was one I bought myself around the time of my 31st birthday when I came out as transgender for the first time. River and I were playing around with it and taking some memory pictures. It was a good time.

River and I are both transgender, but we go far beyond expectations of people and it’s important to not let people put us into a box of expectations. Not all trans people want or need the same things. If I had to describe being transgender in my own words, I would say that it is about not letting other people’s prejudice or the body you were born with define what person you are…

View original post 169 more words

Create your own website, free on WordPress.com.Create your own website.
Start free