ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Wed Apr 21, 2021 7:32 am

All times are UTC




Post new topic  Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Sat Mar 27, 2021 12:09 pm 

Joined: Sun Jul 10, 2016 11:07 am
Posts: 78
Code:
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.


Top
   
PostPosted: Fri Apr 02, 2021 3:29 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 12098
From what I can see from the script:
- get OFFSET and TEX_SIZE from the file
- copy TEX_SIZE data from offset 0x80 from the other file to memory
- copy TEX_SIZE data from offset OFFSET from the memory

I guess there is something wrong because memory has a size of TEX_SIZE so the only valid OFFSET is zero, any other number means that the memory file has a size of OFFSET+TEX_SIZE which is impossible.

If you want to copy data to a specific offset using "append 1" you just need to use Goto, for example:
Code:
log MEMORY_FILE 0 TEX_ARCHIVE_SIZE
goto OFFSET MEMORY_FILE
append 1
log MEMORY_FILE1 0 TEX_SIZE MEMORY_FILE2
append 1


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 2 posts ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited