You need to take at least 3 things into consideration: copyright, licence, and patents, and they are all different.
Copyright is the right to copy software (or other copyrightable intellectual property). You don't own the copyright to the .NET binaries, but have been granted a licence to download and install them by their copyright holder, Microsoft. If you haven't agreed to the licence, your install is illegal. Then you are reverese-engineering a part of the binaries; this is probably against the terms of the licence (most closed-source software licences forbid reverse engineering). Finally, patents. A patent can protect an algorithm, and if this applies, it doesn't matter who wrote the implementation or whether you came up with it yourself or not: If it's patented, you can't use it without the patent holder's permission.
So what you need to check is:
- Does the licence allow reverse-engineering, and then adapting and redistributing the resulting code, and if so, under what conditions?
- Do any patents apply to any part of the code you're generating and writing?
My guess would be that what you're doing is completely off limits at least for the licence part.