Solution:
Code: Select all
get FILE_SIZE asize
log "my_file.bin" OFFSET SIZE
1- use 64bit version of c functions
2- if my_file.bin size is bigger than SIZE, set file size to INCREASE_SIZE
Code: Select all
xmath INCREASE_SIZE = (FILE_SIZE + (my_file.bin_size - SIZE))
and overwrite my_file.bin from OFFSET location
3- if my_file.bin size is smaller than SIZE, set file size to DECREASE_SIZE
Code: Select all
xmath DECREASE_SIZE = (FILE_SIZE - (SIZE - my_file.bin_size))
and overwrite my_file.bin from OFFSET location
but must moving forward or backward bytes of file and then doing overwrite
for compression, must create temp files in input file directory and overwrite it (if its not possible, then just do this for normal log and return error for clog)
but i think current way of QuickBMS is wrong to load data in memory