TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

A jump into the middle of an instruction from nowhere (2023)

131 pointsby smitopover 1 year ago

10 comments

adrian_bover 1 year ago
While in this case the jump into the middle of an instruction was not intentional, several decades ago many Microsoft programs for MS-DOS, like their BASIC interpreter, contained frequent intentional jumps into the middle of instructions.<p>This technique had already been used in many Microsoft programs for CP&#x2F;M, i.e. for Intel 8080 or Zilog Z80 CPUs.<p>There were two reasons for the use of such jumps in the middle of instructions. One was to obfuscate the program for disassemblers, which were desynchronized with the instruction stream by such jumps. The other reason is that each such jump usually saved one byte of instruction code in comparison with conventional conditional program structures.<p>When the program size was still measured in kilobytes, saving even only one hundred bytes by this method was important.<p>The instruction into the middle of which a jump was performed was usually an instruction that loaded a 16-bit register with an immediate value that happened to be the encoding for some other instruction.<p>The value loaded into the register was not used. Therefore, when the instruction was entered through its start address, no operation was done, but when it was entered through a jump, some extra instruction was executed.<p>A typical use case would be at the beginning of a loop, which was entered after initializing a control variable, while whenever the loop was repeated later an extra instruction was executed (corresponding to the immediate value of the register load), to update the control variable. This saved one byte upon the standard loop implementation that uses an unconditional jump for entering the body of the loop in its middle, after the loop initialization.
评论 #39118249 未加载
评论 #39120114 未加载
mstover 1 year ago
One of the comments says:<p>&gt; There’s at least one such utility out there that properly enough validates if their patches would work, or blocklist specific Windows builds known to break from it completely. I wish the other very-obvious-from-your-article software would do so too.<p>and I can&#x27;t help but agree.<p>If you&#x27;re going to reach into the guts of another process and start flipping bits, it&#x27;s only Correct to take responsibility for doing so carefully enough you don&#x27;t blow the entire thing up.<p>(I have written code that replaced&#x2F;wrapped other people&#x27;s function pointers for various reasons (occasionally even -good- ones) and considered any problem caused by an upgrade of the code hosting my cuckoo chick to be my bug - and while it was occasionally bloody annoying, I did this to myself ;)
bombcarover 1 year ago
Kind of sad. Even from this blog, he admits that the Microsoft of old would test software and see if it worked; the Microsoft of now obviously knows of the existence of these shell enhancements, but clearly doesn’t test patches against them at all.
评论 #39118299 未加载
评论 #39117654 未加载
评论 #39120056 未加载
Cianticover 1 year ago
I know it must be frustrating from Microsoft&#x27;s standpoint, but those are needed because they keep changing things. Start All Back is one very popular explorer.exe patch that makes the Windows 11 taskbar function a lot like Windows 10. For one thing, it allows you to move the taskbar again.<p>I&#x27;ve also made an explorer.exe in-memory patch to disable flashing taskbar buttons in Windows 10, it injected itself to WndProc and set the specific message to zero. In Windows 11 it&#x27;s now a setting, so I don&#x27;t need that anymore.<p>Now I&#x27;m investigating an explorer.exe patch for Windows 11 to speed up wallpaper animations. Which cannot be configured at the moment, there is only one setting to turn off all animations but no setting to speed up the wallpaper fade in animation.
评论 #39116155 未加载
评论 #39116443 未加载
评论 #39119783 未加载
评论 #39157326 未加载
评论 #39119730 未加载
评论 #39116217 未加载
EdSharkeyover 1 year ago
So these patchers are monkey patching a system executable needed to have a bootable&#x2F;usable system?<p>Why is this allowed? This sounds like a small hell.<p>I left Windows the moment we shifted from &quot;developers, developers, developers, developers&quot; to &quot;advertisers, advertisers, advertisers, advertisers&quot; and never looked back.<p>Ubuntu is very pleasant to work with, nowadays.
评论 #39122981 未加载
omoikaneover 1 year ago
I wonder if there is a special name for this patching pattern, where not only does a piece of code depend on undocumented behavior, it&#x27;s depending on the exact binary bytes.<p>See also: <a href="https:&#x2F;&#x2F;www.hyrumslaw.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.hyrumslaw.com&#x2F;</a>
mbork_plover 1 year ago
Seeing the title and the domain I instantly knew whose blog post this is...
评论 #39119747 未加载
评论 #39118476 未加载
saurikover 1 year ago
Frankly, it is really annoying when developers working at one of the large closed-source platform oligopolists blame their users for trying to work around the deficiencies (or even outright hostile &quot;business model&quot; optimizations) in their software by whatever scant means are left to them: maybe if Microsoft didn&#x27;t keep removing good functionality and stopped forcing bad &quot;features&quot; on everyone, fewer people would see a need to install and use these extensions that are being scapegoated here for the lack of satisfaction in Windows updates.<p>Just look through the comments on this article to see people pointing out how Microsoft keeps removing options for how people can do this in less risky ways, or even ideas for how Microsoft can improve the safety of these extensions (which aren&#x27;t all exactly right but I will note that if Microsoft embraced these more and provided an official loader--not one that limited the access but merely coordinated the installation--this is easily solved with the same kind of &quot;safe mode&quot; I designed for shell extensions on jailbroken iOS devices).<p>To quote one of the comments:<p>&gt; Not just this article, but far too often when articles such as this are written, about widely used 3rd party tweaks, and the commenting strongly supports the tweak in question, but MS charges forward that “all these enthusiasts are wrong, we will continue our way” is telling of how far out of touch the Win dev team is away from its user base.
评论 #39117271 未加载
评论 #39118034 未加载
评论 #39119814 未加载
评论 #39116960 未加载
评论 #39119702 未加载
评论 #39119092 未加载
评论 #39119636 未加载
评论 #39117528 未加载
jackewiehoseover 1 year ago
There is an interview with Raymond Chen where he is trying to defend the reason why they crippled the taskbar with Windows 11 [1].<p>Watching that I was just thinking NO NO NO - it worked fine for the last 25 years and there can be absolutely no reason why they had to destroy the taskbar now.<p>He deserves every headache he gets with these support requests.<p>Or to quote this comment of the linked article:<p>&gt; There wouldn’t be as much of a need if the windows shell team was smarter [...] In fact I actively encourage, support, and celebrate efforts like this. Make their life hell and delay them. If they spend more time on investigating issues like this, they’ll have less time to f*k something else up.<p>[1]: <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=HDicLHBvQQM" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=HDicLHBvQQM</a>
评论 #39117410 未加载
评论 #39118508 未加载
评论 #39118721 未加载
评论 #39117698 未加载
评论 #39117994 未加载
评论 #39118057 未加载
评论 #39117726 未加载
评论 #39119598 未加载
TravHatesMeover 1 year ago
Maybe large swaths of users wouldn&#x27;t download enhancement suites if you actually listened to them? It took like 3 years to support the basic feature to &quot;never group tabs&quot; in the Taskbar -- that&#x27;s been supported by previous versions of windows for decades. That&#x27;s why I downloaded patches.
评论 #39121295 未加载
评论 #39119639 未加载