Page 2 of 2

Re: (Request) King Of Fighters Maximum Impact model rip

Posted: Thu Sep 22, 2011 10:00 pm
by sidneymadmax
Image
Image
:ninja:

Re: (Request) King Of Fighters Maximum Impact model rip

Posted: Thu Sep 22, 2011 10:37 pm
by alon
It's KOF decompress code by Fatduck.
http://gameresearch.5d6d.com/thread-147-1-2.html
I don't know how to use this code.

Code: Select all

 fn int2bin val = (
  local ary = #()
  if val <-1 then val += 256    --convert signed byte to unsigned byte
  if val >= 128 then (append ary 1 ;val-=128) else append ary 0
  if val >= 64 then (append ary 1 ;val-=64) else append ary 0
  if val >= 32 then (append ary 1 ;val-=32) else append ary 0
  if val >= 16 then (append ary 1 ;val-=16) else append ary 0
  if val >= 8 then (append ary 1 ;val-=8) else append ary 0
  if val >= 4 then (append ary 1 ;val-=4) else append ary 0
  if val >= 2 then (append ary 1 ;val-=2) else append ary 0
  if val == 1 then (append ary 1) else append ary 0
  return ary
 )--end fn int2bin
 
 fn KOFdecompress fstream Usize = (
 
  debugmode=false
  clearlistener()
  
  local ctrlBits = #()
  local Ubuffer = #()
  
  do (
   join ctrlBits ( int2bin ( readbyte fstream #unsigned ) )
   if debugmode==true then (
    format "In: "
    for j in ctrlBits do format "%" j
    format "\n"
   )--end debugmode
   do (
    if ctrlBits[1] == 1 then (
     append Ubuffer (readbyte fstream #unsigned)
     deleteitem ctrlBits 1
    ) else (
     local len = 0
     local ofs = 0
     if ctrlBits[2] == 0 then (
      len = ctrlBits[3]*2 + ctrlBits[4] + 2
      ofs = (readbyte fstream #unsigned) - 256
      if debugmode==true then format "ofs: %\tlen: %\n" ofs len
      deleteitem ctrlBits 1; deleteitem ctrlBits 1
      deleteitem ctrlBits 1; deleteitem ctrlBits 1
     ) else (
      ctrlH  = readbyte fstream #unsigned
      ctrlL  = readbyte fstream #unsigned
      if debugmode==true then format "H: %\tL: % @ [%]\n" (dec2hex ctrlH) (dec2hex ctrlL) (dec2hex (ftell fstream))
      len = (mod ctrlL 32)
      if len == 0 then len = 1 + (readbyte fstream #unsigned)
      else len += 2
      --ofs = ((mod ctrlH 32)*8+(ctrlL/32))*256 + 0xF8 + (ctrlH/32)
      --if ofs > 0x7FFF then ofs = ofs - 65536
      
      --** KOF method--
	  ofs = ((mod ctrlH 32)*8+(ctrlL/32)) + (0xF8 + (ctrlH/32))*256 - 65536


      if debugmode==true then format "Bofs: %\tBlen: %\n" ofs len

      deleteitem ctrlBits 1; deleteitem ctrlBits 1
     )
          
      --copy stuff here
      loc = ofs + Ubuffer.count
      if abs(ofs) >= len then (
       for j = 1 to len do append Ubuffer (Ubuffer[(loc+j)])  
      ) else (
       for j = 1 to len/(abs(ofs)) do 
          for jj = 1 to abs(ofs) do append Ubuffer (Ubuffer[(loc+jj)])
       for j = 1 to (mod len (abs(ofs))) do append Ubuffer (Ubuffer[(loc+j)])
      )--end if/else
	  

       --for j in Ubuffer do format "%  " (dec2hex j)
       --format "\n"

    )--end if/else
    if Ubuffer.count >= Usize then exit
    if (ctrlBits.count == 0) then exit
    if (ctrlBits.count==1)AND(ctrlBits[1]==0) then exit
    if (ctrlBits.count <= 3)AND(ctrlBits[1]==0)AND(ctrlBits[2]==0) then exit 
   ) while 1==1
   if debugmode==true then (
    format "Out: "
    for j in ctrlBits do format "%" j
    format "\n"
       --for j in Ubuffer do format "%  " (dec2hex j)
       --format "\n"
    format "\t[%]\nUbuffer: %\n\n" (dec2hex (ftell fstream)) (dec2hex Ubuffer.count)
   )--end debugmode
 
  ) while Ubuffer.count < Usize 

  format "->%\n" Ubuffer.count
  
  return Ubuffer
 )--end fn KOFdecompress

Re: (Request) King Of Fighters Maximum Impact model rip

Posted: Thu Sep 22, 2011 11:22 pm
by Rimbros
Well, here files extracted from the game to test the code writted by fatduck.
All have .pak format.

http://www.megaupload.com/?d=VR3UQ459

Also .ms (MaxScript) Writed by fatduck (doesnt work in Max 9).

http://gameresearch.5d6d.com/attachment ... 0192&fid=7

If anyone can fix this MS script can be fine.

Re: (Request) King Of Fighters Maximum Impact model rip

Posted: Tue Nov 12, 2013 3:17 am
by oamio

Code: Select all

 fn int2bin val = (
  local ary = #()
  if val <-1 then val += 256    --convert signed byte to unsigned byte
  if val >= 128 then (append ary 1 ;val-=128) else append ary 0
  if val >= 64 then (append ary 1 ;val-=64) else append ary 0
  if val >= 32 then (append ary 1 ;val-=32) else append ary 0
  if val >= 16 then (append ary 1 ;val-=16) else append ary 0
  if val >= 8 then (append ary 1 ;val-=8) else append ary 0
  if val >= 4 then (append ary 1 ;val-=4) else append ary 0
  if val >= 2 then (append ary 1 ;val-=2) else append ary 0
  if val == 1 then (append ary 1) else append ary 0
  return ary
 )--end fn int2bin
 
 fn KOFdecompress fstream Usize = (
 
  debugmode=false
  clearlistener()
  
  local ctrlBits = #()
  local Ubuffer = #()
  
  do (
   join ctrlBits ( int2bin ( readbyte fstream #unsigned ) )
   if debugmode==true then (
    format "In: "
    for j in ctrlBits do format "%" j
    format "\n"
   )--end debugmode
   do (
    if ctrlBits[1] == 1 then (
     append Ubuffer (readbyte fstream #unsigned)
     deleteitem ctrlBits 1
    ) else (
     local len = 0
     local ofs = 0
     if ctrlBits[2] == 0 then (
      len = ctrlBits[3]*2 + ctrlBits[4] + 2
      ofs = (readbyte fstream #unsigned) - 256
      if debugmode==true then format "ofs: %\tlen: %\n" ofs len
      deleteitem ctrlBits 1; deleteitem ctrlBits 1
      deleteitem ctrlBits 1; deleteitem ctrlBits 1
     ) else (
      ctrlH  = readbyte fstream #unsigned
      ctrlL  = readbyte fstream #unsigned
      if debugmode==true then format "H: %\tL: % @ [%]\n" (dec2hex ctrlH) (dec2hex ctrlL) (dec2hex (ftell fstream))
      len = (mod ctrlL 32)
      if len == 0 then len = 1 + (readbyte fstream #unsigned)
      else len += 2
      --ofs = ((mod ctrlH 32)*8+(ctrlL/32))*256 + 0xF8 + (ctrlH/32)
      --if ofs > 0x7FFF then ofs = ofs - 65536
      
      --** KOF method--
	  ofs = ((mod ctrlH 32)*8+(ctrlL/32)) + (0xF8 + (ctrlH/32))*256 - 65536


      if debugmode==true then format "Bofs: %\tBlen: %\n" ofs len

      deleteitem ctrlBits 1; deleteitem ctrlBits 1
     )
          
      --copy stuff here
      loc = ofs + Ubuffer.count
      if abs(ofs) >= len then (
       for j = 1 to len do append Ubuffer (Ubuffer[(loc+j)])  
      ) else (
       for j = 1 to len/(abs(ofs)) do 
          for jj = 1 to abs(ofs) do append Ubuffer (Ubuffer[(loc+jj)])
       for j = 1 to (mod len (abs(ofs))) do append Ubuffer (Ubuffer[(loc+j)])
      )--end if/else
	  

       --for j in Ubuffer do format "%  " (dec2hex j)
       --format "\n"

    )--end if/else
    if Ubuffer.count >= Usize then exit
    if (ctrlBits.count == 0) then exit
    if (ctrlBits.count==1)AND(ctrlBits[1]==0) then exit
    if (ctrlBits.count <= 3)AND(ctrlBits[1]==0)AND(ctrlBits[2]==0) then exit 
   ) while 1==1
   if debugmode==true then (
    format "Out: "
    for j in ctrlBits do format "%" j
    format "\n"
       --for j in Ubuffer do format "%  " (dec2hex j)
       --format "\n"
    format "\t[%]\nUbuffer: %\n\n" (dec2hex (ftell fstream)) (dec2hex Ubuffer.count)
   )--end debugmode
 
  ) while Ubuffer.count < Usize 

  format "->%\n" Ubuffer.count
  
  return Ubuffer
 )--end fn KOFdecompress
Is written by fatduk
Who are able to use to fix it?

Re: (Request) King Of Fighters Maximum Impact model rip

Posted: Tue Nov 12, 2013 3:30 am
by chrrox
Its just a function just add it to any script.

Re: (Request) King Of Fighters Maximum Impact model rip

Posted: Fri Mar 28, 2014 7:50 am
by deant
Any info on this? How can one extract the *dff.pak files?