Hack Forums
[.NET] Make you programs safer for others, Avoid Unwanted binding and cracking! - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] Make you programs safer for others, Avoid Unwanted binding and cracking! (/showthread.php?tid=545912)

Pages: Pages 1 2


Make you programs safer for others, Avoid Unwanted binding and cracking! - RBH - Jul 16, 2010

First of all the credits for this idea go to orgy who maked this thread:
https://hackforums.net/showthread.php?tid=545488
I advice you to read that thread because that will explain this functions.

I made a 2 functions to do this.

The first one is MD5get:
Code
Public Function Md5Get() As String
  Dim MD5 As New System.Security.Cryptography.MD5CryptoServiceProvider
  Dim Data() As Byte
  Dim hash() As Byte
  Dim strData As String = IO.File.ReadAllText(Application.ExecutablePath)
  Data = System.Text.Encoding.UTF8.GetBytes(strData)
  hash = MD5.ComputeHash(Data)
  MD5 = Nothing
  Dim strOutput As New System.Text.StringBuilder(hash.Length)
  For i As Integer = 0 To hash.Length - 1
    strOutput.Append(hash(i).ToString("X2"))
  Next
  Return strOutput.ToString().ToLower
    End Function
That function is used by the program to get the md5 hash of the executable.

The 2th function is to check if the md5 hash is right, i did this in combination with a online hosted txt file.
Code
Public Function Md5Check() As String
  Dim md5 As String
  Dim wc = New System.Net.WebClient
  Try
    md5 = wc.DownloadString("") ' < You Url here with the MD5 textfile: www.example.com/md5.txt
  Catch ex As Exception
    MsgBox("The txt file is not there or you have no internet access")
    Application.Exit()
  End Try

  If md5 = Md5Get() Then
    MsgBox("Valid")
  Else
    MsgBox("Edited")
  End If
    End Function

THIS TOO FUNCTIONS ME BE USED IN COMBINATION OTHERS THEY WONT WORK.

You may mod this functions to you needings but you need to give credits ;)

i made this little program using the md5get function to find the md5 of a other file:
[IMG]http://i32.[censored].com/30ux193.png[/IMG]
virusscan
Spoiler (Click to View)

downloadlink (source included):
Code
http://www.mediafire.com/?xgi86f4a81tm19c

I made a example project too with md5check and md5get (my url is included for md5 hash checking):
Code
http://www.mediafire.com/?isar64k595gz9iw



* - Vordal - Jul 16, 2010

What stops them just editing this, as well as whatever else they plan on changing after recompiling your application?


* - RBH - Jul 16, 2010

What do you mean vordal?
This functions are created to use in other programs the md5 changes when somebody trys to hex edit your program and then the program will not be useable.


* - Vordal - Jul 16, 2010

I mean, say your App is HWID protected. So I make some edits, and remove the HWID. Now, thanks to this function, that cracked App won't run. Well done. However, if I am able to remove the HWID Function, there is no reason I can't do the same to this function.


* - Tate - Jul 16, 2010

(Jul 16, 2010 07:41 AM)I am a Pirate! Wrote:  What do you mean vordal?
This functions are created to use in other programs the md5 changes when somebody trys to hex edit your program and then the program will not be useable.

He means whats stopping them from editing:

PHP Code

<?php 
if MD5Hash = MyMD5Hash then
End 
if 

to

PHP Code

<?php 
if MD5Hash = MD5Hash then
End 
if 

Anyways, good tutorial, this could be useful.


* - Neroxan - Jul 16, 2010

(Jul 16, 2010 07:45 AM)Tate Wrote:  He means whats stopping them from editing:
Writing your own simple encryption algorithm and encrypting the details, seeing how you should already be doing that for the clients hwid number anyways...


* - RBH - Jul 16, 2010

(Jul 16, 2010 07:45 AM)Vordal Wrote:  I mean, say your App is HWID protected. So I make some edits, and remove the HWID. Now, thanks to this function, that cracked App won't run. Well done. However, if I am able to remove the HWID Function, there is no reason I can't do the same to this function.

You only need to temporary disable the function and do you edits and then update the web file with the new md5 file and you can run the program again?


* - Orgy - Jul 16, 2010

Those of you saying "What if they crack it?"

Sure, but that can be said with any method. What if you don't offer HWID protection, you'd like to make a free version, and you don't want users binding shit to your program? Boom, this solves that problem, since binding it would create a different hash.

You could step this up by also checking filesize, etc.

This will work really well against skids that just like to bind their cybergates or plaguebots to shit.

And with the proper obfuscation, it will hinder crackers


* - nathan72389 - Jul 16, 2010

um.... what prevents me from changing your app to simply skip all your little md5 bullshit checks?

if md5 = ok then form1.show.. blah! we can bypass that so that regardless it will always be correct

if username found on online DB.. blah... we can skip that function also.


* - Orgy - Jul 16, 2010

(Jul 16, 2010 09:28 AM)nathan72389 Wrote:  um.... what prevents me from changing your app to simply skip all your little md5 bullshit checks?

if md5 = ok then form1.show.. blah! we can bypass that so that regardless it will always be correct

if username found on online DB.. blah... we can skip that function also.

See my post above. The typical skid wouldn't know how to do that


* - RBH - Jul 16, 2010

(Jul 16, 2010 09:28 AM)nathan72389 Wrote:  um.... what prevents me from changing your app to simply skip all your little md5 bullshit checks?

if md5 = ok then form1.show.. blah! we can bypass that so that regardless it will always be correct

if username found on online DB.. blah... we can skip that function also.

blah.. This is just BLah example, you know BLAH!
just to give people a idea BLAHBLUB!

BLAH DRUNKEN REDNEK


* - ¶_¶ - Jul 16, 2010

But it's not a binder protector. If we bind the file with another it will run.


* - RBH - Jul 16, 2010

@q_q yes you are right but it will atleast warn you ;)


* - ¶_¶ - Jul 16, 2010

Yes, thanks for the idea. :]


* - GyroErbin0 - Jul 16, 2010

how about doing it like this ;)
Code
Public Sub Md5Check()
  Dim md5 As String
    md5 = "Already calculated Md5 of your app"' < Calculated MD5 of your app :) ( NO INTERNET CONNETION :) )
  End Try

  If Not md5 = Md5Get() Then
   Me.Close
  End If
    End Sub