Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 24

Thread: Load from password protected zip files : Model Handling

  1. #11

    Wink

    Quote Originally Posted by ErosOlmi View Post
    Added password parameter to ZLib_ExtractToString.
    Will be present in next thinBasic beta version.
    sBuffer = ZLib_ExtractToString(ZIPFileName, sFileNameToExtract, sPassword)
    
    I'm trying to make more tests on different zip files created with different compressing applications.
    If you have some ZIP example with protected password file inside, just attach in this posts giving the password of the file and I will test.

    If all will work fine I will also work on something else:
    • ZLib_ExtractToHeap that will do the same as ZLib_ExtractToString but will allocate an Heap memory area returning it's handle.
    Here
    media.zip
    password = "passeport"

    the Zlib_ExtractoSting that can manage password protected zip files will be a important advance toward a greater project : the Filesystem module (like Add3Darchive procedure in purebasic)

    But dont forget , the final goal is that we can load resources like M15 files from memory (after extracting them from zip files to string)
    I looked in the TB modules and did not find an instruction that can do that (except for MakeTexture from string)

    Thank you for support
    Last edited by lassad; 09-03-2016 at 17:58.

  2. #12
    the Filesystem module (like Add3Darchive procedure in purebasic): it is also does not support password, the zipped archives in purebasic internal folders "C:\PureBasic\Examples\3D\Data\Packs" like skybox.zip we can open them easily. it is a long time requested feature but does not fullfilled yet.

  3. #13
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    54
    Posts
    1,529
    Rep Power
    170
    Quote Originally Posted by lassad View Post
    ...

    But dont forget , the final goal is that we can load resources like M15 files from memory (after extracting them from zip files to string)
    I looked in the TB modules and did not find an instruction that can do that (except for MakeTexture from string)

    Thank you for support
    yes, I guess Petr will have to add some function to create models from memory or string-buffer
    I think there are missing some Forum-sections as beta-testing and support

  4. #14
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10
    Here attached something to test

    Install new module
    Attached thinBasic_zLib.dll module, new zLib module. I had undergo from zlib_1.2.5 to zLib_1.2.3 because password protected
    Please Extract it under your \thinBasic\Lib\ directory substituting your current one.

    How to use
    New syntax of ZLib_ExtractToZip is:
    StringBuffer = ZLib_ExtractToZip(sZipFile, FileNameToExtract [, sPassword])
    
    If StringBuffer is not empty than you will have the uncompressed file and you can do whatever you want.

    Example
    Get Media.zip file from lassad previous post.
    Place it in the same directory of your script.
    Than execute the following script.
    If all will went fine, you will have 2 new file extracted on disk.
      uses "ZLib"
    
      Dim sBuffer     As String
      Dim ZIPFileName As String         
    
      ZIPFileName = APP_ScriptPath & "media.ZIP"
    
      sBuffer = ZLib_ExtractToString(ZIPFileName, "bones.jpg", "passeport")
      Save_File(APP_ScriptPath & "bones.jpg", sBuffer)
    
      sBuffer = ZLib_ExtractToString(ZIPFileName, "bones_all.x", "passeport")
      Save_File(APP_ScriptPath & "bones_all.x", sBuffer)
    
    If all is working fine, I will see what other functions I can develop.
    For sure something like ZLib_ExtractToHeap, exactly the same of ZLib_ExtractToString but will return an Heap memory pointer.

    Let me know.
    Eros
    Attached Files Attached Files
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  5. #15
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732
    I hear you guys!

    M15 from memory should not be a problem, let me look into it!


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  6. #16
    Quote Originally Posted by ErosOlmi View Post
    Here attached something to test

    Install new module
    Attached thinBasic_zLib.dll module, new zLib module. I had undergo from zlib_1.2.5 to zLib_1.2.3 because password protected
    Please Extract it under your \thinBasic\Lib\ directory substituting your current one.

    How to use
    New syntax of ZLib_ExtractToZip is:
    StringBuffer = ZLib_ExtractToZip(sZipFile, FileNameToExtract [, sPassword])
    
    If StringBuffer is not empty than you will have the uncompressed file and you can do whatever you want.

    Example
    Get Media.zip file from lassad previous post.
    Place it in the same directory of your script.
    Than execute the following script.
    If all will went fine, you will have 2 new file extracted on disk.
      uses "ZLib"
    
      Dim sBuffer     As String
      Dim ZIPFileName As String         
    
      ZIPFileName = APP_ScriptPath & "media.ZIP"
    
      sBuffer = ZLib_ExtractToString(ZIPFileName, "bones.jpg", "passeport")
      Save_File(APP_ScriptPath & "bones.jpg", sBuffer)
    
      sBuffer = ZLib_ExtractToString(ZIPFileName, "bones_all.x", "passeport")
      Save_File(APP_ScriptPath & "bones_all.x", sBuffer)
    
    If all is working fine, I will see what other functions I can develop.
    For sure something like ZLib_ExtractToHeap, exactly the same of ZLib_ExtractToString but will return an Heap memory pointer.

    Let me know.
    Eros
    works great

    good job eros

  7. #17
    Member
    Join Date
    Nov 2012
    Location
    Missouri, USA
    Posts
    113
    Rep Power
    29
    Lassad,

    Why do you show media.zipmedia.zip as the download file, yet it downloads as media.zip? And, you use media.zip in you script.

    Bill

  8. #18

    Smile

    Quote Originally Posted by Billbo View Post
    Lassad,

    Why do you show media.zipmedia.zip as the download file, yet it downloads as media.zip? And, you use media.zip in you script.

    Bill
    Sorry , a problem in the name typing, i will correct

  9. #19
    Quote Originally Posted by Petr Schreiber View Post
    I hear you guys!

    M15 from memory should not be a problem, let me look into it!


    Petr
    I saw in other libs (for purebasic) some functions like : CatchMesh (MemoryBlock), CatchAnimMesh (MemoryBlock) and CatchTexture(MemoryBlock)

    Wish it could give you an idea how to start

    Thanks for support

  10. #20
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732
    I checked the code now, loading M15 from memory is okay, but I wonder - how would you expect it to seek for textures?
    Because by default, it looks for the on HDD. Maybe passing array with texture IDs? Let me know!


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. password script and more :)
    By Lionheart008 in forum Console
    Replies: 2
    Last Post: 29-05-2009, 15:40
  2. XP / NT Password killer
    By Michael Clease in forum Security
    Replies: 0
    Last Post: 13-02-2009, 16:56
  3. username and password in script
    By sandyrepope in forum thinBasic General
    Replies: 11
    Last Post: 25-07-2007, 09:25
  4. Load image files.
    By cocoflop in forum thinBasic General
    Replies: 3
    Last Post: 17-05-2007, 21:04

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

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