1 /* Bra.h -- Branch converters for executables
2 2013-01-18 : Igor Pavlov : Public domain */
12 These functions convert relative addresses to absolute addresses
13 in CALL instructions to increase the compression ratio.
18 ip - current virtual Instruction Pinter (IP) value
19 state - state variable for x86 converter
20 encoding - 0 (for decoding), 1 (for encoding)
23 state - state variable for x86 converter
26 The number of processed bytes. If you call these functions with multiple calls,
27 you must start next call with first byte after block of processed bytes.
29 Type Endian Alignment LookAhead
38 size must be >= Alignment + LookAhead, if it's not last block.
39 If (size < Alignment + LookAhead), converter returns 0.
46 ; size must be >= Alignment + LookAhead, if it's not last block
47 SizeT processed = Convert(data, size, ip, 1);
54 #define x86_Convert_Init(state) { state = 0; }
55 SizeT
x86_Convert(Byte
*data
, SizeT size
, UInt32 ip
, UInt32
*state
, int encoding
);
56 SizeT
ARM_Convert(Byte
*data
, SizeT size
, UInt32 ip
, int encoding
);
57 SizeT
ARMT_Convert(Byte
*data
, SizeT size
, UInt32 ip
, int encoding
);
58 SizeT
PPC_Convert(Byte
*data
, SizeT size
, UInt32 ip
, int encoding
);
59 SizeT
SPARC_Convert(Byte
*data
, SizeT size
, UInt32 ip
, int encoding
);
60 SizeT
IA64_Convert(Byte
*data
, SizeT size
, UInt32 ip
, int encoding
);