Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

[VB.NET] How to add EOF support [TUT]

I posted the functions, but I didn't show how to use them.


First make a string called TheEOF or whatever under your form name example:

Code
Public Class Form1
    Dim TheEOF As String
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

Once you've done that add this read EOF function (We'll be writing it a different way)

Code
Public Function ReadEOFData(ByRef FilePath As String) As String
        Dim EOFBuf As String
        Dim lPos As Integer
        If Dir(FilePath) = "" Then
            Exit Function
        End If
        Dim ReadFile As String = IO.File.ReadAllText(FilePath)
        lPos = InStr(1, StrReverse(ReadFile), GetNullBytes(30))
        EOFBuf = (Mid(StrReverse(ReadFile), 1, lPos - 1))
        ReadEOFData = StrReverse(EOFBuf)
        If ReadEOFData = "" Then
        End If
        Exit Function
    End Function
    Public Function GetNullBytes(ByRef lNum As Object) As String
        Dim Buf As String
        Dim i As Short
        For i = 1 To lNum
            Buf = Buf & Chr(0)
        Next
        GetNullBytes = Buf
    End Function

I modified my function from VB6 to look more like VB.NET so some of you won't complain about it

Now in your file open dialog, after the file has been opened add this

Code
TheEOF = ReadEOFData(OFD.Filename)

Now at the end of your sub when the file is crypted add this

Code
If TheEOF = Nothing then
Messagebox.Show("File Crypted!")
Else
IO.File.AppendAllText(OFD.Filename, TheEOF)
MessageBox.Show("File Crypted With EOF!")
End If

That is how you use well any EOF function

This should help any beginner coding a crypter in vb.net or C# (Just convert it)
*NOTE* Only write EOF after everything else was written to the stub *NOTE*
Finally, we needed a thread like this for the noobs that can't put together your old thread.

Rating added :)
Thanks, great tutorial. I thought about writing it myself after you explaining it to me but I didn't do it :p
52 views and only 2 comments, really.
This seems simple but I don't know how to declare it correctly. Incorrect when OFD is declared. Hehe...

[IMG]http://i39.[censored].com/2r782ex.jpg[/IMG]

Thanks for the share. =p
---
oFd is open file Diangnol
(May 11, 2010 06:34 PM)Jeck Wrote:  This seems simple but I don't know how to declare it correctly. Incorrect when OFD is declared. Hehe...

[IMG]http://i39.[censored].com/2r782ex.jpg[/IMG]

Thanks for the share. =p

I'm not even going to answer this, this proves that your trying to rip this code
i got a error .. i pm you


five star added + rep added sended a pm
Good job killerpanther, I haven't tried this out yet but im sure it will come in handy ;)
(May 11, 2010 07:05 PM)xSilent Wrote:  I'm not even going to answer this, this proves that your trying to rip this code

Ok. Nevermind, I will try to figure it out myself. 😁
Just experimenting some codes eventhough I'm noob in .net.

Btw, thanks.
---
it worked on command.com which have EOF support it work like charm thanks aloat
Thanks for this man you just saved my life :) now to trawl through the code line by line char by char xD
Thanks man we really needed a tutorial on this.

-crow407
PHP & .NET Contributor.
Coding looks a little fualty can cuase an error.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by SkunT3lloJun 29, 2021 01:59 PM 2 192 Jun 29, 2021 01:59 PM
Last Post: SkunT3llo
[Python] by TreasuretrioAug 2, 2020 08:01 PM 2 152 Aug 2, 2020 08:01 PM
Last Post: Treasuretrio
[C] by RealyWhiteJan 5, 2019 11:12 AM 9 338 Jan 5, 2019 11:12 AM
Last Post: Mayuko