XeNTaX Forum Index
Forum MultiEx Commander Tools Tools Home
It is currently Mon Oct 23, 2017 10:02 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: help with getdstring
PostPosted: Fri Jul 08, 2016 11:24 am 
Offline
beginner

Joined: Thu Apr 17, 2014 3:11 pm
Posts: 24
Has thanked: 1 time
Have thanks: 2 times














You can make the ads go away by registering

still learning and run into a problem using getdstring to get the name of the files

here's the script I made
Code:
endian big
get PACKhead1 long
get FILENUM long
get UNK1 long
get PACKhead3 long
get UNK2 long
get startfo long
xMath sizeoff "FILENUM * 4 + 20"
xMath nameoff "FILENUM * 4 + 40"
set filetbloff 0x14
set sizetbloff sizeoff
set nametbloff nameoff
for i = 0 < FILENUM
   goto filetbloff
   get OFFSET long
   savepos filetbloff
   goto sizetbloff
   get SIZE long
   savepos sizetbloff
   goto nametbloff
   get NAMEPOS long
   savepos nametbloff
   goto NAMEPOS
   get NAMESZ byte
   getdstring NAME NAMESZ
   log "NAME" offset size
next i


the file have 5 files but only can extract 4 since it encountered this problem


Code:
- open input file F:\Script ng natsuiro\PACK1.001
- open script test3.bms
- set output folder TEST

  offset   filesize   filename
--------------------------------------
  00000050 1744       ui_base.tmd2
  00000730 2392       ui_main_win.tmd2
  000010b0 1376       ui_select_line.tmd2
  00001630 2376       ui_sub_win.tmd2

Error: incomplete input file 0: F:\Script ng natsuiro\PACK1.001
       Can't read 101 bytes from offset 00002800.
       Anyway don't worry, it's possible that the BMS script has been written
       to exit in this way if it's reached the end of the archive so check it
       or contact its author or verify that all the files have been extracted.
       Please check the following coverage information to know if it's ok.

  coverage file 0    82%   8456       10240

Last script line before the error or that produced the error:
  25  getdstring NAME NAMESZ


because the name 5th file is on the end of the big file and it doesn't meet the byte length on the "get NAMESZ byte" and now only 0xf long


Attachments:


You do not have the required permissions to view the files attached to this post. Register to gain access.



Top
 Profile  
 
 Post subject: Re: help with getdstring
PostPosted: Tue Aug 02, 2016 12:09 am 
Offline
ultra-veteran
ultra-veteran

Joined: Fri Nov 06, 2009 12:13 am
Posts: 588
Has thanked: 66 times
Have thanks: 126 times
is it possible that
Code:
get NAMESZ byte
is actually the wrong value? it could just be a null-terminated string at the position you have.

other filenames work because quickbms treats the string as a c-string anyway.. so any larger filenames are accepted, but trimmed to the first 00 byte.

something like

Code:
get DUMMY byte # was get NAMESZ byte
get NAME string

_________________
Useful tool links:


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

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


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:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group