folgende Struktur möchte ich gerne in PureBasic abbilden um mit einer DLL, die ich aus freiem C Code erstellt habe, zu arbeiten (testen):
Die C Struktur
Code: Alles auswählen
/* archive structure used since diablo 1.00 by blizzard. */
struct mpq_archive {
/* generic file information. */
FILE *fp; /* file handle. */
/* generic size information. */
uint32_t block_size; /* size of the mpq block. */
off_t archive_offset; /* absolute start position of archive. */
/* archive related buffers and tables. */
mpq_header_s mpq_header; /* mpq file header. */
mpq_header_ex_s mpq_header_ex; /* mpq extended file header. */
mpq_hash_s *mpq_hash; /* hash table. */
mpq_block_s *mpq_block; /* block table. */
mpq_block_ex_s *mpq_block_ex; /* extended block table. */
mpq_file_s **mpq_file; /* pointer to the file pointers which are opened. */
/* non archive structure related members. */
mpq_map_s *mpq_map; /* map table between valid blocks and hashes. */
uint32_t files; /* number of files in archive, which could be extracted. */
};
Code: Alles auswählen
;- archive structure used since diablo 1.00 by blizzard.
Structure mpq_archive
; generic file information.
*fp ; file handle. Type: FILE
; generic size information.
block_size.l ; size of the mpq block.
archive_offset.q ; absolute start position of archive.
; archive related buffers and tables.
mpq_header.mpq_header_s ; mpq file header.
mpq_header_ex.mpq_header_ex_s ; mpq extended file header.
*mpq_hash.mpq_hash_s ; hash table.
*mpq_block.mpq_block_s ; block table.
*mpq_block_ex.mpq_block_ex_s ; extended block table.
*mpq_file.mpq_file_s ; pointer to the file pointers which are opened.
; non archive structure related members.
*mpq_map.mpq_map_s ; map table between valid blocks and hashes.
files.l ; number of files in archive, which could be extracted.
EndStructure
Das wäre die erste Frage, Danke schonmal für die Antworten.
Die zweite Frage handelt sich um eine weitere Struktur. Die Original Struktur in C sieh wie folgt aus:
Code: Alles auswählen
/* file structure used since diablo 1.00 (0x38 bytes). */
typedef struct {
uint32_t seed; /* seed used for file decrypt. */
uint32_t *packed_offset; /* position of each file block (only for packed files). */
uint32_t open_count; /* number of times it has been opened - used for freeing */
} PACK_STRUCT mpq_file_s;
Code: Alles auswählen
;- file Structure used since diablo 1.00 (0x38 bytes). */
Structure mpq_file_s Align 4
seed.l ; seed used for file decrypt.
*packed_offset ; position of each file block (only for packed files). Pointer type is: uint32_t
open_count.l ; number of times it has been opened - used for freeing
EndStructure

Ich bedanke mich schonmal für Eure Hilfe