compress.hpp File Reference
Data compression functions. More...
Enumerations | |
enum | linput_close_code_t { LOC_CLOSE , LOC_UNMAKE , LOC_KEEP } |
Upon closing outer linput, perform one of these actions. More... | |
Functions | |
idaman THREAD_SAFE int ida_export | zip_deflate (void *ud, ssize_t(idaapi *file_reader)(void *ud, void *buf, size_t size), ssize_t(idaapi *file_writer)(void *ud, const void *buf, size_t size)) |
Compress data. More... | |
idaman THREAD_SAFE int ida_export | zip_inflate (void *ud, ssize_t(idaapi *file_reader)(void *ud, void *buf, size_t size), ssize_t(idaapi *file_writer)(void *ud, const void *buf, size_t size)) |
Uncompress data. More... | |
idaman THREAD_SAFE int ida_export | process_zipfile (const char *zipfile, int(idaapi *callback)(void *ud, qoff64_t offset, int method, uint64 csize, uint64 ucsize, uint32 attributes, const char *filename), void *ud=nullptr) |
Process zip file and enumerate all files stored in it. More... | |
idaman THREAD_SAFE int ida_export | process_zip_linput (linput_t *li, int(idaapi *callback)(void *ud, qoff64_t offset, int method, uint64 csize, uint64 ucsize, uint32 attributes, const char *filename), void *ud=nullptr) |
Process zip file and enumerate all files stored in it. More... | |
idaman THREAD_SAFE int ida_export | process_zipfile_entry (const char *zipfile, const char *entry, int(idaapi *callback)(void *ud, qoff64_t offset, int method, uint64 csize, uint64 ucsize, uint32 attributes, const char *filename), void *ud=nullptr, bool case_sensitive=true) |
Search for specified entry in zip file, and calls the callback with it, if found. More... | |
idaman THREAD_SAFE linput_t *ida_export | create_zip_linput (linput_t *in, ssize_t insize=-1, linput_close_code_t loc=LOC_CLOSE) |
Create a linput to read a compressed input stream. More... | |
Variables | |
bool | legacy_idb |
for old idb files | |
Detailed Description
Data compression functions.
Enumeration Type Documentation
◆ linput_close_code_t
enum linput_close_code_t |
Function Documentation
◆ zip_deflate()
idaman THREAD_SAFE int ida_export zip_deflate | ( | void * | ud, |
ssize_t(idaapi *)(void *ud, void *buf, size_t size) | file_reader, | ||
ssize_t(idaapi *)(void *ud, const void *buf, size_t size) | file_writer | ||
) |
Compress data.
This function depends on the value of legacy_idb, so it is not completely thread safe. However, legacy_idb does not change its value.
- Returns
- Compression error codes
◆ zip_inflate()
idaman THREAD_SAFE int ida_export zip_inflate | ( | void * | ud, |
ssize_t(idaapi *)(void *ud, void *buf, size_t size) | file_reader, | ||
ssize_t(idaapi *)(void *ud, const void *buf, size_t size) | file_writer | ||
) |
Uncompress data.
This function depends on the value of legacy_idb, so it is not completely thread safe. However, legacy_idb does not change its value.
- Returns
- Compression error codes
◆ process_zipfile()
idaman THREAD_SAFE int ida_export process_zipfile | ( | const char * | zipfile, |
int(idaapi *)(void *ud, qoff64_t offset, int method, uint64 csize, uint64 ucsize, uint32 attributes, const char *filename) | callback, | ||
void * | ud = nullptr |
||
) |
Process zip file and enumerate all files stored in it.
- Parameters
-
zipfile name of zip file callback callback for each file. params: - ud: user data
- offset: offset in the zip file
- method: compression method (Compression methods)
- csize: compressed size
- ucsize: uncompressed size
- attributes: file attributes
ud user data
- Returns
- Compression error codes
◆ process_zip_linput()
idaman THREAD_SAFE int ida_export process_zip_linput | ( | linput_t * | li, |
int(idaapi *)(void *ud, qoff64_t offset, int method, uint64 csize, uint64 ucsize, uint32 attributes, const char *filename) | callback, | ||
void * | ud = nullptr |
||
) |
Process zip file and enumerate all files stored in it.
- Parameters
-
li input file callback callback for each file. params: - ud: user data
- offset: offset in the zip file
- method: compression method (Compression methods)
- csize: compressed size
- ucsize: uncompressed size
- attributes: file attributes
ud user data
- Returns
- Compression error codes
◆ process_zipfile_entry()
idaman THREAD_SAFE int ida_export process_zipfile_entry | ( | const char * | zipfile, |
const char * | entry, | ||
int(idaapi *)(void *ud, qoff64_t offset, int method, uint64 csize, uint64 ucsize, uint32 attributes, const char *filename) | callback, | ||
void * | ud = nullptr , |
||
bool | case_sensitive = true |
||
) |
Search for specified entry in zip file, and calls the callback with it, if found.
- Parameters
-
zipfile name of zip file entry entry in zip file. E.g., "path/to/entry.dat" callback callback for each file. params: - ud: user data
- offset: offset in the zip file
- method: compression method (Compression methods)
- csize: compressed size
- ucsize: uncompressed size
- attributes: file attributes
ud user data case_sensitive should the search be case sensitive?
- Returns
- Compression error codes
◆ create_zip_linput()
idaman THREAD_SAFE linput_t *ida_export create_zip_linput | ( | linput_t * | in, |
ssize_t | insize = -1 , |
||
linput_close_code_t | loc = LOC_CLOSE |
||
) |
Create a linput to read a compressed input stream.
- Parameters
-
in linput with compressed data, seeked to the stream beginning insize size of compressed data. -1 - unknown loc what to do upon closing the resulting linput
- Returns
- linput that can be used to read uncompressed data. nullptr if any error (no more linput descriptors).
Generated by