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

Street Fighter IV .EMB .EMZ

The Original Forum. Game archives, full of resources. How to open them? Get help here.
Darkfox
VVIP member
VVIP member
Posts: 688
Joined: Fri Jul 04, 2003 6:11 pm
Has thanked: 33 times
Been thanked: 16 times

Re: Street Fighter IV .EMB .EMZ

Post by Darkfox »

Hm, I would be very interested in an emb editor. Am I to understand that this may actually come to be?

I look forward to the day that I don't have to hex-edit in a few things that aren't textures. Added, I haven't figured out editing voices and move sets.
User avatar
LouNGeR
beginner
Posts: 31
Joined: Sun Jul 05, 2009 11:58 pm
Has thanked: 1 time
Been thanked: 2 times

Re: Street Fighter IV .EMB .EMZ

Post by LouNGeR »

Yes there will be an EMB editor, without a doubt.
EMB's are very plain files, I might create an editor myself :P

So, what we want is a combination of HyperRipper (modified to recognize tags in SF4 files) and Infuser...
Itze
veteran
Posts: 81
Joined: Sat Mar 15, 2008 4:43 pm
Has thanked: 2 times
Been thanked: 6 times

Re: Street Fighter IV .EMB .EMZ

Post by Itze »

should that be a wink in my direction?

tell me how i should split the files and i'll try to code it... integrating infusion is no problem since its only made up of one simple function :P
User avatar
LouNGeR
beginner
Posts: 31
Joined: Sun Jul 05, 2009 11:58 pm
Has thanked: 1 time
Been thanked: 2 times

Re: Street Fighter IV .EMB .EMZ

Post by LouNGeR »

Itze wrote:should that be a wink in my direction?

tell me how i should split the files and i'll try to code it... integrating infusion is no problem since its only made up of one simple function :P
haha, yes, a little :D

You know the EMB format, no?

EMB header, then every file is jus pasted after it with it's own header like #EMB, #EMG, #BSR, there are some more there....
The EMB foot just contains the filenames, although these doesn't always seem correct in relation to the EMB contents.

I'm not an expert programmer or anything, so don't expect ground-breaking C++ or Assembler tools from me :mrgreen:
Itze
veteran
Posts: 81
Joined: Sat Mar 15, 2008 4:43 pm
Has thanked: 2 times
Been thanked: 6 times

Re: Street Fighter IV .EMB .EMZ

Post by Itze »

well you mentioned something about a checksum?

also i don't really know how the emb is build up... i just know enough to unpack and extract/inject files from/to it ;)

does it contain a header with the amount of sections / files?
how does the footer work?
etc. i dunno... maybe Mr.Mouse or chrrox can help :X
User avatar
LouNGeR
beginner
Posts: 31
Joined: Sun Jul 05, 2009 11:58 pm
Has thanked: 1 time
Been thanked: 2 times

Re: Street Fighter IV .EMB .EMZ

Post by LouNGeR »

No the checksum thing was about EMZ.
Endragor
ultra-n00b
Posts: 9
Joined: Thu Jul 09, 2009 8:38 am
Has thanked: 1 time
Been thanked: 3 times

Re: Street Fighter IV .EMB .EMZ

Post by Endragor »

Itze wrote:does it contain a header with the amount of sections / files?
how does the footer work?
Here is my quickbms-script for extracting the EMBs:

Code: Select all

#Street Fighter 4 EMB Extractor.
idstring "#EMB"
get UNK1 long
get UNK2 long
get FILES long
set FILENAME long FILES
math FILENAME *= 8
math FILENAME += 0x20
goto 0x20
get OFFSET long
math OFFSET += 0x20
get SIZE long
savepos NEXTFILE
set SIZECHECK long SIZE
math SIZECHECK += OFFSET
goto SIZECHECK
Do
get CHK byte
math SIZE += 0x1
While CHK == 0x00
math SIZE -= 0x1
goto FILENAME
get NAMEPOS long
savepos FILENAME
goto NAMEPOS
getdstring k 0x1
set NAME string k
Do
savepos CHECK
getdstring k 0x1
goto CHECK
get HM byte 
string NAME += k
While HM != 0x0
log NAME OFFSET SIZE
for i = 1 < FILES
goto NEXTFILE
math OFFSET += SIZE
get UNK long
get SIZE long
savepos NEXTFILE
set SIZECHECK long SIZE
math SIZECHECK += OFFSET
goto SIZECHECK
Do
get CHK byte
math SIZE += 0x01
While CHK == 0x00
math SIZE -= 0x1
goto FILENAME
get NAMEPOS long
savepos FILENAME
goto NAMEPOS
getdstring k 0x1
set NAME string k
Do
savepos CHECK
getdstring k 0x1
goto CHECK
get HM byte
string NAME += k
While HM != 0x0
log NAME OFFSET SIZE
next i
Well, maybe it's a bit long but works for any emb (that contains filename info inside and begins with "#EMB") with any file-format inside saving filename of any length :)
Combining this script and chrrox's one you can extract almost any resource from Street Fighter 4.
But still... It would be great if someone would make a tool for packing files back into emz-format based on LouNGeR's PHP-program.

EDIT:
I've found some EMBs without filenames in the foot that contain DDS inside. Are there any EMBs that contain some other formats (not DDS) inside and have no filename info in the foot at the same time? Give some examples please (i need just paths, not files themselves).
I'll update my script when I find out.
Darkfox
VVIP member
VVIP member
Posts: 688
Joined: Fri Jul 04, 2003 6:11 pm
Has thanked: 33 times
Been thanked: 16 times

Re: Street Fighter IV .EMB .EMZ

Post by Darkfox »

Well, the decompressed EMB file can be loaded by SF4 by changing the extension to EMZ right? What are the advantages of re compressing back to EMZ? Just curious is all.
Endragor
ultra-n00b
Posts: 9
Joined: Thu Jul 09, 2009 8:38 am
Has thanked: 1 time
Been thanked: 3 times

Re: Street Fighter IV .EMB .EMZ

Post by Endragor »

Darkfox wrote:Well, the decompressed EMB file can be loaded by SF4 by changing the extension to EMZ right? What are the advantages of re compressing back to EMZ? Just curious is all.
The advantage is file size. My translation is 500 MB now without compression. That is not OK.
EDIT:
Besides, there are some EMBs with the EMZs inside. So in this case we need first to pack EMZs and then to put them into EMB.
Darkfox
VVIP member
VVIP member
Posts: 688
Joined: Fri Jul 04, 2003 6:11 pm
Has thanked: 33 times
Been thanked: 16 times

Re: Street Fighter IV .EMB .EMZ

Post by Darkfox »

Hm, this is true, and the game is pretty darn big too. Around 4.30GBs?

Just imagine all that data decompressed... alright, point taken.
User avatar
LouNGeR
beginner
Posts: 31
Joined: Sun Jul 05, 2009 11:58 pm
Has thanked: 1 time
Been thanked: 2 times

Re: Street Fighter IV .EMB .EMZ

Post by LouNGeR »

@Endragor
Awesome!! I hope it works as expected!
Will try it right away!

This means doing everything without a gui from now on....

BTW, is it easy to reverse the process (combine files to EMB) without having to look at the initial EMB ?

EDIT
At first, it works great.
Unpacking "CNL_01.cos.emb" gives me 4 files.
1 EMB: CNL_01.nml.emb
This EMB does not have file names in it, but does contain DDS files.

Also: is it possible to make your script Infuser compatible? (or is there another way to smash the EMB back together?)

EDIT
Trying STG_RVR.emb....

Code: Select all

  offset   filesize   filename
------------------------------
.....
.....
  000031c0 0          RVR_CUBE.emb
  000031c0 524672     RVR_CUBE.emb
- the file "RVR_CUBE.emb" already exists
  do you want to overwrite it (y/N/all)?
Endragor
ultra-n00b
Posts: 9
Joined: Thu Jul 09, 2009 8:38 am
Has thanked: 1 time
Been thanked: 3 times

Re: Street Fighter IV .EMB .EMZ

Post by Endragor »

So here is updated version of the script:

Code: Select all

#Street Fighter 4 EMB Extractor.
idstring "#EMB"
get UNK1 long
get UNK2 long
get FILES long
set FILENAME long FILES
math FILENAME *= 8
math FILENAME += 0x20
goto 0x20
get OFFSET long
math OFFSET += 0x20
get SIZE long
savepos NEXTFILE
set NEXTOFF long SIZE
math NEXTOFF += OFFSET
goto NEXTOFF
Do
get CHK byte
math NEXTOFF += 0x1
While CHK == 0x00
math NEXTOFF -= 0x01
goto FILENAME
getdstring CHKEX 0x01
If CHKEX == D
set NAME string DDS0.dds
set EXNAME byte 0x00
else
set EXNAME byte 0x01
goto FILENAME
get NAMEPOS long
savepos FILENAME
goto NAMEPOS
getdstring k 0x1
goto NAMEPOS
get HM byte
set NAME string k
If HM != 0x0
Do
savepos CHECK
getdstring k 0x1
goto CHECK
get HM byte
string NAME += k
While HM != 0x0
endif
endif
log NAME OFFSET SIZE
math FILES -= 0x01
for i = 1 to FILES
goto NEXTFILE
set OFFSET long NEXTOFF
get UNK long
get SIZE long
savepos NEXTFILE
If i != FILES
set NEXTOFF long SIZE
math NEXTOFF += OFFSET
goto NEXTOFF
Do
get CHK byte
math NEXTOFF += 0x1
While CHK == 0x00
math NEXTOFF -= 0x01
endif
If EXNAME != 0x00
goto FILENAME
get NAMEPOS long
savepos FILENAME
goto NAMEPOS
getdstring k 0x1
goto NAMEPOS
get HM byte
set NAME string k
If HM != 0x0
Do
savepos CHECK
getdstring k 0x1
goto CHECK
get HM byte
string NAME += k
While HM != 0x0
endif
else
set NAME string DDS
string NAME += i
string NAME += .dds
endif
log NAME OFFSET SIZE
next i
Changelog:
1. Now it can extract DDSes from EMBs that don't have filename info (it just simply gives them names like DDS0.dds, DDS1.dds, etc.).
2. It doesn't save unnecessary nulls in files's endings.
3. Some other little mistakes are corrected.
4. Empty files will be now extracted properly.
LouNGeR wrote:Also: is it possible to make your script Infuser compatible? (or is there another way to smash the EMB back together?)
Well, If Itze would replace '#' symbol in infuser identifier with some other i would try, but now i can't because that symbol used in quickbms as comment-beginning mark so i can't put it into string variable.
LouNGeR wrote:Trying STG_RVR.emb....
I have no idea why it happens so yet. But I'll try to figure out. And anyway the previous file was 0 bytes in size so you'll lose nothing overwriting it.
For now countinue testing the script on different EMBs :)

EDIT:
The problem solved. The script updated.
User avatar
plodtrew
mega-veteran
mega-veteran
Posts: 177
Joined: Wed Jul 18, 2007 7:14 am
Has thanked: 13 times
Been thanked: 6 times
Contact:

Re: Street Fighter IV .EMB .EMZ

Post by plodtrew »

Darkfox wrote:Well, the decompressed EMB file can be loaded by SF4 by changing the extension to EMZ right? What are the advantages of re compressing back to EMZ? Just curious is all.
The xbox 360 version needs to have emz files with exactly the same filesize as the originals to be injected. Compressing back into emz would may it possible to mod the xbox version also.
Darkfox
VVIP member
VVIP member
Posts: 688
Joined: Fri Jul 04, 2003 6:11 pm
Has thanked: 33 times
Been thanked: 16 times

Re: Street Fighter IV .EMB .EMZ

Post by Darkfox »

Ah, true... though wouldn't modding the XBox version require burning a new DVD for each modification?
User avatar
plodtrew
mega-veteran
mega-veteran
Posts: 177
Joined: Wed Jul 18, 2007 7:14 am
Has thanked: 13 times
Been thanked: 6 times
Contact:

Re: Street Fighter IV .EMB .EMZ

Post by plodtrew »

Darkfox wrote:Ah, true... though wouldn't modding the XBox version require burning a new DVD for each modification?
Unfortunately yes. Although rewritables may be an option.
Post Reply