xeBuild 1.00
============


Introduction:
=============
    After a lot of work, xeBuild brings together ggbuild and fbbuild into
    a single application for building glitch, jtag and clean retail images.


What's New:
===========
    - builds jtag/glitch/retail images
    - image type specifyer changed, specify -t on command line
    - all ini options are now available on the command line (no spaces allowed!)
	- patch append option, -o <patchname> via command line, see NOMU/NOFCRT below
		or about_patches.S for further info. Up to 16 files can be specified.
    - NOMU and NOFCRT patches are provided as optional patches, please use the
        -a flag on the command line (ie: -a nomu and/or -a nofcrt) if you want
        to use them, nomu disables jasper NAND memory unit, nofcrt will attempt
		to disable FCRT file (not needed if yours isn't corrupt)
	- nonandmu has been changed to nandmu so it's behavior is inverted
    - virtual fuses is no longer being pursued for glitch images as correct
        cpu key is already required to build working trinity images. They remain
		for JTAG images.


Current Limitations:
====================
    - STAY THE HELL OFF LIVE! Nuff said, we're not you're mum.


How To Use:
===========
    - See individual folders for lists of files to provide
    - if desired provide replacement cpu and 1bl keys in text files
    - open a command window in the xeBuild directory
    - on the command line type, for example:

    example - if you provided keys in appropriate text files

        xeBuild.exe -t glitch -c falcon -d myfalcon myfalconout.bin

        -t glitch = build a glitch type image
        -c falcon = use falcon bl and patch set
        -d myfalcon = a folder is present called "myfalcon" with per machine files, this uses it
        myfalconout.bin = the file that will be produced

    - type xeBuild.exe -? for command line info


Example:
========
    -take original console dump, put it in mytrinity folder as nanddump.bin
    -set CPU key and 1BL key in ini file, verify LDV from nanddump.bin matches console fuses
      if not set cfldv in ini file
    -build (xeBuild.exe -t glitch -d mytrinity -f 13599), flash and hopefully life is good


.ini files:
===========
    Just a word on the format... the ini parser is not very robust, the files need
    to be plain ASCII, everything after a ; on a line is ignored, and spaces are
    not acceptable (they get removed).

    Things like CPU key and 1BL key, if present in the per box ini file need not be
    placed anywhere else.


Note:
=====
    - DON'T USE THIS UNLESS YOU KNOW FOR SURE THAT YOU NEED IT! Using an incorrect
    controller config can result in problems remapping bad blocks (even manually.)
    If you have a 16M jasper, an additional build type has been added
    'jaspersb', by default the image will be built for jasper with big block
    controller (config 00023010), use this alternate switch to build for small
    block controller (config 01198010.)


Multi build/options example:
============================
    when you specify -f 13599 on the command line:
        13599\filelist.ini
    is parsed instead of data\filelist.ini

    Also the bin directory is used from
        13599\bin\
    instead of
        bin\
    allowing anyone to create multiple builds without multiple instances or
    rebuilds/hex edits/hacks of the main app.

    The example provided is the last version of 13599 patch set from dash launch and
        other files to build freeboot 13599

    example use:
    ------------
    xeBuild -f 13599 -d myfalcon x13599out.bin

    -f 13599     : use .\13599\filelist.ini, and .\13599\ for firmware files, .\13599\bin\ for patches
    -d myfalcon  : use .\myfalcon for per build files (cpu key, keyvault, security files, ini etc.)
    x13599out.bin: override auto generated name and produce .\x13599out.bin as the final NAND image

    note, if -d ***** is not specified it will still use the original /data and /bin dirs


Credits:
========
    Without ikari this would not have been possible, thanks!
          __               ____   ___   ___ _____
         / _|_ __ ___  ___| __ ) / _ \ / _ \_   _|
        | |_| '__/ _ \/ _ \  _ \| | | | | | || |
        |  _| | |  __/  __/ |_) | |_| | |_| || |
        |_| |_|  \___|\___|____/ \___/ \___/ |_|
                     [v0.07 - inspired by ikari]
        R.I.P.
    No this isn't freeboot, it is a clone and has always been since the last
    release of ibuild.

    Thanks and greetz to everyone who has contributed to hacking this
    wonderful machine. Thanks to the engineers and countless others who made
    the machine what it is... we only wish they had listened and RROD was
    not a problem. If we were to list everyone here, there would be no time
    left to play on the machine!
    
    Thanks to Free60 and Redline99 for providing usable xell builds <3

    Big thanks to the folks at #freeboot on efnet for the tireless
    hours of help you all give freely. Thanks to the testers who tirelessly
    made sure stuff worked. Thanks to rgloader for doing the work yourselves,
    there *is* no spoon, just a glitch in the matrix.

    Don't believe what random people *cough* write on forums ..

-----
//2011
-----

Changes:
========
1.00
- hotfix - jtag images were being created with incorrect patch file number (xexp1 instead of xexp2)
1.00
- gets security files from nanddump.bin and verifies them (odd.bin is currently not processed)
- option added to disable extracting security files from nanddump.bin
- decrypts perbuild security files for verification (crl/dae only currently, updater files work too)
- zero nonce data in bls before checking crc (inlcuded file lists updated with new crc and explanation)
- fixed a bug with mobile extraction
- fixed a bug with fsroot processing
- (glitch) dynamic SMC patcher, no longer limited to hard coded hash/offsets
- added more SMC hashes to verify known clean SMCs
- will attempt to decrypt external encrypted smc.bin if needed
- whitelist more chars in the file list parser
- altered so that pairing value will be retreived from nanddump.bin even if ldv is set in ini
- dual CB is dictated by ini, "none" filename indicates single CB (jtag does not use dual CB)
- increased logged info when adding files to flashfs
- odd.bin in encrypted (only!) form is now handled (from file or nanddump.bin)
- ini options are now available as -o options on command line
- added -t command line flag for glitch/retail/jtag selection
- JTAG image creation merged
- separate retail/glitch/jtag into individual per-firmware ini lists
- added -noenter command line option to suppres application asking to press enter on completion
- added proper errorlevel exiting, 1=usage/commandline error, 2=file write err, 3=image build error
- add 'cygnos' and 'xellbutton' options for glitch images with appropriate bl patches (either may affect fat glitch boot rate!)
- non-critical spare data fix to the way smc config is added to image
- update freeboot core and glitch base patches to accept a secondary xell poweron reason
- rewrote extended.bin handler, given an invalid/undecryptable file it will create a empty extended.bin
- rewrote keyvault handler, can decrypt and verify kv.bin when it's provided encrypted
- added patch append -a command, and converted nomu and nofcrt to optional patches
- added simple explanation of patch file formats in about_patches.S
- changed nonandmu option to nandmu so it can default to false
- added corona and winchester console types, currently not supported but there if needed
- add 14699

0.33
- corrected bug with ini parsing and dvd region (and others) left blank
- add 13604

0.32
- slim/fat glitch image building (based on fbbuild 0.32)
- builds retail images with -retail command line option
- added autopatch smc option in per box ini file
- extracts pairing value and highest LDV from nanddump.bin
    (ini cfldv setting overrides nanddump ldv)