Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.

Sniper PT

Work with *.dta files....

This topic is 5884 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello I'm newbie is game programing and i'm portuguese (so, my english isn't good...). I need the code, in visual basic, for open, delete and add files on a dta file. This dta file is a data file of the game Hidden and Dangerous. Can you give that code? Thank you Sniper PT P.S.: I have the code to open that files: <--CODE -------------- Enclosure number 1 ---------------- ' Hidden & Dangerous DTA/CNT open code (Visual Basic) ' By Devilliers Alexandre for Dragon UnPACKer 4 Type DTA_CNT_Header ' 24 Bytes ID As String * 8 ' "COMPCNT4" DTASize As Long ' Size of the .DTA file Unknown1 As Long ' Maybe some CRCs for .DTA file Unknown2 As Long ' Maybe some CRCs for .DTA file Dirnum As Long End Type Type DTA_CNT_Entry ' Variable Bytes Offset As Long Size As Long End Type ' Get16 FileName Sub OpenDTA_CNT(Fil$) Dim HDR As DTA_CNT_Header, ENT As DTA_CNT_Entry If Dir(Fil$) = "" Then 'File not found Exit Sub End If HFil = FreeFile Open Fil$ For Binary As #HFil ID_DTA$ = " " Get #HFil, , ID_DTA$ If ID_DTA$ <> "DTA_" Then ' Bad Format Close #HFil Exit Sub End If ' CNT file.. Same filename but with .cnt extension CNTFil$ = Left(Fil$, InStrRev(Fil$, ".")) + "cnt" If Dir(CNTFil$, vbHidden) = "" Then ' CNT file not found (those files are usually hidden) Close #HFil Exit Sub End If CFil = FreeFile Open CNTFil$ For Binary As #CFil Get #CFil, , HDR If HDR.DTASize <> LOF(HFil) Then ' Bad File Size Close #HFil, CFil Exit Sub End If For x = 1 To HDR.Dirnum Get CFil, , ENT get16 CFil, nam$ ' x as Integer + String * x ' ENT.Offset ' ENT.Size Next End Sub CODE--> [edited by - Sniper PT on August 12, 2002 6:22:33 AM]

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!