HNHacker News
TopNewBestAskShowJobs

hmfrh

235 karma · joined February 4, 2021

submissionscomments
hmfrh··on Show HN: A Ghidra extension for exporting parts of a program as object files
> Yes. The exporters can handle whatever meaningful address selection you can throw at them, including multiple disjoint ranges within the same section. So you can keep carving holes inside your selection until nothing remains of the original program.

Will this also work without painstakingly reversing things in the binary, say in the case of a giant game executable?

If possible, I would be very interested in a simple tutorial that takes an arbitrary Windows executable, delinks it and replaces a single function, without all the extra steps necessary to run it on the PS1.

It might even be preferable if it worked with MingW, since I'm on Linux as well.

hmfrh··on Show HN: A Ghidra extension for exporting parts of a program as object files
> As long as you do not cut across a variable or a function, you can export pretty much however you want, you don't have to follow the original object file boundaries.

Would it be possible to export basically the entire program at once and then slice off individual functions one by one?

Do you have any guides/examples of the

> Decompilation projects, by splitting a program into multiple object files and reimplementing these Ship of Theseus-style

style project?

hmfrh··on Show HN: A Ghidra extension for exporting parts of a program as object files
How much work is it to figure out which sections of the executable to export?

Would it be realistic to be able to export a modern-ish (2008-2015) Win32 game into objects and then compile/link it into a full executable again with less than a few hours work?

hmfrh··on How Rust can facilitate new contributors while decreasing vulnerabilities [pdf]
> So ultimately, the borrow checker doesn’t seem worth it if you actually think about the cognitive overhead and headaches it brings.

You quite literally also have to "borrow check" C/C++ in order to have a well formed program, just without any compiler assistance.

hmfrh··on C++23: Removing garbage collection support
Surely the C++ surface area will also have increased significantly in the same span of time which means that Rust will still be ahead?
hmfrh··on Is Rust stack-efficient yet?
Other than Godbolt Rust also has cargo-show-asm[1] that directly shows the actual assembly.

[1]: https://crates.io/crates/cargo-show-asm

hmfrh··on Trying new programming languages helped me grow as a software engineer
It appears to also be called the "abstract machine"[1].

C semantics do not work "directly on the hardware" but instead on an abstract machine that is then converted to the actual hardware.

It most often comes up when talking about undefined behavior and pointer behavior.

Some assorted reading, mostly in the context of Rust and C:

https://blog.regehr.org/archives/213

https://raphlinus.github.io/programming/rust/2018/08/17/unde...

https://www.ralfj.de/blog/2018/07/24/pointers-and-bytes.html

https://www.ralfj.de/blog/2017/06/06/MIR-semantics.html

[1]: https://stackoverflow.com/questions/53100198/what-is-the-pre...

hmfrh··on Trying new programming languages helped me grow as a software engineer
> C having better support for pointers make it near to how the processor works, compared to other languages.

Java is almost entirely pointers to heap allocations, yet I don't think anyone would argue that Java is close to how the processor works.

I also don't think that the C virtual machine is all that close to how machines actually work any more.

hmfrh··on Google Pixel 6 still freezes when calling Emergency Services
> Do you want criminal prosecution for actual harm, or for potential harm?

Do you only want DUI to be illegal if it results in an accident?

hmfrh··on Finland and Sweden set to join NATO as soon as summer
> And how is these countries joining NATO benefiting the existing NATO members?

Stability in Europe. The west doesn't want refugees from whatever country Russia decided to invade this week to show up on their doorstep all the time, or the supply chain interruptions that happen when war constantly breaks out. You might remember that NATO arose almost immediately after World War 2 which had a rather negative effect on Europe and European influence in the world.

> Obviously, Russia has nothing more to lose given the sanctions, so, the only thing left is a direct NATO conforntation,

Russia has plenty more to lose. Namely every major European power and the US unloading all their armaments on Russian cities that are very close to the border.

> but it seems that the West is more afraid of such conflict than Putin, who believes that this is inevitable and that if you're faced with an inevitable flight, it's better to strike first.

This is an absolutely unrealistic take. Russia _can not_ win major combat against NATO in any shape or form. They couldn't do it with their made up propaganda army and they certainly can't do it with their actual army.

hmfrh··on Finland and Sweden set to join NATO as soon as summer
> It all looks rosy now, but remember just a few years ago when Turkey shot down a Russian jet on the Syrian border and almost led to NATO involvement?

Remember when Russia invaded Ukraine and it didn't lead to NATO involvement? We have direct evidence that a European country can be attacked without NATO immediately jumping in to help. If Russia "only" wanted the Eastern "wilderness" of Finland, do you think the other European powers would immediately send in their own troops?

There's a reason that the smaller European countries that border Russia haven't been attacked and absorbed yet, and that's because they're NATO members.

Being a NATO member clearly has more upsides than downsides.

hmfrh··on Amazon workers on Staten Island vote to unionize
You probably think that you do, but in reality you don't.

Large corporations have been proven to fix wages for tech workers[1]. There's literally no way that you could have any possible way of bargaining your way around that as a single person.

[1]: https://www.npr.org/sections/thetwo-way/2014/04/24/306592297...

hmfrh··on Can we trust Microsoft with open source?
> where is the bad news?

The bad news come when you reach the "Extinguish" phase. [1]

[1]: https://en.wikipedia.org/wiki/Embrace,_extend,_and_extinguis...

hmfrh··on Proposal to add constexpr to C [pdf]
Introducing a new keyword means that all existing code that uses the new keyword as an identifier will break. That's why the `constexpr` keyword is deliberately weird.

It's also why they reuse keywords like `using`.

hmfrh··on Whistleblower to Congress: Facebook products harm kids and democracy
> She leaked a trove of internal research and communications showing the company was aware of the ills of its platforms, including the toxic risks of Instagram to some teenage girls' mental health and the prevalence of drug cartels and human traffickers on its apps.

Please read the article next time.

hmfrh··on The case against crisis-mongering
> What fascism used to be was ultra nationalistic, non democratic, centralised control of people's lives and the economy for the greater good of the state. And I means these to the most extreme you can possibly take these ideas, that's fascism.

That's not entirely true.

As Umberto Eco says[1]:

> Eco grew up under Mussolini’s fascist regime, which “was certainly a dictatorship, but it was not totally totalitarian, not because of its mildness but rather because of the philosophical weakness of its ideology. Contrary to common opinion, fascism in Italy had no special philosophy.” It did, however, have style, “a way of dressing—far more influential, with its black shirts, than Armani, Benetton, or Versace would ever be.”

And he identifies 14 typical features of fascism:

> 1. The cult of tradition. “One has only to look at the syllabus of every fascist movement to find the major traditionalist thinkers. The Nazi gnosis was nourished by traditionalist, syncretistic, occult elements.”

> 2. The rejection of modernism. “The Enlightenment, the Age of Reason, is seen as the beginning of modern depravity. In this sense Ur-Fascism can be defined as irrationalism.”

> 3. The cult of action for action’s sake. “Action being beautiful in itself, it must be taken before, or without, any previous reflection. Thinking is a form of emasculation.”

> 4. Disagreement is treason. “The critical spirit makes distinctions, and to distinguish is a sign of modernism. In modern culture the scientific community praises disagreement as a way to improve knowledge.”

> 5. Fear of difference. “The first appeal of a fascist or prematurely fascist movement is an appeal against the intruders. Thus Ur-Fascism is racist by definition.”

> 6. Appeal to social frustration. “One of the most typical features of the historical fascism was the appeal to a frustrated middle class, a class suffering from an economic crisis or feelings of political humiliation, and frightened by the pressure of lower social groups.”

> 7. The obsession with a plot. “Thus at the root of the Ur-Fascist psychology there is the obsession with a plot, possibly an international one. The followers must feel besieged.”

> 8. The enemy is both strong and weak. “By a continuous shifting of rhetorical focus, the enemies are at the same time too strong and too weak.”

> 9. Pacifism is trafficking with the enemy. “For Ur-Fascism there is no struggle for life but, rather, life is lived for struggle.”

> 10. Contempt for the weak. “Elitism is a typical aspect of any reactionary ideology.”

> 11. Everybody is educated to become a hero. “In Ur-Fascist ideology, heroism is the norm. This cult of heroism is strictly linked with the cult of death.”

> 12. Machismo and weaponry. “Machismo implies both disdain for women and intolerance and condemnation of nonstandard sexual habits, from chastity to homosexuality.”

> 13. Selective populism. “There is in our future a TV or Internet populism, in which the emotional response of a selected group of citizens can be presented and accepted as the Voice of the People.”

> 14. Ur-Fascism speaks Newspeak. “All the Nazi or Fascist schoolbooks made use of an impoverished vocabulary, and an elementary syntax, in order to limit the instruments for complex and critical reasoning.”

Many of which absolutely apply to the previous US presidency.

[1]: https://www.openculture.com/2016/11/umberto-eco-makes-a-list...

hmfrh··on Why I Wrote PGP (1999)
> Some days I can get a dozen robo calls, each with a different spoofed number.

I live in the EU and have literally never gotten a robo call in my life. It's a political problem, not a technical one.

hmfrh··on Understanding Rust futures by going way too deep
> this is something that can change from person to person yes, but is it like that for you?

In my opinion it really depends on your background.

For example, Rust uses the `i32` type as the standard integer. If you come from a C/C++ background this is probably not that weird, you probably know how many bits there are in 4 bytes off hand, there's `int32_t` standard types and you probably have experienced not wanting an integer with a variable size that depends on the platform.

If however you come from Python, Javascript, or maybe even Java, this might range from a little weird to very weird. Python only has the `int` type, no unsigned types and you might not know how many bits make up a "standard" integer, or even exactly how bits, signedness and integer sizes fit together. Java doesn't have unsigned types and doesn't have issues with sizes depending on the exact platform, so they might not understand why you would want the amount of bits right there in the type name.

This is just for the standard integer type. If you consider how many design decisions are a direct result of working on low level, high correctness required C++ code, the "simplicity" could range from completely simple to very much not simple.

hmfrh··on Understanding Rust futures by going way too deep
The Zero to Rust[1] series also has a fairly comprehensive look into these.

[1]: https://www.lpalmieri.com/posts/2020-09-27-zero-to-productio...

hmfrh··on GitHub Copilot is not infringing copyright
> I’m not sure that that is a reasonable test of how the program typically behaves.

That's not what people care about, people care about their copyright being blatantly violated by a massive corporation _without any consequences_.

hmfrh··on GitHub Copilot is not infringing copyright
> You do understand that's not how laws work in general, right?

The only reason the law doesn't work this way for Microsoft Copilot is because the copyright holders are individuals who do not have the capital or expertise to file suit.

If Microsoft instead released a video editor addon that was trained on Disney movies and which would sometimes insert scenes of _any_ Disney movie you can bet your ass we wouldn't be having the same discussion.

hmfrh··on GitHub scraped your code. And they plan to charge you
> If you open-sourced code and allowed it to be used for commercial purposes

Uploading it to Github does not transfer ownership or imply allowances for any use. If you upload it without a license it is a copyright violation to copy the code. Even with an MIT license it is a copyright violation to copy the code without attribution.

> I don't see the point of being pissy about Github using it, I'm saying this as someone who's written quite a lot of MIT code.

People are probably angry because this is yet another case of a big multinational corporation abusing unclear or difficult to enforce legislation for profit.

hmfrh··on An Update on the UMN Affair
The second option also doesn't result in any big negatives for UMN associated personnel because the kernel devs take on all the work of enforcing stricter scrutiny.
hmfrh··on “They introduce kernel bugs on purpose”
Nobody is an expert on every subject. You could have PhD level knowledge of the theory behind a specific filesystem or allocator but know next to nothing about the underlying hardware.
hmfrh··on Higher quality audio makes people sound smarter
I've had issues on PopOs 20.04 and 20.10 with microphones connected through the audio jack. Connecting through a cheap jack-to-USB converter eliminated the background noise. There were proposed fixes although none of them worked. Jack-to-USB converters are apparently not recommended[1] due to wildly varying quality though.

On PopOs 20.10 I'm currently getting good audio from a ModMic USB. This[2] review is what made me buy the ModMic USB, although I know next to nothing about audio and audio quality.

The Audio Technica ATGM2[3] was also considered, but the mounting options for the ModMic USB as well as lower cost in my area won me over.

For me a headset mounted mic was a requirement due to space considerations and slightly lower cost, although next time I'm probably buying a very high quality free standing microphone.

[1]: https://www.youtube.com/watch?v=J1v1jtHz4C0 [2]: https://www.youtube.com/watch?v=Qquo2GpSQo4 [3]: https://www.youtube.com/watch?v=wIeJMdv5jxs

hmfrh··on An RFC that adds support for Rust to the Linux kernel
A list is found here[1].

[1]: https://github.com/Rust-for-Linux/linux/issues/2