Live data from Hacker News

I found a bug in the .NET framework and fixed it by hand-altering the DLL

blog.nullspace.io

111–120 of 124 posts

Re: I found a bug in the .NET framework and fixed it by hand-altering the DLL

#111
post #17

Earlier quoted context omitted.

> Well, GCC is next-to-impossible to compile for a target other than the host, especially if the target isn't x86 or ARM; You're exaggerating. I had no problems compiling gcc 3.something targeting MIPS-I on an x86 Linux host.

I can't tell if you're being sarcastic. Generally, compiling GCC to target another architecture involves not only recreating most of the root directory structure (notably include files) of the target on the host, but also compiling libc, bintools, and a few other more obscure libraries. And this all needs to be done in the correct order (which involves something like compiling half of libc before compiling GCC, and c…

Depends on the approach.

In some distributions, say, Debian, there are readily available cross-compiler packages (like g++-4.4-arm-linux-gnueabi). I haven't rebuilt gcc, but the approach must be to pull package's source, add a patch and run the build - then debian/rules and myriad of various helper scripts will take the hassle of doing everything. Just can't be the other way since package builds are automated.

And there are other tools, like buildcross that also automate the job.

Re: I found a bug in the .NET framework and fixed it by hand-altering the DLL

#112
post #106

I did this once with GCC. "But GCC's open source!" you say. Well, GCC is next-to-impossible to compile for a target other than the host, especially if the target isn't x86 or ARM; and GCC maintainers insist on precise test cases to vet a bug, even if the issue is immediately obvious from reading the source code and the bug only occurs in certain very complex situations. (/me looks forward to the day Clang/LLVM become…

Back in the day, crosstool was a solid way to build cross-compilers: http://kegel.com/crosstool/ I haven't really kept up with the latest stuff, but I've seen mentions of crosstool-ng, which may be a newer take on it: https://github.com/diorcety/crosstool-ng So, no, it's not next-to-impossible. It's a little complicated, and that's why these projects exist, but my memory of crosstool was that it made it trivially eas…

I've used crosstool-ng as recently as 8ish months ago, so I will agree: it's not even remotely next-to-impossible but instead very very possible, and, I'd venture to say, almost easy.

Re: I found a bug in the .NET framework and fixed it by hand-altering the DLL

#113
I feel like a "freetard" "greybeard" "basement-dweller" (insert-your-own-pejorative-here) saying this, but: yet another reason why I will never ever base my livelihood on a closed ecosystem. Open source is certainly not a panacea, but needing to do something like this is just ridiculous.

Re: I found a bug in the .NET framework and fixed it by hand-altering the DLL

#114

The fact that you can even do this without setting off a ton of alarmbells about failed checksums is what really scares me.

The fact that people think you shouldn't be able to do this is what really scares me. :) I should be able to change the software on my own machine, stored on and running on hardware I own, in whatever way I desire and have it do what I want. (And in practice I have - opening a binary in a hex editor and changing a few bytes is not at all beyond me.)

Of course you should be. But it still should generate warnings and force you to override some fairly impressive 'do you know what you are doing?' warnings.

Re: I found a bug in the .NET framework and fixed it by hand-altering the DLL

#115
post #113

I feel like a "freetard" "greybeard" "basement-dweller" (insert-your-own-pejorative-here) saying this, but: yet another reason why I will never ever base my livelihood on a closed ecosystem. Open source is certainly not a panacea, but needing to do something like this is just ridiculous.

The point of free software is you can do what you want with it, including fixing it if needs be. I believe Stallman started the movement from frustration that he couldn't fix a problem in some software he used.

Re: I found a bug in the .NET framework and fixed it by hand-altering the DLL

#116
post #73
post #17

Earlier quoted context omitted.

> Well, GCC is next-to-impossible to compile for a target other than the host, especially if the target isn't x86 or ARM; You're exaggerating. I had no problems compiling gcc 3.something targeting MIPS-I on an x86 Linux host.

I tried to compile GCC for ARM (from X86 Windows), and it was a nightmare

> Windows

> nightmare

Not exactly sure what you were expecting. GCC on Windows is already wonky enough (MinGW? MinGW-w64?), I have no Idea how one can voluntarily try compiling GCC on Windows, let alone a cross compiler.

Re: I found a bug in the .NET framework and fixed it by hand-altering the DLL

#117
post #113

I feel like a "freetard" "greybeard" "basement-dweller" (insert-your-own-pejorative-here) saying this, but: yet another reason why I will never ever base my livelihood on a closed ecosystem. Open source is certainly not a panacea, but needing to do something like this is just ridiculous.

As the former opposite of the freetard and greybeard, a mere corporate VB peon, you are 100% spot on.

Most of the commercial software dev stuff is like regularly salting and sandpapering your genitals. And I'm not talking about fine grit paper either. Even relatively popular fields like .Net are painful on a daily basis.

I really like to see inside the black boxes when they inevitably go wrong. Hell getting a backtrace out of a dump file on windows from commercial software is an art in itself for example.

I had the fortune of inheriting a Sun SparcStation 20 in 1999 that was being thrown out. That and NetBSD literally drove a spike through my mind and entirely destroyed my conception of proprietary closed source software. I really wouldn't touch it now but the money sorting out all the shitty little problems is pretty good, even if it tries to stab you in the face 5 times a day. There's lots of work as well unlike my preferred field of Unix and C.

So I agree with you but I'm a slut for cash and unreliable black boxes of software is good money even if it does feel like I'm the IT equivalent of a STD ridden stripper.

Re: I found a bug in the .NET framework and fixed it by hand-altering the DLL

#118

Earlier quoted context omitted.

The fact that people think you shouldn't be able to do this is what really scares me. :) I should be able to change the software on my own machine, stored on and running on hardware I own, in whatever way I desire and have it do what I want. (And in practice I have - opening a binary in a hex editor and changing a few bytes is not at all beyond me.)

Of course you should be. But it still should generate warnings and force you to override some fairly impressive 'do you know what you are doing?' warnings.

> But it still should generate warnings

No it should not. DLL is basicly a reusable software library.

What you are suggesting makes no sense. I will give you B+ for confidence.

Re: I found a bug in the .NET framework and fixed it by hand-altering the DLL

#119
post #98
post #91

Earlier quoted context omitted.

Yup. Its funny as a dot net dev you learn to really love a few ms things and really hate the others. C# is a brilliant language. Entity framework is an awesome ORM. But anything to do with deployment? IIS? So very much rage. I'm in charge of the build process on my team and I'm quickly becoming "that guy in the corner who swears all the time".

Your still not cursing as much as the guy building msi installers though...

I actually do that job too. That horror falls under the umbrella of "deployment."

Re: I found a bug in the .NET framework and fixed it by hand-altering the DLL

#120
post #63

I know a lot of people here balk at the idea of paying for tooling, but Red Gate's Reflector[1] is absolutely amazing for situations like this. Not only is it a decompiler, but it allows you to decompile at debug-time and step into third party libraries. Assuming they haven't been obfuscated, this is an extremely useful tool. I've used it to track down a number of issues within Visual Studio itself and within some of…

Don't pay for Reflector. Throw JetBrains some more money - DotPeek [1] integrates nicely with ReSharper, or you can use it on its own for free.

I think the latest build can also provide PDBs to Visual Studio on the fly by acting as a source server (insane).

After years of Reflector being a free tool, Redgate added a time-bomb to new downloads and released a statement [2]

[1]: http://www.jetbrains.com/decompiler/

[2]: https://web.archive.org/web/20110205074826/http://www.red-ga...

Post reply on HN