Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

Log to specific offset of a MEMORY_FILE?

Featured Replies

  • Author
  • Localization

happydance, posted Sat Mar 27, 2021 12:09 pm (63085)


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.
  • Author
  • Localization

aluigi, posted Fri Apr 02, 2021 3:29 pm (63181)


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
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.