<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Posts on Oyashoku - A Midnight Snack</title>
    <link>http://www.oyashoku.com/posts/</link>
    <description>Recent content in Posts on Oyashoku - A Midnight Snack</description>
    <generator>Hugo</generator>
    <language>en-au</language>
    <lastBuildDate>Sun, 24 May 2026 00:00:00 +0000</lastBuildDate>
    <atom:link href="http://www.oyashoku.com/posts/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>MSI Afterburner file obfuscation</title>
      <link>http://www.oyashoku.com/posts/afterburner/</link>
      <pubDate>Sun, 24 May 2026 00:00:00 +0000</pubDate>
      <guid>http://www.oyashoku.com/posts/afterburner/</guid>
      <description>&lt;p&gt;MSI Afterburner trivially obfuscates a couple config/definition files in their program folder used to define different models and the such.&lt;/p&gt;
&lt;p&gt;At a high level:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Generate the CRC32 of MSIAfterburner.exe&lt;/li&gt;
&lt;li&gt;Use said CRC32 hash as the initial seed&lt;/li&gt;
&lt;li&gt;XOR a byte then rotate.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Roughly:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;def&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;rolling_xor&lt;/span&gt;(data, initial):
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    state &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; initial
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    result &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; bytearray(data)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;for&lt;/span&gt; idx &lt;span style=&#34;color:#f92672&#34;&gt;in&lt;/span&gt; range(len(result)):
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#75715e&#34;&gt;# XOR with current keystream byte&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        result[idx] &lt;span style=&#34;color:#f92672&#34;&gt;^=&lt;/span&gt; state &lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;0xFF&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#75715e&#34;&gt;# Update keystream state&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        rotated &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; ror32(state, idx &lt;span style=&#34;color:#f92672&#34;&gt;%&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;32&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        state &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; (idx &lt;span style=&#34;color:#f92672&#34;&gt;+&lt;/span&gt; rotated) &lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;0xFFFFFFFF&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; bytes(result)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The unobfuscated file should start with &lt;code&gt;;&lt;/code&gt; and a 3 letter extension such as &lt;code&gt;OEM&lt;/code&gt; or &lt;code&gt;DAT&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>NBN Location ID checksum/check digits</title>
      <link>http://www.oyashoku.com/posts/nbn-luhn/</link>
      <pubDate>Thu, 22 Oct 2020 00:00:00 +0000</pubDate>
      <guid>http://www.oyashoku.com/posts/nbn-luhn/</guid>
      <description>&lt;p&gt;&lt;em&gt;Edit 11/09/2020: It’s occurred to me that the AVC numbers may conform to this as well, and it appears they do. (Albeit to the sample size of 1 because I don’t have access to anyone else’s AVC except my own)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Just noting down that NBNCo Location ID’s use the &lt;a href=&#34;https://en.wikipedia.org/wiki/Verhoeff_algorithm&#34;&gt;Verhoeff algorithm&lt;/a&gt; to generate their check digit, since nobody appears to have mentioned it in a Google-indexed, website to my knowledge.&lt;/p&gt;
&lt;p&gt;Remember to strip out the LOC and leading zeroes of course.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Exploiting CVE-2020-8597 to get RCE on a locked down router</title>
      <link>http://www.oyashoku.com/posts/xiaomi-rm2100/</link>
      <pubDate>Sun, 07 Jun 2020 00:00:00 +0000</pubDate>
      <guid>http://www.oyashoku.com/posts/xiaomi-rm2100/</guid>
      <description>&lt;p&gt;So it’s late February 2020 and we’re all starting to realise that we’re going to be sitting at home for a while. Some are cleaning, some are baking, and some of us order cheap routers off of AliExpress to flash and replace their old hardware with.&lt;/p&gt;
&lt;p&gt;I picked one of &lt;a href=&#34;https://www.mi.com/rm2100&#34;&gt;these&lt;/a&gt;, as the specifications seemed quite decent in comparison to the price that was being asked. (There is an almost identical in specifications unit being sold by the same manufacturer here, which through some sort of horrible coincidence has the exact same memory layout and ROP gadget addresses)&lt;/p&gt;</description>
    </item>
    <item>
      <title>Nvidia’s CPUId Lockouts</title>
      <link>http://www.oyashoku.com/posts/nvidia/</link>
      <pubDate>Thu, 10 Sep 2015 00:00:00 +0000</pubDate>
      <guid>http://www.oyashoku.com/posts/nvidia/</guid>
      <description>&lt;p&gt;&lt;em&gt;Late 2021 edit: They finally removed this in their driver now, so now they can be used in passthrough setups with their binary drivers.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;It appears that the Nvidia GPU drivers (both the Windows and Linux ones, after a certain point) don’t particularly want to be run under a hypervisor&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Microsoft Hv (The Hyper-V vendor id)&lt;/li&gt;
&lt;li&gt;VMWare&lt;/li&gt;
&lt;li&gt;VMwareVMware&lt;/li&gt;
&lt;li&gt;XenVMMXenVMM&lt;/li&gt;
&lt;li&gt;KVMKVMKVM&lt;/li&gt;
&lt;li&gt;Parallels
In addition, some of these model specific registers from KVM (the KVM wallclock) arbitrarily anger their drivers.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-c&#34; data-lang=&#34;c&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;#define MSR_KVM_WALL_CLOCK_NEW      0x4b564d00
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;#define MSR_KVM_SYSTEM_TIME_NEW     0x4b564d01
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;#define MSR_KVM_ASYNC_PF_EN         0x4b564d02
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;#define MSR_KVM_STEAL_TIME          0x4b564d03
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;#define MSR_KVM_PV_EOI_EN           0x4b564d04
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Luckily, parameters exist on KVM to modify both the CPUID, Hyper-V vendor id, and disable the KVM model specific registers.
Xen on the other hand, has a somewhat &lt;a href=&#34;https://intrbiz.com/post/blog/linux/setting-the-cpuid-of-a-xen-guest&#34;&gt;obtuse looking option for modifying their CPUID&lt;/a&gt; (Sure, let me just type in the entire leaf in binary), and no current ability to modify the Hyper-V vendor id. I guess the quick and dirty way of working around that would be to either disable Hyper-V as one used to do on KVM, or modify these lines to change the ‘Microsoft Hv’ signature to something else.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Editing Device Checks for Fun and Profit</title>
      <link>http://www.oyashoku.com/posts/ingress/</link>
      <pubDate>Wed, 14 Aug 2013 00:00:00 +0000</pubDate>
      <guid>http://www.oyashoku.com/posts/ingress/</guid>
      <description>Short journey modifying an apk to fool a device model check</description>
    </item>
  </channel>
</rss>
