0

I have a winform app, I completed with business model and update function. But when I learn about security .Net, I found that almost impossible to anti crack/hacking with obfuscation.

So I want move 99.99% source code to cloud. But I've not found any doc that useful for making it.

Can I do my idea as below:

using ....;
namespace myApp
{
public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
    }

public GetSourceClass()
    {
     //  Here i want get all source code, include all class and all 
     //   variables from server.Is it possible?
    }

private void Form1_Load(object sender, EventArgs e)
    {
        GetSourceClass();
    }
halfer
  • 19,824
  • 17
  • 99
  • 186
  • You want to create an application that downloads your code from the cloud? What exactly do you want to do with it? – Rui Jarimba Jul 22 '18 at 09:44
  • Oh no. i dont want download code, because i dont want store source code on computer. I just want server send source(data) to client at //Runtime. After close app, source disappear. Thank you! – Try Hard More Jul 22 '18 at 10:01
  • @TryHardMore This achieves nothing. If code is running on your machine, it is found in memory, and anyone with access to that machine can decompile it. – Rotem Jul 22 '18 at 10:06
  • @Rotem So move source to cloud is useless? Can you give me some suggestion :( – Try Hard More Jul 22 '18 at 10:11
  • @TryHardMore *Run* sensitive code on the server, not on the client. – Rotem Jul 22 '18 at 10:12
  • [this may or may not help](https://stackoverflow.com/questions/15142917/dynamically-loading-classes-with-custom-behavior-from-different-assemblies) – TaW Jul 22 '18 at 10:15
  • @Rotem i just want hide bussiness model logic. I can not run/excute code on the server, because only client app have framework/asset/... enough to excute code. – Try Hard More Jul 22 '18 at 10:18
  • @TryHardMore Some ideas here https://stackoverflow.com/questions/551892/how-effective-is-obfuscation – Rotem Jul 22 '18 at 10:20
  • @Rotem can i add extra code like: find all window process/ program running real time. And if my app find some memory hacking tool. My app will auto shutdown or crashed? – Try Hard More Jul 22 '18 at 10:21
  • @TryHardMore Sure, until I rename my memory cracking tool to `explorer.exe`. I hope you don't find this offensive, but I absolutely guarantee that you are not going to be able to protect .NET code from reverse engineering against a motivated and competent attacker which has full access to the binaries. You can strive for security through obscurity, but that will only eliminate amateurs. – Rotem Jul 22 '18 at 10:24
  • @Rotem Thank you Rotem, pls give some suggestion of framework for building desktop app that good to against hacker/cracker by your real experiences. If it is ok, i will migrate my code to new framework. Thank you! – Try Hard More Jul 22 '18 at 10:31
  • @TryHardMore c++ or a natively compiled language will be a better start, but even then you will need to be an expert to protect against competent attackers. How many commercial products do you know that can not be cracked? – Rotem Jul 22 '18 at 10:36
  • Ah, i just know that some online game that need purchase account good on this thing. Hey @Rotem, specially thank you so much (Y)! – Try Hard More Jul 22 '18 at 10:39
  • 1
    What you want to do is build web services that have all of your proprietary business logic. Your forms application can make HTTP calls to do everything. – Crowcoder Jul 22 '18 at 10:57
  • If you want to "hide" your logic, you can for example create a REST API and invoke it in the client application. See https://www.sitepoint.com/developers-rest-api/ – Rui Jarimba Jul 22 '18 at 12:35
  • @Crowcoder can you give document link. Please read again my post and see that line contain:" Can i do my idea as below: ....using....code..." After you read, please answer me: can i do it? Thank you so much! sorry for bad english, i really dont want talk like a command :( I am not english native. – Try Hard More Jul 22 '18 at 13:43
  • It is too broad a question to answer with specifics. Have you ever worked with, or are you familiar with Single Page web applications (SPA)? The application makes HTTP calls to a backend web layer to do all the work, it is just data that is pushed around on the web page in your browser. What I'm saying is that it sounds like you want build a SPA-like app with winforms. It means you would need a way to host an API (web application) online. – Crowcoder Jul 22 '18 at 13:50
  • @Crowcoder Sad that server (both SPA/Asp web app) can not excute my code, because my code only run on my client app framework built for desktop. My client app have all of its framework and dependencies. Do you have other way to do my idea (that i wrote on first post with code section)? – Try Hard More Jul 22 '18 at 14:21
  • Those references and dependencies would move to the web service. Imagine if you put all your logic in a dll instead of in the form code-behind. It should be easy to move your business logic to a web service by referencing that dll (and dependencies). – Crowcoder Jul 22 '18 at 14:25
  • @Crowcoder i will try do your method. Thank you so much (Y)! – Try Hard More Jul 23 '18 at 07:38

0 Answers0