
- BasicH -

***   For use on DSS "H" aka "P2" cards with 63 or less updates.
***   This program WILL NOT work on a "HU" aka "P3" card

This program will read and write the EPROM area of a DSS H card.
When doing a EPROM write, only bytes that differ will be written to the card.
This program will also clean and repair any EPROM image file from a DSS H card's image.
When In Normal mode: This program will not leave any holes open.
                                      It cleans up after itself after each operation.

This program *should* work on any card with a usw up to 255(decimal), as long as
there is no serious corruption of the EPROM, and the number of REAL updates on
the card is less than or equal to 63.

I would like to thank the cloakworks guys for helping me with the
hole open routines and safety checks. They have shared their knowledge freely,
and kept me from going to far into the weeds.
I would also like to thank The Rebel Alliance, and everyone else who has helped 
and inspired me with this project.


************************************* Warning *********************************************
  This Program has been tested on standard DSS H cards.

  If you try to load a image of a 3M, Or overwrite the image of a 3M,
  chances are you will LOOP your card. Read the section titled "Config/Write Mode"
  for more information on what's safe to write, and how.

  Use this software at your own risk.
*********************************************************************************************

Buttons:

    Open File
         Open a stored EPROM file from disk to memory and display it.

    Save File
         Save the EPROM image from memory to a file.

    Read Info
         Read general CAM info from the DSS card and display it.

    Roll Back
         Remove's updates from card.

    63
        Add's all 63 updates to a card. This will close all holes
        even in Expert Mode.

    Un-marry
        Un-marries card from IRD.

    Wipe PPV
        Cleans any PPV purchases off of card. Safe for subscribed cards.

    Time Zone
        Allows you to change the time zone and set the zip code.

    Read Eprom
        Read the EPROM image from a DSS card to memory.
        The read will not disturb any current programming on the card.
        It is safe to read a subscribed card.

    Clean Image
        Clean the EPROM image in memory (Read below for details).
        You then can save the image to a file, or write it back to the card.
        Clicking this button does not alter the DSS card in any way,
        only the image that is currently stored in memory.

    Write Eprom
        Write the EPROM image stored in memory to the DSS card. A EPROM read is done first,
        and only bytes that differ from the image in memory are written.

    One Step Clean
        This button combines the 3 steps necessary to clean the EPROM on your card into
        one operation. Pressing this button will
           1) Read your EPROM
           2) Save the EPROM image to a file "XXXXXXXXX_raw.bin"
               where "XXXXXXXXX" is your CAM id number.
           3) Clean the EPROM image.
           4) Write the cleaned image back to the card.

        It is much faster to clean the EPROM this way because the E3 hole is left open
        until the cleaned EPROM image is written back to the card.

Expert mode Buttons:
    Open Hole
        Opens the E3 Hole.

    Close Hole
        Closes the E3 Hole.

    Read Eprom
        Reads the Eprom using the 2D hole without making any changes to the Eprom. 
        The downside is that it takes about 2 minutes to read the Eprom
        
Menu Selections:

    Edit Mode
        Allow editing of the Eprom data in the display window.

    Card/Add Updates
        Add's updates to a card. 

    Config/Write Mode
        The best way to explain this is by example.

        Suppose your card currently has 3M code that jumps from the main processing loop (894E)
        to the PPV area (8028), and you want to write a virgin image to it.
        If you try to write starting at 8000, you would over write the
        code that is hidden in the PPV area before the main loop is rewritten.
        This can cause the card to be killed.
        In this case you would want to use the "894E - 8FFF then 8000 - 894D" mode.

        Suppose your card currently has a virgin EPROM and you want to write a image to it that
        has a 3M that jumps to some code in the PPV area (8028). You need to write the code to
        the PPV area first so that when the main processing loop (894E) is rewritten, the
        code that the 3M needs to jump to is already in place.
        If you were to write the main processing loop first, you would try jump to
        code that has not yet been written to the card.
        This can cause the card to be killed.
        In this case you would want to use the "8000 - 8FFF" mode.

        Suppose your card currently has 3M code that jumps from the main processing loop (894E)
        to the PPV area (8028), and you want to write a different 3M image to it.
        You need to write a virgin image first, then write the new 3M image to it
        using the above techniques.

        Suppose your card currently has a virgin EPROM and you want to write a image to it that
        is also a virgin EPROM. Although either mode would work, stick with the default
        "894E - 8FFF then 8000 - 894D" mode.

    Config/User Mode
        Normal or Expert.

        In expert mode, YOU are responsible for opening and closing the E3 hole.
        All the automatic hole open and close routines are bypassed in this mode.
        No checks are made to see if the hole is open or closed.
        There are 3 ways to close the hole, one is to click "Close Hole", another
        is to click "Add 63 Updates", and the 3rd way is to change mode from Expert
        to Normal and do an operation that closes the hole i.e. Write Eprom, Wipe PPV, Etc.

        DONT FORGET TO CLOSE THE HOLE IF YOU ARE IN THIS MODE!.

        I added this mode so that there is no overhead of opening and closing the
        holes for each operation.
        If you don't have a clue why you would want to do this, then you shouldn't
        be using this mode.

        Normal mode is the same as before.
        
    Config/Ignore ATR
        This will bypass the ATR check and allow you to continue if your ATR got
        messed up somehow.


By the way, I personally would not use this program to write 3M images anyway.
Your best bet is to stick with virgin images and use a program like WinExplorer
with a 3M script.

******************************************************
   Again, Use this software at your own risk.
******************************************************


About the Cleaner portion of this program:

It will clean and repair any EPROM image file from a DSS H card's image.
It will try bring your card back to almost a true virgin state.
This program has been written to perform a very long list of repair and cleaning tasks.

All repairs are fully automatic.  Some of the features include:
* It will repair any update area that were damaged by previous programming.
* It will fix almost all "Call Extension 745" errors that are due to card errors.
  Unfortunately, it will not fix 745 errors due to black listed cards.
* It will NOT alter any card specific areas, such as CAM ID, Group keys, etc.
* It will unmarry the card from the IRD.
* No cloning method is used, so your card retains all original ID info.
* It will restore the public keys.
* It will remove all previously ECM targeted 3M codes from a BIN image.
  This is also a safe way to clean your card if you do not recall which
  3M/4M has been programmed on it.
* It will put back all 63 updates on card image. No holes are left open in the image.
* It will scan the entire image and repair all non card specific areas.
* It will remove all foreign or unknown codes in common areas.
* It will clean your PPV, Tier areas, and C9 indexed write areas.
  This will remove left over codes from some freeware and commercial programs
  which DTV can use as targets.
* It will warn you if your original EPROM file is invalid or seriously damaged
  with a long list of safety checks.
