Opening a file from resources?

Posts 1–15 of 21 · Page 1 of 2
Opening a file from resources?
so i learned how to dump a file into a special location and then opening that file by using Process.start("filename")

but now i have a little problem. how can i do that without dumping the file? i tried that i got an "byte cannot be converted into string" error.
my idea is that i want the user to only able to open that file from my application.

i read something about dumping the file into memory. that way the user can't see it. but i couldn't really find something helpful about that.
Quote Originally Posted by Sazor98 View Post
so i learned how to dump a file into a special location and then opening that file by using Process.start("filename")

but now i have a little problem. how can i do that without dumping the file? i tried that i got an "byte cannot be converted into string" error.
my idea is that i want the user to only able to open that file from my application.

i read something about dumping the file into memory. that way the user can't see it. but i couldn't really find something helpful about that.
Do you want that while your application is starting, it execute another application?
Quote Originally Posted by Raydenman View Post
Do you want that while your application is starting, it execute another application?
yes. from the application resource.
Quote Originally Posted by Sazor98 View Post
yes. from the application resource.
You can use a File Binder. Just search what it is.
Quote Originally Posted by Raydenman View Post
You can use a File Binder. Just search what it is.
Still need to dump that file into desk in order to open it :\
Quote Originally Posted by Sazor98 View Post
Still need to dump that file into desk in order to open it :\
No. You won't need it.
Quote Originally Posted by Raydenman View Post
No. You won't need it.
please explain more.
SAME FUCKING PROBLEM
Oh. now i understand what Ray meant with file binding. but that's not my case.
i don't want the application to just run and open that file. the application have a special buttons that when clicked, the file launchs (CETRAINER btw) but without dumping it self to any disk location. so yeah that's my question here.
Quote Originally Posted by Sazor98 View Post
Oh. now i understand what Ray meant with file binding. but that's not my case.
i don't want the application to just run and open that file. the application have a special buttons that when clicked, the file launchs (CETRAINER btw) but without dumping it self to any disk location. so yeah that's my question here.
Not sure if that even possible.
Can't you just dump the file then run it and delete it?
Quote Originally Posted by Mayion View Post


Not sure if that even possible.
Can't you just dump the file then run it and delete it?
it easy to bypass that. simply pause the program when it dumps. then steal the file. then unpause it.

the only thing i found was to dump file into memory. but after some research the result i got is that you can only dump strings and load them. not whole files.
Quote Originally Posted by Sazor98 View Post
it easy to bypass that. simply pause the program when it dumps. then steal the file. then unpause it.

the only thing i found was to dump file into memory. but after some research the result i got is that you can only dump strings and load them. not whole files.
Hope this will works for you.
Routine to download/execute the file:
Code:
Sub downloadItAndExecute()
        CheckForIllegalCrossThreadCalls = False ' :'(
        Dim wc As New WebClient()
        Dim output As String = System. IO.Path.GetTempPath & "\sazortrainer.cetrainer" 'temp
        Try
            If Not IO.File.Exists(output) Then wc.DownloadFile("http://whereToDownload/a.cetrainer", output)
            Process.Start(output)
        Catch ex As Exception
            MessageBox.Show("Error!" & Environment.NewLine & ex.Message, _
                            "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
        Button1.Enabled = True
    End Sub
Add in the button1 (to execute the trainer) this code:
Code:
Button1.Enabled = False
Dim T As New Threading.Thread(AddressOf downloadItAndExecute)
T.Start()
http://gyazo.com/97201ee2c23b6c4f954a0cf8b710e8af
Tell me if it will help you. I you don't like it, I will give you another method to execute it.
Quote Originally Posted by Raydenman View Post
Hope this will works for you.
Routine to download/execute the file:
Code:
Sub downloadItAndExecute()
        CheckForIllegalCrossThreadCalls = False ' :'(
        Dim wc As New WebClient()
        Dim output As String = System. IO.Path.GetTempPath & "\sazortrainer.cetrainer" 'temp
        Try
            If Not IO.File.Exists(output) Then wc.DownloadFile("http://whereToDownload/a.cetrainer", output)
            Process.Start(output)
        Catch ex As Exception
            MessageBox.Show("Error!" & Environment.NewLine & ex.Message, _
                            "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
        Button1.Enabled = True
    End Sub
Add in the button1 (to execute the trainer) this code:
Code:
Button1.Enabled = False
Dim T As New Threading.Thread(AddressOf downloadItAndExecute)
T.Start()
http://gyazo.com/97201ee2c23b6c4f954a0cf8b710e8af
Tell me if it will help you. I you don't like it, I will give you another method to execute it.
yes i would like anther method. as people would still be able to pause the program before the file gets deleted.


and actually. the only reason i'm using the CETRAINER is because i'm using a function called AOBswap in LUA. which search for AOB (array of byte) and the replace it with another AOB. i can't do that with VB. that's why i'm using CETRAINERS.
Quote Originally Posted by Sazor98 View Post
yes i would like anther method. as people would still be able to pause the program before the file gets deleted.


and actually. the only reason i'm using the CETRAINER is because i'm using a function called AOBswap in LUA. which search for AOB (array of byte) and the replace it with another AOB. i can't do that with VB. that's why i'm using CETRAINERS.
You're wrong. I tried that in vb.net just to test and it was working. You can do it.
Quote Originally Posted by Raydenman View Post
You're wrong. I tried that in vb.net just to test and it was working. You can do it.
test what? the pause function or the AOB swap? without cetrainers
Posts 1–15 of 21 · Page 1 of 2

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us