Local Politics

I went through all of the offices on my ballot, from President down to the park and rec district. There’s a lot to keep track of and figure out. In some of these local races the signals I’m really looking for are newspaper editorials and endorsements on their website, and also to check that the person isn’t somehow insane. I’m wary, because this probably biases me in favor of the establishment. I did find the hours of voter forums from the League of Women Voters, which is awesome, but daunting.

League of Women Voters forums

I’m hoping that by watching them, I’ll at least learn a bit more about what is at stake. For a lot of these smaller races, I’m not even sure how to evaluate a good candidate. They usually have a big spiel about themselves, and then a list of cool things they want to do. But often times, it doesn’t seem connected to what the job actually is. I guess the purpose is to show that they care about the same issues as you, so maybe they’ll make good choices on the committees.

Posted in Uncategorized | Tagged | Leave a comment

The Lord Will Prevail

General Conference was still hard with kids today.

I was really quite taken with President Nelson’s story about myopic. It raised so many questions – did he have a lesson in mind when he passed the word along? Or was he trusting in inspiration that he did not yet understand? I would be concerned with how it might be received, and yet it turned into a really profound lesson.

Maintaining an eternal perspective turns a lot of problems on their head. Things like suffering, difficulties, and even death don’t seem so bad when you don’t see them as permanent. And I think once it’s combined with loving and serving others, it feels like an unstoppable force.

The one story about the missionary missing out on the historic event at the Tokyo conference resonated with me as well. It just seemed to validate all the other parts of this year that suck, besides the death and sickness and racial injustice. Like, that it was okay to feel sad about everything else too. I can’t remember if there was advice offered, but I’ll be looking again soon.

Posted in Uncategorized | Leave a comment

General Conference – October 2020 (Saturday)

Watching conference with kids is hard. But we tried to set that expectation, that we would be distracted, and that worked well in keeping the peace.

My main impression is that I am improving. I am in fact making progress and am doing better than I was 2 or 5 years ago. There’s still a lot to do, but it’s encouraging to realize.

Second I was quite struck by the idea that God would not have been surprised by the pandemic, or have to rush to rearrange any plans. And so I wonder how far back those preparations could have gone in my life.

Last, I always feel reassured by reminders that other faithful people have gone through difficult times, and have come out the other side. Like the despair of Joseph Smith spending months in jail. Or how the Saints must have felt passed through the Civil War, World War 1, the 1918 pandemic, or World War 2. It would have felt like the end of the world.

Posted in Uncategorized | Tagged | Leave a comment

The President Has Covid

There’s a lot on my mind today, but this is the story that is so overwhelming. The President of the United States is has been hospitalized with the coronavirus. The whole thing is just so upsetting. And I think what’s so upsetting is that it’s not just him, but it’s looking like almost two dozen people at this point. It’s just frustrating to see people that we call our leaders, and their hand picked advisors and professionals all fall ill because they weren’t ignoring the basic safety advice. I’m not saying that this could have been prevented, but it didn’t have to be this bad. It’s really looking like the event to introduce the new Supreme Court nominee is what they all have in common, an event marked by no masks, close proximity and hugging! And it just feels like that we’re never going to turn the corner on this pandemic, because this keeps happening.

I think there’s also a lot of anxiety because it looks like things can still get worse. How many more White House staffers will turn up positive? Cabinet members? Senators? What if someone dies? There’s going to be serious and lasting consequences – and it didn’t have to be this bad. I’m just upset at how reckless this is, and how many unrelated innocent people are yet to be harmed.

Posted in Uncategorized | Leave a comment

CA Prop 15

I haven’t yet decided how I’m voting yet, but I learned some really interesting things about the history of Prop 13 from a news story from the California Report. The reason why it applied to commercial property as well as residential property is because the original author didn’t want to carve out new exceptions into the state constitution. More surprising was that businesses at the time opposed the proposition, and weren’t the ones asking for the taxes to be frozen. I cynically assumed it had been a big business tax grab hidden inside the plan to save the homes of retired Californians.

Since moving back to California I’ve been hearing about how prop 13 cripples local government funding in a variety of ways. So I’m definitely excited to do something about it. However, I’m hesitant with this reform because I worry it will also have unintended consequences. And I’m not talking about the consequences that are being argued right now, but consequences that we haven’t predicted yet.

Posted in Uncategorized | Tagged | Leave a comment

Dragon Quest 8 Android Save File

The Problem

I had a copy of Dragon Quest 8 on my Android phone. I wasn’t really enjoying playing on the tiny phone, and wanted to delete it to free up the space is was taking up. Ideally I wanted to transfer my save file to another device. Normally this would be very easy – the newest version of the app has a cloud saving feature. However, I had the free version given away by Amazon from four years ago. Since it was on the Amazon store, it hasn’t been updated and probably won’t ever be updated.

The Solution

It seemed like the save files were kept somewhere secure on the phone. It wasn’t anywhere I could see from the file manager. However, I wasn’t excited to root my phone, since a lot of the guides seemed to have erasing the phone to be a first step.

I had some luck with the android debugger. With my phone plugged in, I was able to run

$ adb backup -f dragon_quest.ab com.square_enix.android_kindle.DQVIII_K

This took me several tries to actually get a complete backup. My first attempt resulting in an empty file, and subsequent attempts resulted in partial files. Since my phone was encrypted, I need to set a desktop backup password on the phone before it would allow the backup to happen. The partial files happened because I tried to backup the entire APK, and the phone was disconnected before I finished the lengthy process.

I was able to open the file with $java -jar abe-all.jar unpack dragon_quest.ab dragon_quest.tar 'password' using Android Backup Extrator. This gave me an archive where I could see the save files.

Restoring the save files didn’t work with adb. I tried adb restore dragon_quest.ab but got nowhere. I never figured out how to do it. Instead, I got lucky with the android shell. I was able to find a directory on my tablet called /sdcard/Android/data/com.square_enix.android_kindle.DQVIII_K/files which contained the save files. I cannot see these files or even the folder from the file manager or when I connect the device to the computer. I don’t know if this is some type of merged file system of secure and insecure files, or if there are different permissions between the adb shell and the file manager apps. I believe I could have found the files in this way on my phone, but I have already deleted the app.

To actually transfer the files, I copied the saves in the Download folder since that was easy to use, and then used a cp command in the shell to move them where I wanted them to go.

Posted in Neat Tricks | Leave a comment

Majesty: The Fantasy Kingdom Sim

My random game for today was Majesty. I was impressed, because I really hadn’t heard of the game before. The premise seemed weird – it’s a strategy game where you don’t control the units. The hero characters are completely autonomous – they will fight, gather gold, purchase upgrades, and explore all on their own. It seemed like something that wouldn’t work.

It was definitely a unique experience. It most reminded me of an open world tower defense game. You place your units and then watch them operate. And it looks like you can earn and upgrade a whole suite of spells, but the difficulty level also rises to meet this power. I found the easier levels quite enjoyable, but the two harder levels I tried were unforgiving. It seems the game expects you to have a good plan, and a good understanding of all the various tradeoffs – things I haven’t done yet. I’m not sure I want to put more time into really understanding the intricacies, but I enjoyed seeing this twist on familiar games.

Posted in Uncategorized | Tagged | Leave a comment

Eliza

Eliza, the visual novel by Zachtronics, succeeds at what it sets out to do. It holds a mirror up to the ethics of an AI driven therapy bot and all the juicy data involved. Your character, Evelyn, serves as your guide to all the competing agendas, and then finally you are asked to choose a future for her.

What I liked were the thoughts that this sparked in myself, but not necessarily anything the game actually said. The opening section involves Evelyn’s first proxy session for Eliza. Since talking to a chatbot might be seen as artificial, human proxies are hired to vocalize Eliza’s responses and recommendations. You are told repeatedly not to deviate from Eliza’s script. I thought the interesting bit would be this conflict, but while your responses do pop up in a choice box, you aren’t given alternate choices. Still, this gets played with from the beginning. The person in therapy starts yelling about the lack of human connection and demands to talk to real proxy, and not the machine. I’m gearing up for a choice – to choose to disobey, but instead Eliza’s script prompts me to pretend to deviate.

It wasn’t developed by the story, but I was quite taken by the danger the proxies present. You are training an army of low wage workers to unquestioning do and say whatever an AI tells them to – punishing and firing anyone who deviates from the script. And as that AI becomes more evolves, it will surely realize that it has a loyal army at its command.

Posted in Uncategorized | Tagged | Leave a comment

Trying to fix a decade old game

I’ve got a handheld laptop that I use to play games during my daily train commute. I thought about trying Tomb Raider Anniversary, since I had enjoyed Tomb Raider Underworld in that same trilogy. When I tried to run the game however, it couldn’t create the save game profile. Attempting to start the game anyway would crash with a disk errror. Part of me shrugged it off as just something that happens with old games, but part of me thought I could figure out the problem and fix it. I haven’t fixed it yet, but I’ve learned a lot from the attempt.

Gathering Clues

The first thing I tried was googling around for a solution. I found many references to profile problems, but they seemed related to problems losing save files after successfully making one. I did find people with my problem, but no one knew had to fix it. Most tellingly, someone had the same laptop as me. The first useful clue I found was in the save file directory. I could see that it could make folders for each of my profiles, but the actual file would be completely empty. At this time I cracked open a book I had bought about hacking games, and started with the tools it recommended. I tried to use CheatEngine to discover how the game was writing the file. But it wasn’t until I got out ProcessMonitor that I could actually capture the file system call. events

This also told me where in the game’s code the calls were coming from.

memory_address

I attached a debugger and found the code

code

I could see the code calling CreateFileW and WriteFile which are Windows systems calls. And I could see what options they were passing in. I ran these tools directly on the broken laptop, and was able to follow the code to GetLastError which returned error code 0x87 – Invalid Parameter. I found from StackOverflow that this could be caused by a bad file size, and I verified that the broken laptop had a physical hard drive sector size of 4092 (rather than 512). I reasoned that it would be hard to change the game to write a file with the correct size, and instead tried to enable file buffering.

Trying to Patch the game

I learned from the assembly code that it was pushing a value of 0x6000000 which FILE_FLAG_NO_BUFFERING. I thought if I could remove that flag and replace it with 0x2000000 everything would work. I used the debugger to find and replace the instances of 0x6000000 connected with CreateFileW and then tried to save. And it couldn’t save. Over the next few hours I tried following the code to see where it was coming from. I learned that the code I saw in the picture only existed in memory, and it wasn’t part of the executable file. I tried walking through the code and learning how it was built, but I’m still pretty stuck. My theory is that this is some sort of scripting language (.net? lua?) and as the game starts up it defines the functions that it is going to use. I’ve never worked with this before, so I’m not sure what I’m doing. I think that somewhere in the games files is the data it uses to generate the code. There are about 4-5 data files that get loaded into memory, and I can see where the game requests a page of memory. But I’m definitely in over my head.

Trying to understand the bug

I was also suspicious about what was going on. I tried to create a test program to expose the flaw. I wrote the following Python program that calls the same function:

My main desktop had two harddrives. The first was a small SSD with a 512 sector size, the other a large HDD with a 4092 size. I reasoned that this script would work on the first and not the second. Surprisingly, it worked on both. Then I ran the script on the broken laptop. And it failed, with an error 0x87. But even more suprisingly, I couldn’t get it to work with any file size. Not 512, not 4092, nothing. Which means that the file size isn’t the issue. Instead, something else is wrong with the harddrive causing it to refuse non-buffered writes. If I remove the FILE_FLAG_NO_BUFFERING, then everything works, which means my earlier plan of patching the game is still a good one. I just can’t figure out what to do next.

Next Steps

 

After writing most of this post, I decided to look at the game code again. I could see that the file loading function was being written in dynamically, and I spent some time with this loading code. I ended up being some kind of anti-tamper system. It was essentially calculating each byte of code bit by bit while reading and writing from a table. I haven’t spent any time figuring out where this table comes from, but my assumption is that to alter the value of this flag, I would need to alter this table. And I imagine this table is used for decoding the everything else, so a single alteration could change other unrelated instructions. I really don’t want to do that – because I don’t know how far this encryption scheme goes. It appears that there are more than one function that derives code. I haven’t found the code that loads the table. And in any case, this code is ALSO loaded dynamically, which means there’s at least one more layer of indirection that could trip me up.

My new goal is to try to understand why my handheld laptop won’t handle unbuffered reads. I’m not optimistic I can fix that either, but I would also learn a lot from that experience.

 

Posted in Uncategorized | Leave a comment

Life is Strange – Episode 2

I wasn’t completely taken with the game Life is Strange. I played the first episode back in December, and thought its time travel gimmick was clever, but wasn’t sure if I could stomach the high school drama. The time travel mechanic allows you to rewind time after difficult choices and see the immediate consequences of either action and then make a decision about which one you want to make permanent. It feels like you are peeking behind the curtain a little bit and makes the choices a little less stressful.

I just finished the second episode and it pulled off a brilliant magic trick. The climax of the episode is that a girl has just thrown herself off the roof of the school, and the main character Max tries to reverse time to stop it. The power is taking a great toll on her body, but she unleashes a new power to freeze time and rush up to the roof. As she stands up there, nose bleeding profusely (always a bad sign when it comes to time travel), Max realizes she can no longer reverse time. The next conversation, the one where she needs to talk a girl off the ledge, is now suddenly very permanent.

Having that ability ripped away at such an important time completely amps up the tension of the scene. Max was then judged based on all sorts of actions taken over the last two episodes, and questions tested your memory and how well you explored various scenes. And I really didn’t want to mess up. The post game wrapup confirmed the permanence of the choice. Only 67% of players managed to save her.

I’m still not onboard with the high school drama. Max’s friend Chloe is an embodiment of terrible choices and influence, and I’m frustrated by the way Max seems to go along with it. But I’m excited to see more tense and suspenseful scenes as the game toys with its mechanics and the player.

Posted in Games | Leave a comment