Hexer – A hex editor

Way back in July I was doing some simple binary data file reverse engineering, and got annoyed at the fact that I couldn’t find a free hex editor for Windows which offered all of the following:

  • Seeing all interpretations of data (e.g. various integer types, floats and text) while hovering over some binary data.
  • Searching data of a given type (e.g. uint32) quickly and conveniently in different numerical formats (e.g. decimal or hex).
  • Marking identified pieces of data with their type and some notes.

I thought “it can’t be that hard now, can it?” and set out to create my own. After some deliberation I choose C#/Winforms to implement it, simply because the tool support is second to none and I didn’t want to waste more time on UI stuff than strictly necessary.

After spending a few hours on it way back then, and finally a few more today, it has turned into quite a usable (but far from complete or user-friendly) program. I called it Hexer, which is both appropriate in English and also means “Warlock” (or even “Witcher”, literally) in German.

It has all the features which I was missing:

  • The pane on the left shows various interpretations of selected and hovered-over data.
  • You can easily enter different types of numerical addresses written in any C-style string format (e.g. “161″ searches for the decimal number 161, “0xFF” searches for decimal 255 and 010 searches for decimal 8).
  • As seen in the screenshot, you can mark ranges of data with some data type, and see the in-line interpretation of that data in the file. These markers can be stored and loaded independently of the files they apply to.

I put the source up on GitHub here, and here’s an executable if you want to give it a try. (You’ll need the right version of the .net Runtime of course)

Of the entire implementation I like this part best, which is a simple descriptive listing of all the data types, including their properties (such as name and size) as well as the ability to convert values of that type to and from raw binary and strings. It’s succinct, easy to extend (both with new data types and new meta-information about them), and many of the UI elements are generated directly from that list.

Hexer is far from fully-featured – I put up a short list of TODOs in the Github readme, but there’s a lot more which could (and should) be done.

FF Type-0 Article – Snatching Defeat from the Jaws of Victory

I wrote a pretty in-depth port analysis of FF Type-0, for PC Gamer as usual. The game is intriguing: it’s clearly a far more technically competent port (it even uses some compute shaders!), with none of the random performance drops, but held back by a baffling regression in output resolution choice.

It also got a very bad rep initially on Steam because the options perhaps aren’t labeled expressively enough – the “high” and “highest” AA options perform 2.25x and 4x downsampling, basically, so they have a very significant performance impact. Many expected to just “max everything” in this port, so that came as a surprise.

What I didn’t expect is that the game actually has some decent improvements over the console version beyond just rendering resolution, including a high-end shadow option, a very fully-featured screenshot mode, and a speedup toggle.

1.5 Weeks of Windows 10, and Photoviewer executable release

I’ve been using Windows 10 for about 1.5 Weeks now, and I thought it would be time to write about the experience, explain a few workarounds, and post one tiny tool I made to make it more palatable.

So, what has gone wrong in Windows 10?

Booting & drivers

First of all, initially it wouldn’t even boot on my X99 system. It got stuck in an infinite loop on the initial boot screen. By looking through the boot log from my old WIndows 7 installation, I eventually figured out that the fault lies with the “Intel Management Engine” driver – a component I don’t need at all. Disabling it fixed that issue.

However, I still got a black screen on boot. Turns out that Windows 10 thought it was a good idea to show the initial login screen on my projector (turned off projector, I might add) rather than theĀ  monitor.

Talking about boot issues, the idea of removing the option to get to the advanced boot loader with a key press is really fucking annoying. Being really annoying to power users for no good reason seems to be a theme in Windows 10, as I’ve found.

The new start menu

In short: it sucks. I tried living with it for a few hours, but its refusal to reliably index manually created desktop application shortcuts in its search makes it completely unusable to me. Good thing I bought two StartIsBack licenses back then, and great on the author for having a perfectly up-to-date and fully compatible version out with the Windows 10 release.

Look, it’s a beautiful start menu with actually working indexing for desktop applications and lots of neat functionality!

Program incompatibilities

Let’s start with an amusing one: Skype would crash every time I logged out of Windows 10. The amusing part here is that Skype is now owned by MS, so’ you’d assume that they’d get compatibility right. After a lot of googling, it’s apparently an issue where the sound driver gets unloaded before skype does, and it crashes when trying to play the logout sound. Go figure. The fix is to disable that sound.

There are also various incompatibilities with DirectX pre-9 games and fullscreen mode, resulting in flickering. In most cases I’ve encountered, forcing borderless windowed mode seems to work around those.

What’s nice is that it seems GeDoSaTo is compatible with Windows 10 out of the box, and so is PtBi.

Strange stuff happening to CPU usage

This has been a sporadic issue that seems to have stopped completely now, but for a while I was getting completely nonsensical CPU usage reports in task manager.

Apparently, my CPU was giving its all at 124%.

In complete idle state, my CPU was apparently running at ~30%. At least according to the new “Processes” view in task manager. “Details” was showing 97%-99% idle, and Process Explorer, which I trust more than both of them, agreed.

The “Appification” of general tools & Photoviewer

In the process of converting general windows default utilities to “apps”, it seems that almost invariably functionality is lost — often important functionality. The new “Photos” app apparently can’t even show images at 100% zoom with a simple click, and mouse wheel zoom is completely broken. I find that unacceptable.

Luckily, Windows 10 still ships with the old Photo Viewer. Because it’s MS though, that Photo Viewer is not an executable but rather a dll which needs to be hosted and invoked somewhere, so it’s hard to associate with images in Windows 10. To work around this I’ve created PhotoviewerWow.exe. It merely invokes the existing .dll, and should work on Windows 10 64 bit installations. Just put it somewhere permanent and you can easily associate it directly with image files. (The name is a homage to the insane hoops MS jumps through to run Windows32 on Windows64, since I also had to jump through hoops to run a standard Windows feature on the new Windows)

Another thing about appification that might be even more worrying is that apparently you aren’t even trusted – as an administrator no less – to look at your own apps’ files (hidden away in “Program Files/WindowsApps”). That’s just ridiculous. And worrying.


Well, I guess the new built-in virtual desktop support is neat, and they chose exactly the keyboard shortcuts for it that I would have chosen intuitively (Win+Ctrl+D, Win+Ctrl+Left/Right). So good job on that. And I also like the improvements to the “move window left and right” workflow, where it now shows you a selection of the remaining windows to move to the other half of the screen after you used Win+Left/Right to move one window. It’s also not quite as fugly as Windows 8, and it makes it rather easy to mostly ignore the entire app crap after installing StartIsBack.

DirectX 12 article on PC Gamer

I wrote an article about DX12 for PC Gamer. It discusses the differences between high-level and low-level graphics APIs and what that means for gaming. It also features some insight gained from talking to Dan Baker at Oxide games about a few related topics, which was a big help.

I went a bit wild in terms of technical detail in the middle section of it, but it could be up your alley if you read my blog (and hopefully also interest some PC Gamer visitors).

Some Audio updates for PtBi

Thanks to a comment on the last post, the audio crash which affected some should now be fixed in version 6.1901.

Also, I investigated the reports of trouble capturing PS3 output, and there was something strange going on. It seems like in some conditions the BMI Pro 4k driver can enter an error state, and nothing will work until the next reboot. Anway, after some debugging I got 1080p5994 capture with full ARGB quality working on PS3:

PtBi updated for RGB pixel formats and Intensity Pro 4k support

I recently got an Intensity Pro 4k to replace my Intensity Pro, which served me well for more than 6 years. It has mixed reviews on the internet, but mostly because of one of two reasons:

  • Noise, which was indeed terrible but is fixed completely by updating the firmware.
  • Software compatibility, which I can’t speak for. I only use one piece of software and I make that one compatible if it isn’t.

BMI Pro 4k to the left, BMI Pro to the right

I have to say that the device has worked pretty flawlessly for me. Nice to finally get full RGB input and 1080p60 capture.

Of course, to actually make use of those features I had to release a new version of PtBi. Since it’s a pretty major upgrade I decided to call it version 6 now. More specifically, the release is 6.1877. In addition to supporting the new pixel formats PtBi should now also produce somewhat more useful messages on errors.

It’s still not quite user-friendly though. You have to select the pixel format and video mode with command line parameters, e.g. PtBi.exe -disable-audio -pf=ARGB -mode=1080p5994. The supported modes are ARGB, BGRA and YUV (which is the default and only option in previous versions). I don’t support 10bit modes since I don’t need it — if anyone really does it shouldn’t be too hard to add.

I also pushed the current source to GitHub, what was there was completely outdated. It’s still terrible though, which is about what you’d expect from a project developed for a few days here and there over 6 years, and built on code even older than that. However, it does it’s job, and it’s the only thing which does that particular job, and I still use it all the time, so perhaps it’s useful to someone.

Dark Dreams Don’t Die (D4) Alternative Launcher

D4 PC released (on Steam and elsewhere) recently. The game uses UE3, so it works well on PC, and the mouse controls are also well done. The only problem is that the built-in launcher presents a fixed list of resolutions rather than all available ones, and also somehow messes up with DPI scaling.

I wrote a new Launcher in C# which doesn’t have this issue. It’s available here.

I also made the source code available on Github. Not because I’m very proud of it or because it’s particularly interesting (it’s just a simple Winforms C# app written in an hour or so), but because I hope if I put it in the public domain it could help improve this state of affairs in the future.

Well, that’s all.

The Witcher 3 Tech Analysis

witcher3_2015_05_19_19_52_05_657I wrote an article about The Witcher 3 for PC Gamer. I focused primarily on some tips for achieving the smoothest possible gameplay, but what I’m really surprised by is the CPU results I obtained.

I might have chosen a bad location for that benchmark, and perhaps I’ll repeat it somewhere else, but I really expected an open world DX11 RPG to be more CPU-heavy. Certainly not playable with two 2.2 GHz cores at 30 FPS and 4 at 60 FPS. Very well done, and another indicator to me that seems to hint towards the gains with future low-level graphics APIs being less pronounced than some expect, outside of very specific use cases.

Of course, that level of control will at the very least be a huge boon to VR rendering, which inherently requires a high framerate, low-latency and extremely consistent performance.

GeDoSaTo FPS capping, modding controversies

FPS Capping

I recently started implementing FPS capping in GeDoSaTo. For those not familiar with the term, basically you want to achieve a consistent framerate in a given game, and in order to do that you cap the framerate at a given maximum.

In practice, this is usually done by simply inserting waiting periods after you are done with a given frame. E.g. if you want to cap to 30 FPS, you would wait until you reach a frametime of 33.3 ms.

There are multiple external tools which already do this (e.g. NVidia drivers have an option, RTSS can do it, some games have a built-in cap, …) so up to now I wasn’t interested in doing the same in GeDoSaTo — though I was sometimes frustrated by the lack of fine-grained control in external tools. However, I recently had an idea on how to improve upon the commonly employed method for doing this, in order to perhaps slightly improve input lag in a capped scenario.

fps_cappingThe image above shows 3 use cases: uncapped framerate, a traditional 30 FPS limit implementation (“Capped”) and my new method (“Predictive”). As you can see, the traditional method simply inserts a waiting period after each frame. However, this means that you are potentially losing a few milliseconds of input latency for no good reason.

Instead, with predictive FPS capping, GeDoSaTo keeps track of the frame times for previous frames, and takes a set fraction (configurable) of that as a predictive waiting period before each frame. The result (for games which do synchronous input sampling on the rendering thread or at least on another thread synchronized with it) is that the input after waiting is used for the new frame, reducing input lag by some fraction of the frame time.

The only dangerous aspect of this method is if there is a sudden spike in frame rendering times. For example, in F2 in the picture you can see that the frame almost doesn’t get done in time. If it were to cross the threshold, predictive FPS capping would result in a framedrop which would not happen in a traditional FPS limiting scheme. For this reason, the ratio of how much waiting time should be moved to the start of the frame is configurable — you can use a low value like 0.25 for a game with very erratic frametimes and something like 0.9 for one with extremely consistent performance.

Here are the new configuration options (which can be configured as per-game user profiles, like always)

The busy waiting or sleeping option is there for completeness, but outside of running on a laptop battery I don’t really see why you would not use busy waiting. In my tests it’s a lot more exact.

Note that you can use floating point numbers as the frame limit, I find it often useful to go with e.g. 30.5 FPS if I want a solid 30 in order to overcome unmeasured overheads.

Modding Controversies

Since my last blog post there have been two pretty large controversies about modding. The first was regarding paid mods for Skyrim. I was asked to provide a comment for PCGamesN, which was used in this article. My full comment, which is provided on the second page of the article, sums up my feelings on the issue. I have to admit that I was most disappointed by the level of vitriol some (purported) members of the community stooped to.
The other issue was once again the old friction between modding and multiplayer. Both in DS2 and GTAV, people who claimed to be using only mods which do not affect gameplay in an unfair way were relegated to the cheater pool in online multiplayer. This is a very delicate issue. It is extremely hard or even impossible for a game to assess whether a in-memory modification is benevolent or not, so I can certainly understand “no online modding” policies in principle. in the end, that is just another instance which shows why developer-supported modding is the way to go: in such a setup, it’s easy to control which modding functionality is available in what game mode.

GeDoSaTo minor update, Pillars of Eternity, DX11

I just pushed a minor update to GeDoSaTo (which you can download here, as always), mostly to integrate the pull requests and new profiles people have contributed over the past 3 months or so.

With the release of Scholar of the First Sin, I also get a lot of renewed interest and questions about DX11 support in GeDoSaTo. The answer to that is still that I’d love to do it (and I also already laid some of the groundwork for it last year), but I simply don’t have the time right now between some increased load at my “real job” and still trying to get some gaming in. I do of course welcome any contributions, as always.

Speaking of gaming, Pillars of Eternity was released recently, and it’s really really good. You should play it.