Readit News logoReadit News
musjleman commented on Without the futex, it's futile   h4x0r.org/futex/... · Posted by u/eatonphil
garaetjjte · 12 days ago
Neither CRITICAL_SECTION nor SRWLock enters the kernel when uncontended. (SRWLock is based on keyed events, CRITICAL_SECTION nowadays creates kernel object on-demand but falls back to keyed event on failure)
musjleman · 12 days ago
SRW lock uses the WaitOnAddress primitives nowadays, not keyed events.
musjleman commented on Denuvo Analysis   connorjaydunn.github.io/b... · Posted by u/StefanBatory
degosuke · 3 months ago
Wasn't there a story on HN about a GTA San Andreas bug that was caused by this? (or something very similar)
musjleman · 3 months ago
Yes and no.

The GTA SA bug was reading of an uninitialized variable. The value it contained was correct simply by chance as it was placed there by the previous invocation of the function and never overwritten by something else intermittently. Any changes to functions that happened to be called in between these 2 could have changed the value of the stack memory.

The aforementioned check on the other hand is placing random value below the stack pointer. This means that by design it cannot call any external/os/game functions and is basically isolated/"pure" from any interactions with third party code.

musjleman commented on Denuvo Analysis   connorjaydunn.github.io/b... · Posted by u/StefanBatory
farmdve · 3 months ago
The anti-tamper codes, if any tampering is detected will crash on undefined/unallocated regions. Meaning that if Windows ever were to overwrite that region for whatever reason, will trigger the crash.

Such was the case for SecuROM in early days. It featured the CRC checks mentioned, if any single byte was changed, including an INT (breakpoint) instruction, it would crash. Here it's unlikely that it wont crash. Rendering the game inoperable.

musjleman · 3 months ago
> The anti-tamper codes, if any tampering is detected will crash on undefined/unallocated regions.

That's basically the whole point of any anti-tamper product. I just think you picked a terrible example of a feature that could break due to OS changes specifically.

> Meaning that if Windows ever were to overwrite that region for whatever reason, will trigger the crash.

We're talking about random stack memory inside of a virtual machine that likely doesn't call any external code whatsoever. There should be no real way for Microsoft to accidentally corrupt this memory.

musjleman commented on Denuvo Analysis   connorjaydunn.github.io/b... · Posted by u/StefanBatory
farmdve · 3 months ago
What isn't mentioned in the article is why UD2 is chosen. It is a relic from the SecuROM days, in fact, one of the developers on SecuROM is the one who also works or worked at Denuvo.

I would imagine many things from the SecuROM era live on in Denuvo.

But if you read the article you will realize that certain games will not work in the future due to Denuvo.

"This destroyed any exception-based hooking since majority of the time an exception is triggered, Windows will write an EXCEPTION_RECORD high up in unused stack space. You can probably see where this is going. Now, whenever the CPUID is hooked via an exception, that important value will become overwritten with an EXCEPTION_RECORD, causing undefined behaviour later on. I believe this can be bypassed if you attach a debugger to the process and set certain flags when it comes to exception handling, but the method of patching every hardware check is still cumbersome due to randomness anyway."

As Windows matures, behaviour can change, breaking certain stuff.

musjleman · 3 months ago
> As Windows matures, behaviour can change, breaking certain stuff.

How do you expect the aforementioned tech to break the games it's on? If anything it "breaking" will just make the anti-tamper feature ineffective.

musjleman commented on I ruined my vacation by reverse engineering WSC   blog.es3n1n.eu/posts/how-... · Posted by u/todsacerdoti
AStonesThrow · 4 months ago
Yeah so like, every time I ran AV software it was quite obvious where the paranoia settings were, and how to tone down the aggressive "scan everything everywhere every time" settings.

For 98% of systems, there is probably no reason to scan every file on opening it. If people have enabled that setting, or left that default on, then that's their problem; it's not Windows Defender's fault.

My current AV dashboards are screaming at me that I'm only 35% protected. That's because I've exercised a lot of prudence in enabling paranoid settings, based on my rather limited and simplistic threat modeling. Installing AV software comes with the understanding that it can steal resources, but they nearly always have plenty of settings that can be disabled and win back your system responsiveness.

I am beginning to believe that commenters giving bingo-card winnings are not the brightest bulbs in the Windows MCSE pool, honestly. I can relate: Linux and Unix admin in general is far more intuitive and comfortable for me, so I have generally stayed on that side of things, but knowing how to properly set up Windows is an indispensable life skill for anyone.

musjleman · 4 months ago
> If people have enabled that setting, or left that default on, then that's their problem; it's not Windows Defender's fault.

There is no such setting for Defender. The file scanning is either on or defender is completely off. To even access some of the better stuff like ASR rules (that are disabled by default) you need third-party software or pay for their enterprise offering.

Consumer Defender literally has like 4 toggles in total. It's a dumbed down and extremely permissive AV because it runs on every Windows machine.

musjleman commented on I ruined my vacation by reverse engineering WSC   blog.es3n1n.eu/posts/how-... · Posted by u/todsacerdoti
dangus · 4 months ago
Let’s cut the bullshit, Defender is basically unchanged as a concept since Windows Vista or maybe even Windows XP. It runs completely fine on 15 year old hardware.

We are in the “Windows users complain endlessly and refuse to switch to Linux” bingo card right now. Windows has been this way since before you bought that mini PC.

musjleman · 4 months ago
> Let’s cut the bullshit, Defender is basically unchanged as a concept since Windows Vista or maybe even Windows XP. It runs completely fine on 15 year old hardware.

Exactly. It's the same legacy scan every fucking thing you open AV architecture.

Back in the day of spinning disks it probably wouldn't have been too noticeable for the AV to marshal scanning to its usermode service and the filesystem to pull the data from cache for the original request afterwards. However now that we have 10GB/s+ capable SSDs the factor of slowdown is exponentially larger.

I can run ripgrep on a massive directory, make myself a cup of tea and return to it still searching for matches versus being done in < 10 seconds with defender disabled.

musjleman commented on I built a native Windows Todo app in pure C (278 KB, no frameworks)   github.com/Efeckc17/simpl... · Posted by u/toxi360
throwaway2037 · 4 months ago
Above, someone shared this tip to compile down to 23,552 bytes. Ref: https://news.ycombinator.com/item?id=43957984

Can you share how you can compile to only 10kb?

musjleman · 4 months ago
By "actual code" I meant the assembly that the application logic compiles down to, not the entire executable. But as far as the entire package goes, compiling it using clang with some flags I can get down to 19.5k without any effort. If I wanted to waste time on this, ripping out the CRT entirely and getting it to 16k would probably take less than an hour.
musjleman commented on I built a native Windows Todo app in pure C (278 KB, no frameworks)   github.com/Efeckc17/simpl... · Posted by u/toxi360
Disposal8433 · 4 months ago
> A modern, native Windows Todo application

What's modern about it? Also you could have used C++ instead to remove some potential issues, and those global variables...

Use std::string and std::array or std::list, some anonymous namespaces, remove all the malloc, etc. Your code would be half the size and still compile to the same assembly language without the bugs.

musjleman · 4 months ago
> those global variables...

What about them? In a 500 loc app there is no practical difference and there's only ~20 of them with clear purpose.

> Use std::string <...> or std::list <...> remove all the malloc, etc

> still compile to the same assembly language without the bugs.

I see you have no clue what those things actually compile down to.

musjleman commented on I built a native Windows Todo app in pure C (278 KB, no frameworks)   github.com/Efeckc17/simpl... · Posted by u/toxi360
thehias · 4 months ago
278kb? you are doing something very wrong, this should be possible in 10kb!
musjleman · 4 months ago
The actual code in the repo definitely compiles to less than 10k. The rest is bloat from linking CRT statically.
musjleman commented on Technical Analysis – Improper Use of Private iOS APIs in Vietnamese Banking Apps   blog.verichains.io/p/tech... · Posted by u/quyleanh
bradyriddle · 5 months ago
I'm curious about this. I'm familiar with reversing http api calls using a mitm proxy. But this ain't that.

Are they able to load a .so/dylib file during runtime and just call a method on it as long as they know the name of the method? How does iOS even allow that? How does an iOS even get to load those files? Seems like that would be locked down.

musjleman · 5 months ago
> Are they able to load a .so/dylib file during runtime and just call a method on it as long as they know the name of the method?

Yes, usually that's the entire point of an .so/.dylib/.dll - to load it and call it's functions by name?

> How does iOS even allow that? How does an iOS even get to load those files? Seems like that would be locked down.

Because it's something that higher level apple interfaces might rely on. It's not a security issue in the first place - if you submit an app obviously using them the message you get is:

> The use of non-public APIs is not permitted on the App Store because it can lead to a poor user experience should these APIs change.

u/musjleman

KarmaCake day79June 28, 2021
About
https://twitter.com/JustasMasiulis | https://github.com/JustasMasiulis | https://secret.club/author/jm
View Original