Can I use the engine's source code in my plugin?

Hi all,

I have a plugin on the marketplace that uses DesktopPlatformModule for some of its functions. Now since DesktopPlatformModule is a developer module, it doesn’t package when using the Shipping build configuration which is sort of an issue.

I was wondering, am I allowed (legally) to extract the segments of code I need out of the module into another class and then sell that on the marketplace? In a way I can imagine how this can be seen as stealing code, but would that only be the case if I put my copyright claim right?

It would seem this is allowed, but only for source code from the Editor or Developer folders: