MPatcher
Class Firmware

java.lang.Object
  extended by MPatcher.Firmware

public class Firmware
extends java.lang.Object


Field Summary
 int codeOffset
          Code offset for R373 it is 0x10080000
 boolean debug
          Changed by FwPatch.debugMode debugMode in Patches whet patch is executed.
 byte[] FlashData
          Extracted CG1 bytes;
 int ramOffset
          RAM offset for R373 it is 0x12000000
 
Constructor Summary
Firmware(java.lang.String FileName)
          Firmware constructor is used when you choose file in open dialog.
 
Method Summary
 void copy(byte[] src, int start)
          Copies your bytes to FlashData.
 int FindBin(byte[] patt, byte[] mask)
          Searching patt in firmware.
 int FindBin(byte[] patt, byte[] mask, int StartAddress)
          Searching patt in firmware, starting search from StartAddress.
 java.lang.String FirmwareVersion()
           
 void SaveToBinFile(java.lang.String FileName)
          Save CG1 to file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

codeOffset

public int codeOffset
Code offset for R373 it is 0x10080000


debug

public boolean debug
Changed by FwPatch.debugMode debugMode in Patches whet patch is executed.


FlashData

public byte[] FlashData
Extracted CG1 bytes;


ramOffset

public int ramOffset
RAM offset for R373 it is 0x12000000

Constructor Detail

Firmware

public Firmware(java.lang.String FileName)
Firmware constructor is used when you choose file in open dialog. Reference to this object is MPatcher.firmware if file is not open reference should be null.

Parameters:
FileName - Full patch+filename to CG1 *.smg or *.bin binary file. SHX files is not supported yet.
Method Detail

copy

public void copy(byte[] src,
                 int start)
Copies your bytes to FlashData.

Parameters:
src - Source bytes what you want to copy.
start - Offset where your bytes will copied.

FindBin

public int FindBin(byte[] patt,
                   byte[] mask)
Searching patt in firmware.

Parameters:
patt - Pattern what you are searching.
mask - Mask for pattern (tells what bits are important what not);
Returns:
If patt found returns address in CG1, else returns 0;

FindBin

public int FindBin(byte[] patt,
                   byte[] mask,
                   int StartAddress)
Searching patt in firmware, starting search from StartAddress. You can use this method to find next occur of your patt.

Parameters:
patt - Pattern what you are searching.
mask - Mask for pattern (tells what bits are important what not);
StartAddress - Searching start position.
Returns:
If patt found returns address, else returns 0;

FirmwareVersion

public java.lang.String FirmwareVersion()
Returns:
Firmware version found in CG1

SaveToBinFile

public void SaveToBinFile(java.lang.String FileName)
Save CG1 to file.

Parameters:
FileName -