Hack Forums
[.NET] TextImagifier - Stop kiddies by turning your source into image - 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] TextImagifier - Stop kiddies by turning your source into image (/showthread.php?tid=1376826)

Pages: Pages 1 2 3 4 5


TextImagifier - Stop kiddies by turning your source into image - hgdfhsdgdfgdfh - Jun 13, 2011

Anti-skid solution
Stop copy&paste noobs by turning plain text source code into image.
Simple to use program, requires .NET 4.0.

Malware free!
[img]http://img706.imageshack.us/img706/3979/imgdhn.png[/img]
->
[img]http://img861.imageshack.us/img861/5808/testeh.png[/img]

http://www.multiupload.com/8VHITO3G3W

http://www.virustotal.com/file-scan/report.html?id=bcff384863a1d54cd04efca1a29693981d7ff5ca29e64e3aa1114ebefa902e83-1307989938


* - Headmaster - Jun 13, 2011

Please a add a picture, want to see what i am downloading


* - hgdfhsdgdfgdfh - Jun 13, 2011

Done, UI is simple but functional


* - Dbof - Jun 13, 2011

Tell me, did you create this?
This is awesome! It is a great idea.
I'm not a VB coder, but thanks anyway.


* - hgdfhsdgdfgdfh - Jun 13, 2011

Yes I did it, its simple C#, not VB. It can turn any text/code into image, not just VB or C#.
But thanks.


* - ka0 - Jun 13, 2011

WoW cool!!!keep up the good work


* - Ethernal Five - Jun 13, 2011

Yea its pretty simple, is the watermark included or did you add it yourself?


* - Ingenuity - Jun 13, 2011

Well here's a better version:

Image:
[img]http://img850.imageshack.us/img850/8341/myimg.png[/img]

Additional features:
-Uses a richtextbox - so supports whatever font you paste in and whatever color text you want
-No shitty watermark - so you can just use it without annoyances
-Free source code:

Code
'First add a Richtextbox and name it "rtbMain"
'And add a button named "button1"
Imports System.Runtime.InteropServices
Public Class frmMain  
<DllImport("USER32.dll")> _
    Private Shared Function SendMessage(ByVal hWnd As IntPtr, ByVal msg As Integer, ByVal wParam As Integer, ByVal lParam As IntPtr) As Int32
    End Function
    Public contentRectangle As Rectangle
    Private Const inch As Double = 14.4
    Private Const WM_USER As Integer = &H400
    Private Const EM_FORMATRANGE As Integer = WM_USER + 57
    <StructLayout(LayoutKind.Sequential)> _
    Private Structure RECT
  Public Left As Integer
  Public Top As Integer
  Public Right As Integer
  Public Bottom As Integer
    End Structure
    <StructLayout(LayoutKind.Sequential)> _
    Private Structure CHARRANGE
  Public cpMin As Integer
  Public cpMax As Integer
    End Structure
    <StructLayout(LayoutKind.Sequential)> _
    Private Structure FORMATRANGE
  Public hdc As IntPtr
  Public hdcTarget As IntPtr
  Public rc As RECT
  Public rcPage As RECT
  Public chrg As CHARRANGE
    End Structure

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  Dim sfd As New SaveFileDialog
  sfd.Filter = "JPEG Images|*.jpg"
  sfd.Title = "Save as..."
  If sfd.ShowDialog = DialogResult.OK Then
    With rtbMain
    Dim wid As Integer = .Width
    Dim hgt As Integer = .Height
    Dim bm As New Bitmap(wid, hgt)
    rtbMain.DrawToBitmap(bm, New Rectangle(0, 0, wid, hgt))
    RtbToBitmap(rtbMain, contentRectangle, sfd.FileName)
    End With
  End If
    End Sub

    Private Sub RtbToBitmap(ByVal rtb As RichTextBox, ByVal rectangle As Rectangle, ByVal fileName As String)

  Dim bmp As New Bitmap(rectangle.Width, rectangle.Height)
  Using gr As Graphics = Graphics.FromImage(bmp)
    Dim hDC As IntPtr = gr.GetHdc()
    Dim fmtRange As FORMATRANGE
    Dim rect As RECT
    Dim fromAPI As Integer
    rect.Top = 0
    rect.Left = 0
    rect.Bottom = CInt(Math.Truncate(bmp.Height + (bmp.Height * (bmp.HorizontalResolution / 100)) * inch))
    rect.Right = CInt(Math.Truncate(bmp.Width + (bmp.Width * (bmp.VerticalResolution / 100)) * inch))
    fmtRange.chrg.cpMin = 0
    fmtRange.chrg.cpMax = -1
    fmtRange.hdc = hDC
    fmtRange.hdcTarget = hDC
    fmtRange.rc = rect
    fmtRange.rcPage = rect
    Dim wParam As Integer = 1
    Dim lParam As IntPtr = Marshal.AllocCoTaskMem(Marshal.SizeOf(fmtRange))
    Marshal.StructureToPtr(fmtRange, lParam, False)
    fromAPI = SendMessage(rtb.Handle, EM_FORMATRANGE, wParam, lParam)
    Marshal.FreeCoTaskMem(lParam)
    fromAPI = SendMessage(rtb.Handle, EM_FORMATRANGE, wParam, New IntPtr(0))
    gr.ReleaseHdc(hDC)
  End Using
  bmp.Save(fileName, System.Drawing.Imaging.ImageFormat.Jpeg)
  bmp.Dispose()
    End Sub

    Private Sub rtbMain_ContentsResized(ByVal sender As Object, ByVal e As System.Windows.Forms.ContentsResizedEventArgs) Handles rtbMain.ContentsResized
  contentRectangle = e.NewRectangle
    End Sub
End Class

Download: http://www.mediafire.com/?mj7mqlqbg506phx
Virus Scan: http://virusscan.jotti.org/en/scanresult/47dc73061d809b7978af7efbcbd6883a490fae54

If this is your first project then well done, but why add the watermark!?
Oh and I wrote this in about 10 mins because I was annoyed with this one...


* - hgdfhsdgdfgdfh - Jun 13, 2011

This isnt my first project at all (for example: I know C++, I can write simple windows device drivers, hook SSDT etc)...
And please make your own topic instead of stealing this one.
BTW: You wrote that in 10 mins because this annoyed you? Weird: http://pastebin.com/SCcXQEkx
Dont underestimate the power of Google


* - Ingenuity - Jun 13, 2011

(Jun 13, 2011 12:31 PM)dextrey Wrote:  This isnt my first project at all (for example: I know C++, I can write simple windows device drivers, hook SSDT etc)...
And please make your own topic instead of stealing this one.
BTW: You wrote that in 10 mins because this annoyed you? Weird: http://pastebin.com/SCcXQEkx
Dont underestimate the power of Google

Oh - it's nice to see that a copy of NotepadX got leaked onto pastebin, it's nice to see someone put it up there, because I wrote IT!!

Take a look: https://hackforums.net/showthread.php?tid=1199578 - you can even compare the source, you'll see that I wrote it all :)

Oh, and btw, fail at trying to call me a leecher. Never underestimate people's ability to nick my source code and stick it on pastebin. And yeah, I did kinda thread-jack you, so sorry 'bout that.


* - Dbof - Jun 13, 2011

(Jun 13, 2011 12:26 PM)Jack Eagles1 Wrote:  Download: http://www.mediafire.com/?08pre904w236xlo
Virus Scan: http://virusscan.jotti.org/en/scanresult/47dc73061d809b7978af7efbcbd6883a490fae54

If this is your first project then well done, but why add the watermark!?
Oh and I wrote this in about 10 mins because I was annoyed with this one...

This one fucks up the picture...


* - Ingenuity - Jun 13, 2011

Do you mean the black border or what? If you only have 1 line then it doesn't look good, but if you have more than that, then the quality is fine.


* - Slayer - Jun 13, 2011

But... It's all good, skid protect and stuff... But... How can you copy the text from the images? o.o
OK FU THIS GOD DAMN DAY! That guy Xieru or w/e he is called made me... Oh brother what am I even saying... I should go take a warm bath and relax...

OP: Good job man, try to add in some corner "You can't copy this text, you have to write it"


* - Dbof - Jun 13, 2011

dextrey, please show us the source of this program. I like this, but if this is not your work, you should not get the merits for this...


* - Ingenuity - Jun 13, 2011

(Jun 13, 2011 12:46 PM)Dbof Wrote:  dextrey, please show us the source of this program. I like this, but if this is not your work, you should not get the merits for this...

Well, having looked at it on reflector, I can't find anything else similar to it on the web, so it's probably his work.