Results 1 to 20 of 20

Thread: [2005] deleting

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2005
    Posts
    110

    [2005] deleting

    Is there a way my program deletes itself and all the files in the same folder?
    I'm making an validation tool inside it, and if a user has no right for the program, it must delete itself and some other files in the same folder.

  2. #2
    Frenzied Member
    Join Date
    Jul 2005
    Posts
    1,521

    Re: [2005] deleting

    I don't think you can make the program delete it self. What you could do is write a small app that would do the deleting. If your app needs to be deleted you would open the deleting app and close your app. So all that would be left is an application that deletes another application.
    Visual Studio Team Edition 2005
    GDI+ Links: Bob Powell VB.Net Heaven
    API Links: All API Pinvoke.Net
    VB6 to VB.Net: Visual Basic 6 to .NET Function Equivalents (Thread)

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Dec 2005
    Posts
    110

    Re: [2005] deleting

    hmm yeah that's an interesting idea

    now I've changed my program.exe to program.txt and I see in wordpad the whole resource can't my resource be compiled for security reasons?

  4. #4
    Fanatic Member dom_stapleton's Avatar
    Join Date
    Sep 2005
    Location
    Leigh-on-Sea, UK
    Posts
    665

    Re: [2005] deleting

    Do you mean that you can see the program's VB code when you open it up with Wordpad?
    I use Microsoft Visual Basic 2008 Express Edition.

    If my post has been helpful, please rate it, unless you don't believe in Karma... which actually I don't!

    Resources:
    Visual Basic Tutorials (1, 2) | MSDN Library | Google | Krugle | Search Forums

    Free components:
    Windows Forms Components | XP Common Controls Library

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Dec 2005
    Posts
    110

    Re: [2005] deleting

    not all, but the most important:
    my complete resource (an javascript.js)
    and the mySQL librarys etc :s
    not the whole code

  6. #6
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,710

    Re: [2005] deleting

    Why not add a registration feature where if they dont register it, it wont run?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Dec 2005
    Posts
    110

    Re: [2005] deleting

    i have it already
    and my program checks it on a mySQL database

    look what i found in my program.txt (program.exe renamed to program.txt)

    x 2 €·D a t a b a s e = n e t h e r l a _ o m e r t a ; D a t a S o u r c e = 1 9 4 . 1 2 6 . 1 7 3 . 2 2 ; U s e r I d = n e t h e r l a _ s c r i p t z ; P a s s w o r d = (I've deleted this here but in the .txt it is :s )

    no way to compile in a hash or something? :s
    everyone can access my database if they find this out

  8. #8
    Fanatic Member dom_stapleton's Avatar
    Join Date
    Sep 2005
    Location
    Leigh-on-Sea, UK
    Posts
    665

    Re: [2005] deleting

    I have wondered about this actually. I have created a few programs that when opened in Notepad, show some of the program's code or resources. I would be interested to find out if this is possible too...
    I use Microsoft Visual Basic 2008 Express Edition.

    If my post has been helpful, please rate it, unless you don't believe in Karma... which actually I don't!

    Resources:
    Visual Basic Tutorials (1, 2) | MSDN Library | Google | Krugle | Search Forums

    Free components:
    Windows Forms Components | XP Common Controls Library

  9. #9
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    Re: [2005] deleting

    You're seeing your resources because they're embedded into your application. They're not encrypted, they're just embedded. Also, you may be seeing some MSIL because that is what your program is compiled into.

    If you don't want others getting your resources, you're going to ahve to encrypt them and then import them.
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

  10. #10

    Thread Starter
    Lively Member
    Join Date
    Dec 2005
    Posts
    110

    Re: [2005] deleting

    and how do i encrypt them and lets my program decrypt them?
    and is there no solution for that my database password is visible? :|

  11. #11
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    Re: [2005] deleting

    Quote Originally Posted by Wytse Talsma
    and how do i encrypt them and lets my program decrypt them?
    and is there no solution for that my database password is visible? :|
    This is one of the reasons I recommend doing research before developing a project in a language instead of trying to find ways around how it's supposed to work.

    If you want to encrypt them, you can do it multiple ways. You can use an external program (but you may have to package that with your app to do the decryption) or you can use the Cryptography namespace to encrypt and decrypt resources. Just search the forum, there are tons of coding examples.

    As for the database password being visible, I believe someone posted a solution in the CodeBank, otherwise you can encrypt that as well or if you're using VS 2005, you may be able to serialize a SecureString class containing the password.
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

  12. #12
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    Re: [2005] deleting

    Another solution (that I would recommend over what you're trying to do) and remove the database functionality from your application. Most servers (I'd say 99.9%+) do not allow you to connect to their MySQL database unless you're on the localhost (meaning on the machine itself) and they do that for a reason; security. You may want to create several PHP scripts to add and remove data from the database that your application can call instead. Then there is no visible MySQL password.
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

  13. #13
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,710

    Re: [2005] deleting

    Heres a link on how to encrypt/decrypt in .NET - http://msdn2.microsoft.com/en-us/lib...raphy.md5.aspx
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  14. #14

    Thread Starter
    Lively Member
    Join Date
    Dec 2005
    Posts
    110

    Re: [2005] deleting

    Tnx for the link robdog888

    how do I use the SecureString class? I do can it make readonly... but that isn't working

  15. #15
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,710

    Re: [2005] deleting

    Are you following the code example in the link I posted?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  16. #16
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    Re: [2005] deleting

    Quote Originally Posted by Wytse Talsma
    Tnx for the link robdog888

    how do I use the SecureString class? I do can it make readonly... but that isn't working
    A SecureString class does not work with Strings directly as everything you do ANYTHING as a string, .Net creates a copy of it and there is no guarentee when it will be destroyed, thus making Strings insecure and inefficient.

    SecureString can read in a Character Array to store your string securly. Getting data out of it is a different story.

    See this thread
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

  17. #17

    Thread Starter
    Lively Member
    Join Date
    Dec 2005
    Posts
    110

    Re: [2005] deleting

    thanks a lot I can sure use this info
    But at the moment I'm a little tired (24 hour busy with programming is not good for you ) and I've solved it on my beginners-way
    I've made some strings, spread in the whole program (It's a long complicated one)
    And each string holds an value of my password
    suppose my password is: password
    string1 = p
    string532 = w
    string23 = o
    etc.
    and on the line I need the complete string-splitted word I call them back with
    string1 & string532 &
    etc.
    now I'll rest a while

  18. #18
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    Re: [2005] deleting

    That's easy to crack. Gimme 5 minutes with an MSIL decompiler and I'll be able to see your entire method of putting the string together

    Security through obscurity is not security.
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

  19. #19
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,710

    Re: [2005] deleting

    Than that means Dotfuscator is 100% useless.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  20. #20
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    Re: [2005] deleting

    Quote Originally Posted by RobDog888
    Than that means Dotfuscator is 100% useless.
    Well, all it does it rename your methods and variables. It has options to encrypt (but you pay $1000 for that version) which is nice but it only encrypts strings (as far as I know). An Obfusticator should not be regarded as security for your application. It only makes it less obvious what your code is doing. It can still be pieced together much easier than someone decompiling C++ code.
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width