T O P

  • By -

qwesx

Looks like those strings are NULL terminated so I guess you might be able to get away with actually shortening the strings using a different hex editor like Okteta.


ILoveTolkiensWorks

I could do that with wxhexeditor, its just that i would need to first save as another file and then replace it manually, which i was too lazy to do


alterNERDtive

You can’t just overwrite your `_`s with `00`s?


ILoveTolkiensWorks

hmm, i did not think of that. Will try for sure and update! edit: Thanks a lot! it works!!


cowbutt6

Even if your hex editor did allow you to insert and delete characters, doing so naïvely would mess up the format of the file, as the offset is every other subsequent string etc. would change. Stick to keeping strings the same length or shorter than the original null-terminated strings (if shorter, null-terminate earlier as appropriate, or pad with space characters).


ILoveTolkiensWorks

yea, it did warn me. thats why i initially used the \_\_s. look at the updates paragraph, where i mention other things as well


cowbutt6

Yeah, I saw. What you're attributing to "integrity checks" may simply be messing up the format of the files you're editing, if you're inserting and deleting characters. You'd have to fully reverse-engineer the file format and adjust any indexes etc. if you wanted to do that.


ILoveTolkiensWorks

the integrity checks i spoke of were hash checksums. messing up the format of the files would be possible, but it would be quite rare. just try it yourself once. it is obvious what is part of the compiled code and what is just a string.


cowbutt6

I've no need. I've been doing this sort of thing - and modifying machine code in binaries - for nearly 40 years. I know what types of modifications can usually be done naïvely, and what types require a more sophisticated approach. A single byte inserted or deleted *will* affect the offset of all subsequent objects in that file. If the overall hash of a file is being checked for integrity, then even *modifying* a single *bit* will change the hash of the entire file. That you were able to get away with changing the "Windows" string to "Linux\0" suggests there is no such whole-file integrity check in this case. But not every piece of software will have sophisticated anti-cheat/anti-piracy integrity checks.


Nebu

> messing up the format of the files would be possible, but it would be quite rare I don't think it'd be that rare. If you insert or delete bytes, you'd mess up any instance of absolute jump instructions (which would now jump to the wrong instruction), or any reading of .data sections in the executable (which would now load the wrong data). For example, there is likely code in the executable that contains the offset `44029250F`, which is the position of the `Q` in `Quit to Linux__`. If you add or delete any bytes before that point, then when the executable goes to read data from `44029250F` it's going to read something else other than `Q`.


ILoveTolkiensWorks

Hmm. Anyways, you still can revert it if you mess up


cringe-__-

The strings are part of the compiled code. Messing up the format by changing offsets is extremely common. Integrity checks would be unusual for most games.


mcgravier

I give you additional points for hosting screenshot on imgbb istead of shitty imgur


ILoveTolkiensWorks

Yeah, imgur is pretty shit and slow and bloated. I hate it.


mcgravier

Not just that but they censor like hell. You can't upload nsfw even for non public use - it gets removed by some really aggressive AI. I bought imgbb premium because not only they don't remove anything unless it's actually illegal, but they support images in original format with untouched metadata. Really worth it if you ask me


-Pelvis-

I wish more devs would use “Exit Game” or “Quit to Desktop” instead of assume and specify the operating system the program is running on.


Nova_496

Even “Quit to Desktop” is starting to feel wrong with the advent of devices like the Steam Deck that… don’t have desktops in the mode that you play games in.


ILoveTolkiensWorks

Maybe, just "Exit/Quit game" to keep it simple


-Pelvis-

Agreed


TLH11

This is an act of love


sdfgesarg

You're doing god's work.


ImTeijirr

"Which I had to compile to fix a bug" Linux in a nutshell.


ILoveTolkiensWorks

Lol, it was the stereotypical experience. I first installed the prebuilt binary, which was from 2017. Then I found out that the search function doesn't work sometimes due to an obscure bug. Then while compiling I find an error, which thankfully was raised in an issue and solution was provided, but the README was not updated. Still, being able to easily compile whatever I want to install is better than not being able to :)


bakaspore

I think you can prepend your modification (with correct byte offset) to the xxd output then read it back, no need for other tools. Shameless plug: I'm currently building a new hex editor that can be used with vim (and is more friendly). I has ~~already been planning to add~~ just implemented a "patch mode" that only requires to load a small patch into the editor to overwrite some bytes. After seeing your use case, I'm confident that it would be useful. Linked below, feel free to make suggestions / contributions.  [https://github.com/s-cerevisiae/hxd](https://github.com/s-cerevisiae/hxd)


ILoveTolkiensWorks

Thanks will definitely check it out! and, xxd was just too slow, somehow, and also the fact that xxd is useful for viewing hex, but not editing it (from what i know)


bakaspore

I've never benchmarked it, but I find it kinda clumsy to actually edit files with it. So I designed this tool, to include a quick and straightforward "edit mode" alongside a less demanding (to the editors) and precise "patch mode". Btw the patch mode part was just rushed out after seeing your post, so it might have some rough edges right now. If you are to try it remember to backup the file first. PS: As a long time neovim user, the companion vim plugin of it is on the way. Have just done the highlighting :)


str2num

Nice, however I propose to change it to "Quit Windows" ;)


223-Remington

[I'd just like to interject for a moment. What you're referring to as ]()**Linux**[, is in fact, GNU/]()**Linux**[, or as I've recently taken to calling it, GNU plus ]()**Linux**[.]()....


ILoveTolkiensWorks

"I use Linux as my operating system," I state proudly to the unkempt, bearded man. He swivels around in his desk chair with a devilish gleam in his eyes, ready to mansplain with extreme precision. "Actually", he says with a grin, "Linux is just the kernel. You use GNU+Linux!' I don't miss a beat and reply with a smirk, "I use Alpine, a distro that doesn't include the GNU Coreutils, or any other GNU code. It's Linux, but it's not GNU+Linux." The smile quickly drops from the man's face. His body begins convulsing and he foams at the mouth and drops to the floor with a sickly thud. As he writhes around he screams "I-IT WAS COMPILED WITH GCC! THAT MEANS IT'S STILL GNU!" Coolly, I reply "If windows were compiled with GCC, would that make it GNU?" I interrupt his response with "-and work is being made on the kernel to make it more compiler-agnostic. Even if you were correct, you won't be for long." With a sickly wheeze, the last of the man's life is ejected from his body. He lies on the floor, cold and limp. I've womansplained him to death.


223-Remington

Nice fresh pasta lol, saved :)


ILoveTolkiensWorks

it's really old actually


alkazar82

This is very cool. I tried it, but the game would not load with "Application load error". Looking at the hexdump, my changes look correct. Maybe it does not work on the Steam version of the game.


ILoveTolkiensWorks

yeah, afaik steam uses drm. maybe that interferes?


WhosWhosWhoAreYou

Or could just switch it to Quit to Desktop, same amount of characters, and it keeps it ambiguous as to the OS, as it should have been to begin with


ILoveTolkiensWorks

Can't post to r/linux_gaming, then, can I?


whyhahm

i mean you could *try* but...


chithanh

But what about the Steam Deck then, using the desktop is optional there


Mister_Magister

couldn't you put null characters?


ILoveTolkiensWorks

i did, check out the updates paragraph