ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Mon Nov 12, 2018 10:01 pm

All times are UTC




Post new topic  Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Help with script
PostPosted: Tue Nov 06, 2018 4:47 pm 

Joined: Sun Feb 01, 2015 5:31 pm
Posts: 55
Hi,

We have a small problem with some entries that have a different pattern than the script that swuforce created for us.

We need to change some entries like "Huev" (pos 1025358 and 102D83B) or "Puert" (pos 101B7B0) in the file 00000a43.dat

In principle, the structure is an xml where the second entry is extracted, these examples are the words "Vela" and "Pan"

Code:
<T209 T12="Id: 66400 - ch4-kerze-|02|-043" T13="66400" T14="282" T55="-1">
         <T761>
            <T26 T209="Kerze" T7="" T27="0"/>
            ------> <T26 T209="Vela" T7="" T27="1"/>
            <T26 T209="Свеча" T7="" T27="5"/>
            <T26 T209="Åšwieca" T7="" T27="6"/>
            <T26 T209="Candela" T7="" T27="3"/>
            <T26 T209="bougie" T7="" T27="2"/>
         </T761>
      </T209>
      <T209 T12="Id: 66401 - ch4-brot-|02|-044" T13="66401" T14="282" T55="-1">
         <T761>
            <T26 T209="Brot" T7="" T27="0"/>
            ------><T26 T209="Pan" T7="" T27="1"/>
            <T26 T209="Хлеб" T7="" T27="5"/>
            <T26 T209="Chleb" T7="" T27="6"/>
            <T26 T209="Pane" T7="" T27="3"/>
            <T26 T209="pain" T7="" T27="2"/>
         </T761>
      </T209>



The problem is that for the words "Puert" and "Huev" are placed in the fourth entry.

Code:
<T209 T12="Id: 66397 - 4008 - Haus von Bozos Freundin: e-|02|-to_ins_boot" T13="66397" T14="65553" T55="-1">
         <T761>
            <T26 T209="Tür" T7="" T27="0"/>
            <T26 T209="Door" T7="" T27="3"/>
            <T26 T209="porte" T7="" T27="2"/>
            ------>  <T26 T209="Puert" T7="" T27="1"/>
            <T26 T209="Дверь" T7="" T27="5"/>
            <T26 T209="Drzwi" T7="" T27="6"/>
            <T26 T209=" " T7="" T27="7"/>
         </T761>
      </T209>
      <T209 T12="Id: 112918 - 4012 - Bellevue: obj-08-|02|-garten-minigame_stinkt" T13="112918" T14="30108" T55="-1">
         <T761>
            <T26 T209="Ei" T7="" T27="0"/>
            <T26 T209="Egg" T7="" T27="3"/>
            <T26 T209="Å“uf" T7="" T27="2"/>
            ------>  <T26 T209="Huev" T7="" T27="1"/>
            <T26 T209="Яйцо" T7="" T27="5"/>
            <T26 T209="Jajo" T7="" T27="6"/>
         </T761>
      </T209>


These are the script created by swuforce .

Export
Code:
goto 8
get name basename
string name += .dat
get size long
get zsize long
clog name 16 zsize size
open FDSE name
log MEMORY_FILE 0 0
get name basename
string name += .txt
for
findloc offset string "\x00\x00\x00\x00\x02\x00\x00\x00x06" 0 ""
if offset == ""
get size asize MEMORY_FILE
log name 0 size MEMORY_FILE
cleanexit
endif
math offset -= 4
goto offset
get null long
if null = 0
getdstring d 8
else
getdstring d 8
get size long
savepos pos
get check byte
get check2 byte
get check3 byte
get check4 byte
if check = 0x00 ||  check = 0xff || check2 = 0x00 || check2 = 0xff
elseif check3 != 0x00 &&  check3 != 0xff && check4 != 0x00 && check4 != 0xff
goto pos
getdstring string 5
if string != "data/"
goto pos
getdstring string size
get size long
getdstring string size
get lang long
if lang = 0
get size long
if size != 0
getdstring string size
putdstring string size MEMORY_FILE
put 0x0a0d short MEMORY_FILE
get null byte
endif
endif
endif
endif
endif
next


Import
Code:
log MEMORY_FILE3 0 8
get name basename
get name2 filename
string name += .dat
open FDSE name
get name basename
string name += .txt
open FDSE name 1
log MEMORY_FILE 0 0
get asize asize
set offset1 0
for
findloc offset2 string "\xff\xff\xff\xff\x06\x00\x00\x00" 0 ""
if offset2 == ""
xmath dsize "asize - offset1"
append
log MEMORY_FILE offset1 dsize
append
get size asize MEMORY_FILE
comtype zlib_compress
clog MEMORY_FILE2 0 size size MEMORY_FILE
get zsize asize MEMORY_FILE2
goto 8 MEMORY_FILE3
put size long MEMORY_FILE3
put zsize long MEMORY_FILE3
append
log MEMORY_FILE3 0 zsize MEMORY_FILE2
append
get size asize MEMORY_FILE3
log name2 0 size MEMORY_FILE3
cleanexit
endif
math offset2 -= 4
goto offset2
get null long
if null = 0
getdstring d 8
else
getdstring d 8
get size long
savepos pos
get check byte
get check2 byte
get check3 byte
get check4 byte
if check = 0x00 ||  check = 0xff || check2 = 0x00 || check2 = 0xff
elseif check3 != 0x00 &&  check3 != 0xff && check4 != 0x00 && check4 != 0xff
goto pos
getdstring string 5
if string != "data/"
goto pos
getdstring string size
get size long
getdstring string size
get lang long
if lang = 0
savepos offset2
get size long
if size != 0
xmath dsize "offset2 - offset1"
append
log MEMORY_FILE offset1 dsize
append
get msize asize MEMORY_FILE
goto msize MEMORY_FILE
getdstring string size
savepos offset1
getct string string 0x00 1
get ad short 1
strlen len string
math len += 1
put len long MEMORY_FILE
putdstring string len MEMORY_FILE
endif
endif
endif
endif
endif
next


I have tried to modify the script many times and I can not make it work.

Maybe another way to modify these two entries, is to directly access their position and edit them, but I've tried and I have not known how to create a valid script.

Could you please help?

https://mega.nz/#!hBhDCQZZ!yfsXXlCzrZDe ... hufCTNz3H0

Greetings and thanks.


Top
   
 Post subject: Re: Help with script
PostPosted: Fri Nov 09, 2018 3:39 pm 

Joined: Sun Feb 01, 2015 5:31 pm
Posts: 55
Hi,

It is possible that it works by accessing the string position directly, but we would not know how to do it either.

Can you help us with this?

Greetings and thanks.


Top
   
 Post subject: Re: Help with script
PostPosted: Fri Nov 09, 2018 7:30 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 9213
Have you tried contacting swuforce?
I don't know if he will see this topic.


Top
   
 Post subject: Re: Help with script
PostPosted: Fri Nov 09, 2018 9:51 pm 

Joined: Sun Feb 01, 2015 5:31 pm
Posts: 55
Hi,

Yes of course, I tried to contact swuforce, but I have not gotten any response, it has been a while since he published anything in the forum, I think he will be very busy now.
It's a shame that having the translation almost finished, and not being able to solve that "little" problem, that's why I ask for help in the forum.

Aluigi, Can you modify the script to edit those entries?

Greetings.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 4 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