Important information: this site is currently scheduled to go offline indefinitely by end of the year.

(Request) King Of Fighters Maximum Impact model rip

Post questions about game models here, or help out others!
User avatar
sidneymadmax
beginner
Posts: 35
Joined: Fri Sep 17, 2010 4:10 pm

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

Post by sidneymadmax »

Image
Image
:ninja:
alon
mega-veteran
mega-veteran
Posts: 163
Joined: Mon Nov 29, 2010 10:38 am
Has thanked: 32 times
Been thanked: 2 times

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

Post 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
User avatar
Rimbros
ultra-veteran
ultra-veteran
Posts: 495
Joined: Fri Jul 09, 2010 12:23 am
Has thanked: 41 times
Been thanked: 16 times

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

Post 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.
Renders Art by Rimbros
http://s303.photobucket.com/albums/nn12 ... E/Renders/

Personal Game repository samples, send PM
oamio
veteran
Posts: 98
Joined: Sun Mar 06, 2011 2:52 pm
Has thanked: 20 times
Been thanked: 9 times

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

Post 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?
chrrox
Moderator
Posts: 2602
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1422 times

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

Post by chrrox »

Its just a function just add it to any script.
deant
n00b
Posts: 13
Joined: Mon Jul 15, 2013 11:11 am
Has thanked: 1 time

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

Post by deant »

Any info on this? How can one extract the *dff.pak files?
Post Reply