Blackberry COD file format. Part II.

August 11, 2006

Ok. Here is the next piece of Blackberry pie. In my previous post I presented a header structure of COD file. Another major structure of COD file is a data segment header structure. It starts from offset 0x2C plus codfh.code_size:

typedef struct {
ubyte
flags;
ubyte
version;
ushort
num_icalls;
ubyte
num_modules;
ubyte
num_classes ;
ushort
exported_string_offset;
ushort
data_bytes_offset;
ushort
empty_field;
ushort
class_definitions;
ushort
array_of_unknow_fields[14];
ushort
aliases;
ushort
array_of_unknow_fields[22];
} DATASEGTHEADER;

SizeOf (DATASEGHEADER) = 0x34
The next structure is

ushort classes_offsets[num_classes];

each record represents an offset from the begining of a data segment and points to a CLASS_STRUC.

Then we have

ushort module_offset;

ushort modules_offsets [num_modules-1];

ushort modules_offsets2[num_modules];

I still need to research this a bit, but usually module_offset field stores an offset to a string with a program or library name, modules_offsets array contains a similar offsets to additional modules if a program or library has more than one COD file. The modules_offsets2 contains an offset to a string with a version number (?).

Well the next post will be about DATABYTES and CLASS_STRUC structures.