Results 1 to 6 of 6

Thread: Read Binary Files[VB]

  1. #1

    Thread Starter
    Addicted Member kill_bill_gates's Avatar
    Join Date
    Oct 2004
    Posts
    222

    Question Read Binary Files[VB]

    Greetings,

    How can I access, read and change/proccess files in binary in VB?

    Any help would be appreciated.
    Last edited by kill_bill_gates; Aug 3rd, 2005 at 06:07 AM.
    "Quis custodiet ipsos custodes?"
    Juvenal
    Mete the Hun wanted to live in peace with the Chinese. So he gave the Chinese Emperor his favorite horse, best swords in his armory, and lots of other cool stuff. But then the Chinese Emperor asked for one thing. A useless land through the north. It was a small, useless, unproductive, uninhabited piece of land. But Mete the Hun's answer was certain:
    I gave you horses, weapons and much more which belonged to me. But the lands are not mine, it's my nation's and I'm ready to fight, kill and die for just an inch my country
    -=Joey Jordison R0CKS!! =-

  2. #2
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Read Binary Files

    kill_bill_gates,

    Well, it may be determined by just what you want to accomplish. Look at my signature for the Hex File Editor and see if that helps.

  3. #3

    Thread Starter
    Addicted Member kill_bill_gates's Avatar
    Join Date
    Oct 2004
    Posts
    222

    Re: Read Binary Files[VB]

    Well Randem; it did not help unoftunately. What I'd like to do is to access and modify a .jpeg file.
    "Quis custodiet ipsos custodes?"
    Juvenal
    Mete the Hun wanted to live in peace with the Chinese. So he gave the Chinese Emperor his favorite horse, best swords in his armory, and lots of other cool stuff. But then the Chinese Emperor asked for one thing. A useless land through the north. It was a small, useless, unproductive, uninhabited piece of land. But Mete the Hun's answer was certain:
    I gave you horses, weapons and much more which belonged to me. But the lands are not mine, it's my nation's and I'm ready to fight, kill and die for just an inch my country
    -=Joey Jordison R0CKS!! =-

  4. #4
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Read Binary Files[VB]

    kill_bill_gates,

    So, tell me why it did not help you change a binary file as you asked?

  5. #5

    Thread Starter
    Addicted Member kill_bill_gates's Avatar
    Join Date
    Oct 2004
    Posts
    222

    Re: Read Binary Files[VB]

    I wanted to do it through VB, what you suggested was an exe file.
    "Quis custodiet ipsos custodes?"
    Juvenal
    Mete the Hun wanted to live in peace with the Chinese. So he gave the Chinese Emperor his favorite horse, best swords in his armory, and lots of other cool stuff. But then the Chinese Emperor asked for one thing. A useless land through the north. It was a small, useless, unproductive, uninhabited piece of land. But Mete the Hun's answer was certain:
    I gave you horses, weapons and much more which belonged to me. But the lands are not mine, it's my nation's and I'm ready to fight, kill and die for just an inch my country
    -=Joey Jordison R0CKS!! =-

  6. #6
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    Re: Read Binary Files[VB]

    VB Code:
    1. Dim FF As Integer, MyData As String
    2.  
    3. ' read from binary file
    4. FF = FreeFile
    5. Open "C:\myfile.dat" For Binary Access Read Lock Write As FF
    6.     MyData = String(LOF(FF), 0)
    7.     Get FF, , MyData
    8. Close FF
    9.  
    10. ' write to binary file
    11. FF = FreeFile
    12. Open "C:\myfile.dat" For Binary Access Write Lock Write As FF
    13.     Put FF, , MyData
    14. Close FF

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