Code: Select all
get NAME_SIZE long
GetDString F_NAME NAME_SIZE
goto 0x58
get OFFSET long
get TEX_SIZE long
goto 0x92
get TEX_ARCHIVE_NAME line
string TEXTURE p= "%s.tex.DDS" F_NAME
string TEX_ARCHIVE p= "%s." TEX_ARCHIVE_NAME
log MEMORY_FILE1 0 0
log MEMORY_FILE2 0 0
open FDSE TEXTURE 1
open FDSE TEX_ARCHIVE 2
get TEX_ARCHIVE_SIZE ASIZE 2
log MEMORY_FILE1 0 TEX_ARCHIVE_SIZE 2
log MEMORY_FILE2 0x80 TEX_SIZE 1
append 1
log MEMORY_FILE1 OFFSET TEX_SIZE MEMORY_FILE2
append
get SIZE ASIZE MEMORY_FILE1
log test.dat 0 SIZE MEMORY_FILE1
I'm having a problem with log MEMORY_FILE1 OFFSET TEX_SIZE MEMORY_FILE2
the MEMORY_FILE2 should contain the DDS texture without the header and I'm trying to inject it to MEMORY_FILE1 on a specific offset from the data gathered from open FDSE TEX_ARCHIVE 2
I don't know if it's possible since if I change the OFFSET to 0 it can inject it at the beginning or end depending on the direction of the append but not on a specific offset.
I may be approaching it wrong. I'm still a noob at this and any assistance is appreaciated.