make style

This commit is contained in:
Philippe Teuwen committed 2026-09-16 19:00:50 +02:00
1 parent f1e71c5b69
commit 634edd11fd
71 files changed
+588 -571

No files matched your search

+2 -2
View File
@@ -2247,7 +2247,7 @@ static OPJ_BOOL opj_dwt_decode_tile(opj_thread_pool_t *tp,
tr->y0); /* height of the resolution level computed */
OPJ_UINT32 w = (OPJ_UINT32)(tilec->resolutions[tilec->minimum_num_resolutions -
1].x1 -
1].x1 -
tilec->resolutions[tilec->minimum_num_resolutions - 1].x0);
OPJ_SIZE_T h_mem_size;
int num_threads;
@@ -3464,7 +3464,7 @@ OPJ_BOOL opj_dwt_decode_tile_97(opj_thread_pool_t *tp,
res->y0); /* height of the resolution level computed */
OPJ_UINT32 w = (OPJ_UINT32)(tilec->resolutions[tilec->minimum_num_resolutions -
1].x1 -
1].x1 -
tilec->resolutions[tilec->minimum_num_resolutions - 1].x0);
OPJ_SIZE_T l_data_size;
+26 -26
View File
@@ -1154,7 +1154,7 @@ OPJ_BOOL opj_t1_ht_decode_cblk(opj_t1_t *t1,
opj_mutex_lock(p_manager_mutex);
}
opj_event_msg(p_manager, EVT_ERROR, "We do not support ROI in decoding "
"HT codeblocks\n");
"HT codeblocks\n");
if (p_manager_mutex) {
opj_mutex_unlock(p_manager_mutex);
}
@@ -1265,8 +1265,8 @@ OPJ_BOOL opj_t1_ht_decode_cblk(opj_t1_t *t1,
opj_mutex_lock(p_manager_mutex);
}
opj_event_msg(p_manager, EVT_WARNING, "A malformed codeblock that has "
"more than one coding pass, but zero length for "
"2nd and potentially the 3rd pass in an HT codeblock.\n");
"more than one coding pass, but zero length for "
"2nd and potentially the 3rd pass in an HT codeblock.\n");
if (p_manager_mutex) {
opj_mutex_unlock(p_manager_mutex);
}
@@ -1277,8 +1277,8 @@ OPJ_BOOL opj_t1_ht_decode_cblk(opj_t1_t *t1,
opj_mutex_lock(p_manager_mutex);
}
opj_event_msg(p_manager, EVT_ERROR, "We do not support more than 3 "
"coding passes in an HT codeblock; This codeblocks has "
"%d passes.\n", num_passes);
"coding passes in an HT codeblock; This codeblocks has "
"%d passes.\n", num_passes);
if (p_manager_mutex) {
opj_mutex_unlock(p_manager_mutex);
}
@@ -1299,8 +1299,8 @@ OPJ_BOOL opj_t1_ht_decode_cblk(opj_t1_t *t1,
opj_mutex_lock(p_manager_mutex);
}
opj_event_msg(p_manager, EVT_ERROR, "32 bits are not enough to "
"decode this codeblock, since the number of "
"bitplane, %d, is larger than 30.\n", cblk->Mb);
"decode this codeblock, since the number of "
"bitplane, %d, is larger than 30.\n", cblk->Mb);
if (p_manager_mutex) {
opj_mutex_unlock(p_manager_mutex);
}
@@ -1315,8 +1315,8 @@ OPJ_BOOL opj_t1_ht_decode_cblk(opj_t1_t *t1,
opj_mutex_lock(p_manager_mutex);
}
opj_event_msg(p_manager, EVT_ERROR, "Malformed HT codeblock. "
"Decoding this codeblock is stopped. There are "
"%d zero bitplanes in %d bitplanes.\n",
"Decoding this codeblock is stopped. There are "
"%d zero bitplanes in %d bitplanes.\n",
zero_bplanes, cblk->Mb);
if (p_manager_mutex) {
@@ -1337,11 +1337,11 @@ OPJ_BOOL opj_t1_ht_decode_cblk(opj_t1_t *t1,
if (only_cleanup_pass_is_decoded == OPJ_FALSE) {
only_cleanup_pass_is_decoded = OPJ_TRUE;
opj_event_msg(p_manager, EVT_WARNING, "Malformed HT codeblock. "
"When the number of zero planes bitplanes is "
"equal to the number of bitplanes, only the cleanup "
"pass makes sense, but we have %d passes in this "
"codeblock. Therefore, only the cleanup pass will be "
"decoded. This message will not be displayed again.\n",
"When the number of zero planes bitplanes is "
"equal to the number of bitplanes, only the cleanup "
"pass makes sense, but we have %d passes in this "
"codeblock. Therefore, only the cleanup pass will be "
"decoded. This message will not be displayed again.\n",
num_passes);
}
if (p_manager_mutex) {
@@ -1363,7 +1363,7 @@ OPJ_BOOL opj_t1_ht_decode_cblk(opj_t1_t *t1,
opj_mutex_lock(p_manager_mutex);
}
opj_event_msg(p_manager, EVT_ERROR, "Malformed HT codeblock. "
"Invalid codeblock length values.\n");
"Invalid codeblock length values.\n");
if (p_manager_mutex) {
opj_mutex_unlock(p_manager_mutex);
@@ -1380,8 +1380,8 @@ OPJ_BOOL opj_t1_ht_decode_cblk(opj_t1_t *t1,
opj_mutex_lock(p_manager_mutex);
}
opj_event_msg(p_manager, EVT_ERROR, "Malformed HT codeblock. "
"One of the following condition is not met: "
"2 <= Scup <= min(Lcup, 4079)\n");
"One of the following condition is not met: "
"2 <= Scup <= min(Lcup, 4079)\n");
if (p_manager_mutex) {
opj_mutex_unlock(p_manager_mutex);
@@ -1395,7 +1395,7 @@ OPJ_BOOL opj_t1_ht_decode_cblk(opj_t1_t *t1,
opj_mutex_lock(p_manager_mutex);
}
opj_event_msg(p_manager, EVT_ERROR, "Malformed HT codeblock. "
"Incorrect MEL segment sequence.\n");
"Incorrect MEL segment sequence.\n");
if (p_manager_mutex) {
opj_mutex_unlock(p_manager_mutex);
}
@@ -1557,8 +1557,8 @@ OPJ_BOOL opj_t1_ht_decode_cblk(opj_t1_t *t1,
opj_mutex_lock(p_manager_mutex);
}
opj_event_msg(p_manager, EVT_ERROR, "Malformed HT codeblock. Decoding "
"this codeblock is stopped. U_q is larger than zero "
"bitplanes + 1 \n");
"this codeblock is stopped. U_q is larger than zero "
"bitplanes + 1 \n");
if (p_manager_mutex) {
opj_mutex_unlock(p_manager_mutex);
}
@@ -1583,8 +1583,8 @@ OPJ_BOOL opj_t1_ht_decode_cblk(opj_t1_t *t1,
opj_mutex_lock(p_manager_mutex);
}
opj_event_msg(p_manager, EVT_ERROR, "Malformed HT codeblock. "
"VLC code produces significant samples outside "
"the codeblock area.\n");
"VLC code produces significant samples outside "
"the codeblock area.\n");
if (p_manager_mutex) {
opj_mutex_unlock(p_manager_mutex);
}
@@ -1858,8 +1858,8 @@ OPJ_BOOL opj_t1_ht_decode_cblk(opj_t1_t *t1,
opj_mutex_lock(p_manager_mutex);
}
opj_event_msg(p_manager, EVT_ERROR, "Malformed HT codeblock. "
"Decoding this codeblock is stopped. U_q is"
"larger than bitplanes + 1 \n");
"Decoding this codeblock is stopped. U_q is"
"larger than bitplanes + 1 \n");
if (p_manager_mutex) {
opj_mutex_unlock(p_manager_mutex);
}
@@ -1884,8 +1884,8 @@ OPJ_BOOL opj_t1_ht_decode_cblk(opj_t1_t *t1,
opj_mutex_lock(p_manager_mutex);
}
opj_event_msg(p_manager, EVT_ERROR, "Malformed HT codeblock. "
"VLC code produces significant samples outside "
"the codeblock area.\n");
"VLC code produces significant samples outside "
"the codeblock area.\n");
if (p_manager_mutex) {
opj_mutex_unlock(p_manager_mutex);
}
+1 -1
View File
@@ -116,7 +116,7 @@ static OPJ_BOOL opj_lupDecompose(OPJ_FLOAT32 *matrix,
OPJ_UINT32 lLastColum = nb_compo - 1;
OPJ_UINT32 lSwapSize = nb_compo * (OPJ_UINT32)sizeof(OPJ_FLOAT32);
OPJ_FLOAT32 *lTmpMatrix = matrix;
OPJ_FLOAT32 *lColumnMatrix, * lDestMatrix;
OPJ_FLOAT32 *lColumnMatrix, *lDestMatrix;
OPJ_UINT32 offset = 1;
OPJ_UINT32 lStride = nb_compo - 1;
+16 -16
View File
@@ -2445,7 +2445,7 @@ static OPJ_BOOL opj_j2k_read_siz(opj_j2k_t *p_j2k,
for (i = 0; i < l_image->numcomps; ++i) {
if (! l_image->comps[i].sgnd) {
p_j2k->m_specific_param.m_decoder.m_default_tcp->tccps[i].m_dc_level_shift = 1
<< (l_image->comps[i].prec - 1);
<< (l_image->comps[i].prec - 1);
}
}
@@ -3220,7 +3220,7 @@ static OPJ_BOOL opj_j2k_read_qcc(opj_j2k_t *p_j2k,
/* we try to correct */
l_comp_no = backup_compno % l_num_comp;
opj_event_msg(p_manager, EVT_WARNING, "- trying to adjust this\n"
"- setting component number to %d\n",
"- setting component number to %d\n",
l_comp_no);
}
@@ -4469,7 +4469,7 @@ static OPJ_BOOL opj_j2k_read_sot(opj_j2k_t *p_j2k,
/* we try to correct */
tileno = backup_tileno;
opj_event_msg(p_manager, EVT_WARNING, "- trying to adjust this\n"
"- setting tile number to %d\n",
"- setting tile number to %d\n",
tileno);
}
@@ -4512,7 +4512,7 @@ static OPJ_BOOL opj_j2k_read_sot(opj_j2k_t *p_j2k,
/* we try to correct */
l_tot_len = 0;
opj_event_msg(p_manager, EVT_WARNING, "- trying to adjust this\n"
"- setting Psot to %d => assuming it is the last tile\n",
"- setting Psot to %d => assuming it is the last tile\n",
l_tot_len);
}
};
@@ -4864,7 +4864,7 @@ static OPJ_BOOL opj_j2k_write_sod(opj_j2k_t *p_j2k,
if (l_remaining_data <
p_j2k->m_specific_param.m_encoder.m_reserved_bytes_for_PLT) {
opj_event_msg(p_manager, EVT_ERROR,
"Not enough bytes in output buffer to write SOD marker\n");
"Not enough bytes in output buffer to write SOD marker\n");
opj_tcd_marker_info_destroy(marker_info);
return OPJ_FALSE;
}
@@ -6404,10 +6404,10 @@ static OPJ_BOOL opj_j2k_add_mct(opj_tcp_t *p_tcp, opj_image_t *p_image,
OPJ_UINT32 p_index) {
OPJ_UINT32 i;
opj_simple_mcc_decorrelation_data_t *l_mcc_record;
opj_mct_data_t *l_deco_array, * l_offset_array;
opj_mct_data_t *l_deco_array, *l_offset_array;
OPJ_UINT32 l_data_size, l_mct_size, l_offset_size;
OPJ_UINT32 l_nb_elem;
OPJ_UINT32 *l_offset_data, * l_current_offset_data;
OPJ_UINT32 *l_offset_data, *l_current_offset_data;
opj_tccp_t *l_tccp;
/* preconditions */
@@ -8518,10 +8518,10 @@ static OPJ_BOOL opj_j2k_mct_validation(opj_j2k_t *p_j2k,
OPJ_BOOL opj_j2k_setup_mct_encoding(opj_tcp_t *p_tcp, opj_image_t *p_image) {
OPJ_UINT32 i;
OPJ_UINT32 l_indix = 1;
opj_mct_data_t *l_mct_deco_data = 00, * l_mct_offset_data = 00;
opj_mct_data_t *l_mct_deco_data = 00, *l_mct_offset_data = 00;
opj_simple_mcc_decorrelation_data_t *l_mcc_data;
OPJ_UINT32 l_mct_size, l_nb_elem;
OPJ_FLOAT32 *l_data, * l_current_data;
OPJ_FLOAT32 *l_data, *l_current_data;
opj_tccp_t *l_tccp;
/* preconditions */
@@ -8734,14 +8734,14 @@ static OPJ_BOOL opj_j2k_encoding_validation(opj_j2k_t *p_j2k,
if ((p_j2k->m_cp.tdx) < (OPJ_UINT32)(1 <<
(p_j2k->m_cp.tcps->tccps->numresolutions - 1U))) {
opj_event_msg(p_manager, EVT_ERROR,
"Number of resolutions is too high in comparison to the size of tiles\n");
"Number of resolutions is too high in comparison to the size of tiles\n");
return OPJ_FALSE;
}
if ((p_j2k->m_cp.tdy) < (OPJ_UINT32)(1 <<
(p_j2k->m_cp.tcps->tccps->numresolutions - 1U))) {
opj_event_msg(p_manager, EVT_ERROR,
"Number of resolutions is too high in comparison to the size of tiles\n");
"Number of resolutions is too high in comparison to the size of tiles\n");
return OPJ_FALSE;
}
@@ -9807,7 +9807,7 @@ OPJ_BOOL opj_j2k_read_tile_header(opj_j2k_t *p_j2k,
(OPJ_UINT32)l_tcp->m_current_tile_part_number + 1 < l_tcp->m_nb_tile_parts) {
const OPJ_OFF_T next_tp_sot_pos = p_j2k->cstr_index->tile_index[
p_j2k->m_current_tile_number].tp_index[l_tcp->m_current_tile_part_number +
1].start_pos;
1].start_pos;
if (next_tp_sot_pos != opj_stream_tell(p_stream)) {
#if 0
@@ -11209,7 +11209,7 @@ static OPJ_BOOL opj_j2k_read_SQcd_SQcc(opj_j2k_t *p_j2k,
/* we try to correct */
l_num_band = 1;
opj_event_msg(p_manager, EVT_WARNING, "- trying to adjust them\n"
"- setting number of bands to %d => HYPOTHESIS!!!\n",
"- setting number of bands to %d => HYPOTHESIS!!!\n",
l_num_band);
};
@@ -11398,7 +11398,7 @@ static void opj_j2k_dump_MH_index(opj_j2k_t *p_j2k, FILE *out_stream) {
fprintf(out_stream, "Codestream index from main header: {\n");
fprintf(out_stream, "\t Main header start position=%" PRIi64 "\n"
"\t Main header end position=%" PRIi64 "\n",
"\t Main header end position=%" PRIi64 "\n",
cstr_index->main_head_start, cstr_index->main_head_end);
fprintf(out_stream, "\t Marker list: {\n");
@@ -12341,10 +12341,10 @@ OPJ_BOOL opj_j2k_get_tile(opj_j2k_t *p_j2k,
l_img_comp->w = (OPJ_UINT32)(opj_int_ceildivpow2(l_comp_x1,
(OPJ_INT32)l_img_comp->factor) - opj_int_ceildivpow2((OPJ_INT32)l_img_comp->x0,
(OPJ_INT32)l_img_comp->factor));
(OPJ_INT32)l_img_comp->factor));
l_img_comp->h = (OPJ_UINT32)(opj_int_ceildivpow2(l_comp_y1,
(OPJ_INT32)l_img_comp->factor) - opj_int_ceildivpow2((OPJ_INT32)l_img_comp->y0,
(OPJ_INT32)l_img_comp->factor));
(OPJ_INT32)l_img_comp->factor));
l_img_comp++;
}
+5 -5
View File
@@ -633,7 +633,7 @@ static OPJ_BOOL opj_jp2_read_ihdr(opj_jp2_t *jp2,
static OPJ_BYTE *opj_jp2_write_ihdr(opj_jp2_t *jp2,
OPJ_UINT32 *p_nb_bytes_written
) {
OPJ_BYTE *l_ihdr_data, * l_current_ihdr_ptr;
OPJ_BYTE *l_ihdr_data, *l_current_ihdr_ptr;
/* preconditions */
assert(jp2 != 00);
@@ -687,7 +687,7 @@ static OPJ_BYTE *opj_jp2_write_bpcc(opj_jp2_t *jp2,
OPJ_UINT32 i;
/* room for 8 bytes for box and 1 byte for each component */
OPJ_UINT32 l_bpcc_size;
OPJ_BYTE *l_bpcc_data, * l_current_bpcc_ptr;
OPJ_BYTE *l_bpcc_data, *l_current_bpcc_ptr;
/* preconditions */
assert(jp2 != 00);
@@ -757,7 +757,7 @@ static OPJ_BYTE *opj_jp2_write_cdef(opj_jp2_t *jp2,
OPJ_UINT32 *p_nb_bytes_written) {
/* room for 8 bytes for box, 2 for n */
OPJ_UINT32 l_cdef_size = 10;
OPJ_BYTE *l_cdef_data, * l_current_cdef_ptr;
OPJ_BYTE *l_cdef_data, *l_current_cdef_ptr;
OPJ_UINT32 l_value;
OPJ_UINT16 i;
@@ -808,7 +808,7 @@ static OPJ_BYTE *opj_jp2_write_colr(opj_jp2_t *jp2,
) {
/* room for 8 bytes for box 3 for common data and variable upon profile*/
OPJ_UINT32 l_colr_size = 11;
OPJ_BYTE *l_colr_data, * l_current_colr_ptr;
OPJ_BYTE *l_colr_data, *l_current_colr_ptr;
/* preconditions */
assert(jp2 != 00);
@@ -1740,7 +1740,7 @@ static OPJ_BOOL opj_jp2_write_ftyp(opj_jp2_t *jp2,
opj_event_mgr_t *p_manager) {
OPJ_UINT32 i;
OPJ_UINT32 l_ftyp_size;
OPJ_BYTE *l_ftyp_data, * l_current_data_ptr;
OPJ_BYTE *l_ftyp_data, *l_current_data_ptr;
OPJ_BOOL l_result;
/* preconditions */
+6 -6
View File
@@ -671,9 +671,9 @@ opj_codec_t *OPJ_CALLCONV opj_create_compress(OPJ_CODEC_FORMAT p_format) {
struct opj_event_mgr *)) opj_j2k_setup_encoder;
l_codec->m_codec_data.m_compression.opj_encoder_set_extra_options = (OPJ_BOOL(
*)(void *,
const char *const *,
struct opj_event_mgr *)) opj_j2k_encoder_set_extra_options;
*)(void *,
const char *const *,
struct opj_event_mgr *)) opj_j2k_encoder_set_extra_options;
l_codec->opj_set_threads =
(OPJ_BOOL(*)(void *p_codec, OPJ_UINT32 num_threads)) opj_j2k_set_threads;
@@ -717,9 +717,9 @@ opj_codec_t *OPJ_CALLCONV opj_create_compress(OPJ_CODEC_FORMAT p_format) {
struct opj_event_mgr *)) opj_jp2_setup_encoder;
l_codec->m_codec_data.m_compression.opj_encoder_set_extra_options = (OPJ_BOOL(
*)(void *,
const char *const *,
struct opj_event_mgr *)) opj_jp2_encoder_set_extra_options;
*)(void *,
const char *const *,
struct opj_event_mgr *)) opj_jp2_encoder_set_extra_options;
l_codec->opj_set_threads =
(OPJ_BOOL(*)(void *p_codec, OPJ_UINT32 num_threads)) opj_jp2_set_threads;
+2 -2
View File
@@ -1759,7 +1759,7 @@ static void opj_t1_clbl_decode_processor(void *user_data, opj_tls_t *tls) {
}
} else if (tccp->qmfbid == 1) {
OPJ_INT32 *OPJ_RESTRICT tiledp = &tilec->data[(OPJ_SIZE_T)y * tile_w +
(OPJ_SIZE_T)x];
(OPJ_SIZE_T)x];
for (j = 0; j < cblk_h; ++j) {
//positive -> round down aka. (83)/2 = 41.5 -> 41
//negative -> round up aka. (-83)/2 = -41.5 -> -41
@@ -1814,7 +1814,7 @@ static void opj_t1_clbl_decode_processor(void *user_data, opj_tls_t *tls) {
} else { /* if (tccp->qmfbid == 0) */
const float stepsize = 0.5f * band->stepsize;
OPJ_FLOAT32 *OPJ_RESTRICT tiledp = (OPJ_FLOAT32 *) &tilec->data[(OPJ_SIZE_T)y *
tile_w + (OPJ_SIZE_T)x];
tile_w + (OPJ_SIZE_T)x];
for (j = 0; j < cblk_h; ++j) {
OPJ_FLOAT32 *OPJ_RESTRICT tiledp2 = tiledp;
for (i = 0; i < cblk_w; ++i) {
+3 -3
View File
@@ -351,7 +351,7 @@ OPJ_BOOL opj_t2_encode_packets(opj_t2_t *p_t2,
} else {
info_PK->start_pos = ((l_cp->m_specific_param.m_enc.m_tp_on | l_tcp->POC) &&
info_PK->start_pos) ? info_PK->start_pos : info_TL->packet[cstr_info->packno -
1].end_pos + 1;
1].end_pos + 1;
}
info_PK->end_pos = info_PK->start_pos + l_nb_bytes - 1;
info_PK->end_ph_pos += info_PK->start_pos -
@@ -550,7 +550,7 @@ OPJ_BOOL opj_t2_decode_packets(opj_tcd_t *tcd,
} else {
info_PK->start_pos = (l_cp->m_specific_param.m_enc.m_tp_on &&
info_PK->start_pos) ? info_PK->start_pos : info_TL->packet[p_cstr_info->packno -
1].end_pos + 1;
1].end_pos + 1;
}
info_PK->end_pos = info_PK->start_pos + l_nb_bytes_read - 1;
info_PK->end_ph_pos += info_PK->start_pos -
@@ -1439,7 +1439,7 @@ static OPJ_BOOL opj_t2_read_packet_data(opj_t2_t *p_t2,
(partial_buffer)) {
if (p_t2->cp->strict) {
opj_event_msg(p_manager, EVT_ERROR,
"read: segment too long (%d) with max (%d) for codeblock %d (p=%d, b=%d, r=%d, c=%d)\n",
"read: segment too long (%d) with max (%d) for codeblock %d (p=%d, b=%d, r=%d, c=%d)\n",
l_seg->newlen, p_max_length, cblkno, p_pi->precno, bandno, p_pi->resno,
p_pi->compno);
return OPJ_FALSE;
+3 -3
View File
@@ -368,7 +368,7 @@ void opj_tcd_makelayer_fixed(opj_tcd_t *tcd, OPJ_UINT32 layno,
for (k = 0; k < 3; k++) {
matrice[i][j][k] =
(OPJ_INT32)((OPJ_FLOAT32)cp->m_specific_param.m_enc.m_matrice[i *
tilec->numresolutions * 3 + j * 3 + k]
tilec->numresolutions * 3 + j * 3 + k]
* (OPJ_FLOAT32)(tcd->image->comps[compno].prec / 16.0));
}
}
@@ -1152,7 +1152,7 @@ static INLINE OPJ_BOOL opj_tcd_init_tile(opj_tcd_t *p_tcd, OPJ_UINT32 p_tile_no,
if ((((OPJ_UINT32) - 1) / (OPJ_UINT32)sizeof_block) <
l_nb_code_blocks) {
opj_event_msg(manager, EVT_ERROR,
"Size of code block data exceeds system limits\n");
"Size of code block data exceeds system limits\n");
return OPJ_FALSE;
}
l_nb_code_blocks_size = l_nb_code_blocks * (OPJ_UINT32)sizeof_block;
@@ -1805,7 +1805,7 @@ OPJ_BOOL opj_tcd_update_tile_data(opj_tcd_t *p_tcd,
l_width = (OPJ_UINT32)(l_res->x1 - l_res->x0);
l_height = (OPJ_UINT32)(l_res->y1 - l_res->y0);
l_stride = (OPJ_UINT32)(l_tilec->resolutions[l_tilec->minimum_num_resolutions -
1].x1 -
1].x1 -
l_tilec->resolutions[l_tilec->minimum_num_resolutions - 1].x0) - l_width;
l_src_data = l_tilec->data;
} else {
+6 -6
View File
@@ -73,10 +73,10 @@ main(int argc, char *argv[]) {
setbmp();
if (BMP_BIT != bmpbit || BMP_SUB != bmpsub) {
fprintf(stderr, "reveng: configuration fault. Update "
"reveng/config.h with these definitions and "
"recompile:\n"
"\t#define BMP_BIT %d\n"
"\t#define BMP_SUB %d\n",
"reveng/config.h with these definitions and "
"recompile:\n"
"\t#define BMP_BIT %d\n"
"\t#define BMP_SUB %d\n",
bmpbit, bmpsub);
exit(EXIT_FAILURE);
}
@@ -84,8 +84,8 @@ main(int argc, char *argv[]) {
/* check the bitmap constant macro */
if (~(bmp_t) 0 != ~BMP_C(0)) {
fprintf(stderr, "reveng: configuration fault. Edit "
"the definition of BMP_C() in config.h to "
"match BMP_T and recompile.\n");
"the definition of BMP_C() in config.h to "
"match BMP_T and recompile.\n");
exit(EXIT_FAILURE);
}
exit(EXIT_SUCCESS);
+229 -229
View File
@@ -137,19 +137,19 @@ static const bmp_t b40c[] = {
# else /* BMP_BIT */
static const bmp_t b40[] = {
BMP_C(0x00048200) << (BMP_BIT - 32) | BMP_C(0x04) >> (39 - BMP_BIT),
BMP_C(0x09) << (BMP_BIT * 2 - 40),
BMP_C(0x09) << (BMP_BIT * 2 - 40),
};
static const bmp_t b40a[] = {
BMP_C(0xffffffff) << (BMP_BIT - 32) | BMP_C(0x7f) >> (39 - BMP_BIT),
BMP_C(0xff) << (BMP_BIT * 2 - 40),
BMP_C(0xff) << (BMP_BIT * 2 - 40),
};
static const bmp_t b40b[] = {
BMP_C(0xd4164fc6) << (BMP_BIT - 32) | BMP_C(0x23) >> (39 - BMP_BIT),
BMP_C(0x46) << (BMP_BIT * 2 - 40),
BMP_C(0x46) << (BMP_BIT * 2 - 40),
};
static const bmp_t b40c[] = {
BMP_C(0xc4ff8071) << (BMP_BIT - 32) | BMP_C(0x7f) >> (39 - BMP_BIT),
BMP_C(0xff) << (BMP_BIT * 2 - 40),
BMP_C(0xff) << (BMP_BIT * 2 - 40),
};
# endif /* BMP_BIT */
@@ -187,43 +187,43 @@ static const bmp_t b64i[] = {
# else /* BMP_BIT */
static const bmp_t b64[] = {
BMP_C(0x00000000) << (BMP_BIT - 32) | BMP_C(0x0000000d) >> (63 - BMP_BIT),
BMP_C(0x0000001b) << (BMP_BIT * 2 - 64),
BMP_C(0x0000001b) << (BMP_BIT * 2 - 64),
};
static const bmp_t b64a[] = {
BMP_C(0xffffffff) << (BMP_BIT - 32) | BMP_C(0x7fffffff) >> (63 - BMP_BIT),
BMP_C(0xffffffff) << (BMP_BIT * 2 - 64),
BMP_C(0xffffffff) << (BMP_BIT * 2 - 64),
};
static const bmp_t b64b[] = {
BMP_C(0xb90956c7) << (BMP_BIT - 32) | BMP_C(0x3ad20800) >> (63 - BMP_BIT),
BMP_C(0x75a41001) << (BMP_BIT * 2 - 64),
BMP_C(0x75a41001) << (BMP_BIT * 2 - 64),
};
static const bmp_t b64c[] = {
BMP_C(0x53000000) << (BMP_BIT - 32) | BMP_C(0x00000000) >> (63 - BMP_BIT),
BMP_C(0x00000000) << (BMP_BIT * 2 - 64),
BMP_C(0x00000000) << (BMP_BIT * 2 - 64),
};
static const bmp_t b64d[] = {
BMP_C(0x42f0e1eb) << (BMP_BIT - 32) | BMP_C(0x54f51b49) >> (63 - BMP_BIT),
BMP_C(0xa9ea3693) << (BMP_BIT * 2 - 64),
BMP_C(0xa9ea3693) << (BMP_BIT * 2 - 64),
};
static const bmp_t b64e[] = {
BMP_C(0x6c40df5f) << (BMP_BIT - 32) | BMP_C(0x05a4b9a3) >> (63 - BMP_BIT),
BMP_C(0x0b497347) << (BMP_BIT * 2 - 64),
BMP_C(0x0b497347) << (BMP_BIT * 2 - 64),
};
static const bmp_t b64f[] = {
BMP_C(0x62ec59e3) << (BMP_BIT - 32) | BMP_C(0x78d27805) >> (63 - BMP_BIT),
BMP_C(0xf1a4f00a) << (BMP_BIT * 2 - 64),
BMP_C(0xf1a4f00a) << (BMP_BIT * 2 - 64),
};
static const bmp_t b64g[] = {
BMP_C(0xfcacbebd) << (BMP_BIT - 32) | BMP_C(0x2c98d4c9) >> (63 - BMP_BIT),
BMP_C(0x5931a992) << (BMP_BIT * 2 - 64),
BMP_C(0x5931a992) << (BMP_BIT * 2 - 64),
};
static const bmp_t b64h[] = {
BMP_C(0x995dc9bb) << (BMP_BIT - 32) | BMP_C(0x6f8c9cfd) >> (63 - BMP_BIT),
BMP_C(0xdf1939fa) << (BMP_BIT * 2 - 64),
BMP_C(0xdf1939fa) << (BMP_BIT * 2 - 64),
};
static const bmp_t b64i[] = {
BMP_C(0x49958c9a) << (BMP_BIT - 32) | BMP_C(0x5ebe9a9f) >> (63 - BMP_BIT),
BMP_C(0xbd7d353f) << (BMP_BIT * 2 - 64),
BMP_C(0xbd7d353f) << (BMP_BIT * 2 - 64),
};
# endif /* BMP_BIT */
@@ -237,22 +237,22 @@ static const bmp_t b82a[] = {
# elif BMP_BIT >= 41
static const bmp_t b82[] = {
BMP_C(0x01846008880) << (BMP_BIT - 41) | BMP_C(0x08a00a20208) >> (81 - BMP_BIT),
BMP_C(0x11401440411) << (BMP_BIT * 2 - 82),
BMP_C(0x11401440411) << (BMP_BIT * 2 - 82),
};
static const bmp_t b82a[] = {
BMP_C(0x04f541fb128) << (BMP_BIT - 41) | BMP_C(0x011c00feb09) >> (81 - BMP_BIT),
BMP_C(0x023801fd612) << (BMP_BIT * 2 - 82),
BMP_C(0x023801fd612) << (BMP_BIT * 2 - 82),
};
# else /* BMP_BIT */
static const bmp_t b82[] = {
BMP_C(0x0c230044) << (BMP_BIT - 32) | BMP_C(0x040) >> (40 - BMP_BIT),
BMP_C(0x40450051) << (BMP_BIT * 2 - 64) | BMP_C(0x00104) >> (80 - BMP_BIT * 2),
BMP_C(0x00411) << (BMP_BIT * 3 - 82),
BMP_C(0x40450051) << (BMP_BIT * 2 - 64) | BMP_C(0x00104) >> (80 - BMP_BIT * 2),
BMP_C(0x00411) << (BMP_BIT * 3 - 82),
};
static const bmp_t b82a[] = {
BMP_C(0x27aa0fd8) << (BMP_BIT - 32) | BMP_C(0x094) >> (40 - BMP_BIT),
BMP_C(0x9408e007) << (BMP_BIT * 2 - 64) | BMP_C(0x0f584) >> (80 - BMP_BIT * 2),
BMP_C(0x3d612) << (BMP_BIT * 3 - 82),
BMP_C(0x9408e007) << (BMP_BIT * 2 - 64) | BMP_C(0x0f584) >> (80 - BMP_BIT * 2),
BMP_C(0x3d612) << (BMP_BIT * 3 - 82),
};
# endif /* BMP_BIT */
@@ -262,215 +262,215 @@ static const bmp_t b82a[] = {
/* Array of the polynomial bitmaps used in the model table. */
static const bmp_t b32[] = {
BMP_C(0x000000af) << (BMP_BIT - 32), /* 0 -- 32,000000af */
BMP_C(0x00010000) << (BMP_BIT - 32), /* 1 -- 16, 0001 */
BMP_C(0x00020000) << (BMP_BIT - 32), /* 2 -- 15, 0001 */
BMP_C(0x00065b00) << (BMP_BIT - 32), /* 3 -- 24, 00065b */
BMP_C(0x007e0000) << (BMP_BIT - 32), /* 4 -- 16, 007e */
BMP_C(0x007f0000) << (BMP_BIT - 32), /* 5 -- 16, 007f */
BMP_C(0x03400000) << (BMP_BIT - 32), /* 6 -- 11, 01a */
BMP_C(0x0376e6e7) << (BMP_BIT - 32), /* 7 -- 32,0376e6e7 */
BMP_C(0x04c11db7) << (BMP_BIT - 32), /* 8 -- 32,04c11db7 */
BMP_C(0x05890000) << (BMP_BIT - 32), /* 9 -- 16, 0589 */
BMP_C(0x07000000) << (BMP_BIT - 32), /* 10 -- 8, 07 */
BMP_C(0x080b0000) << (BMP_BIT - 32), /* 11 -- 16, 080b */
BMP_C(0x09823b6e) << (BMP_BIT - 32), /* 12 -- 31,04c11db7 */
BMP_C(0x0b3c0000) << (BMP_BIT - 32), /* 13 -- 15, 059e */
BMP_C(0x0c000000) << (BMP_BIT - 32), /* 14 -- 6, 03 */
BMP_C(0x0c200000) << (BMP_BIT - 32), /* 15 -- 11, 061 */
BMP_C(0x0c780000) << (BMP_BIT - 32), /* 16 -- 14, 031e */
BMP_C(0x0fb30000) << (BMP_BIT - 32), /* 17 -- 16, 0fb3 */
BMP_C(0x10210000) << (BMP_BIT - 32), /* 18 -- 16, 1021 */
BMP_C(0x12000000) << (BMP_BIT - 32), /* 19 -- 7, 09 */
BMP_C(0x130d2afc) << (BMP_BIT - 32), /* 20 -- 30,04c34abf */
BMP_C(0x144e6300) << (BMP_BIT - 32), /* 21 -- 24, 144e63 */
BMP_C(0x15000000) << (BMP_BIT - 32), /* 22 -- 8, 15 */
BMP_C(0x1697d06a) << (BMP_BIT - 32), /* 23 -- 32,1697d06a */
BMP_C(0x17800000) << (BMP_BIT - 32), /* 24 -- 12, 178 */
BMP_C(0x18000000) << (BMP_BIT - 32), /* 25 -- 6, 06 */
BMP_C(0x19d3c8d8) << (BMP_BIT - 32), /* 26 -- 31,0ce9e46c */
BMP_C(0x1c000000) << (BMP_BIT - 32), /* 27 -- 6, 07 */
BMP_C(0x1d000000) << (BMP_BIT - 32), /* 28 -- 8, 1d */
BMP_C(0x1d0f0000) << (BMP_BIT - 32), /* 29 -- 16, 1d0f */
BMP_C(0x1dcf0000) << (BMP_BIT - 32), /* 30 -- 16, 1dcf */
BMP_C(0x1edc6f41) << (BMP_BIT - 32), /* 31 -- 32,1edc6f41 */
BMP_C(0x1f23b800) << (BMP_BIT - 32), /* 32 -- 24, 1f23b8 */
BMP_C(0x20000000) << (BMP_BIT - 32), /* 33 -- 4, 2 */
BMP_C(0x200fa500) << (BMP_BIT - 32), /* 34 -- 24, 200fa5 */
BMP_C(0x20140000) << (BMP_BIT - 32), /* 35 -- 14, 0805 */
BMP_C(0x20b40000) << (BMP_BIT - 32), /* 36 -- 14, 082d */
BMP_C(0x20fe0000) << (BMP_BIT - 32), /* 37 -- 16, 20fe */
BMP_C(0x21890000) << (BMP_BIT - 32), /* 38 -- 16, 2189 */
BMP_C(0x21cf0200) << (BMP_BIT - 32), /* 39 -- 24, 21cf02 */
BMP_C(0x23ef5200) << (BMP_BIT - 32), /* 40 -- 24, 23ef52 */
BMP_C(0x25000000) << (BMP_BIT - 32), /* 41 -- 8, 25 */
BMP_C(0x26000000) << (BMP_BIT - 32), /* 42 -- 8, 26 */
BMP_C(0x26b10000) << (BMP_BIT - 32), /* 43 -- 16, 26b1 */
BMP_C(0x27818000) << (BMP_BIT - 32), /* 44 -- 17, 04f03 */
BMP_C(0x27d00000) << (BMP_BIT - 32), /* 45 -- 13, 04fa */
BMP_C(0x28000000) << (BMP_BIT - 32), /* 46 -- 5, 05 */
BMP_C(0x29b10000) << (BMP_BIT - 32), /* 47 -- 16, 29b1 */
BMP_C(0x2f000000) << (BMP_BIT - 32), /* 48 -- 8, 2f */
BMP_C(0x30000000) << (BMP_BIT - 32), /* 49 -- 4, 3/ 5, 6 */
BMP_C(0x3010bf7f) << (BMP_BIT - 32), /* 50 -- 32,3010bf7f */
BMP_C(0x31000000) << (BMP_BIT - 32), /* 51 -- 8, 31 */
BMP_C(0x31800000) << (BMP_BIT - 32), /* 52 -- 10, 0c6 */
BMP_C(0x31c30000) << (BMP_BIT - 32), /* 53 -- 16, 31c3 */
BMP_C(0x328b6300) << (BMP_BIT - 32), /* 54 -- 24, 328b63 */
BMP_C(0x34000000) << (BMP_BIT - 32), /* 55 -- 6, 0d */
BMP_C(0x340bc6d9) << (BMP_BIT - 32), /* 56 -- 32,340bc6d9 */
BMP_C(0x37000000) << (BMP_BIT - 32), /* 57 -- 8, 37 */
BMP_C(0x38000000) << (BMP_BIT - 32), /* 58 -- 5, 07 */
BMP_C(0x39000000) << (BMP_BIT - 32), /* 59 -- 8, 39 */
BMP_C(0x3d650000) << (BMP_BIT - 32), /* 60 -- 16, 3d65 */
BMP_C(0x3e000000) << (BMP_BIT - 32), /* 61 -- 8, 3e */
BMP_C(0x40000000) << (BMP_BIT - 32), /* 62 -- 3, 2 */
BMP_C(0x42000000) << (BMP_BIT - 32), /* 63 -- 8, 42 */
BMP_C(0x44c20000) << (BMP_BIT - 32), /* 64 -- 16, 44c2 */
BMP_C(0x45270551) << (BMP_BIT - 32), /* 65 -- 32,45270551 */
BMP_C(0x48000000) << (BMP_BIT - 32), /* 66 -- 5, 09 */
BMP_C(0x49000000) << (BMP_BIT - 32), /* 67 -- 8, 49 */
BMP_C(0x4a800000) << (BMP_BIT - 32), /* 68 -- 10, 12a */
BMP_C(0x4acc0000) << (BMP_BIT - 32), /* 69 -- 15, 2566 */
BMP_C(0x4b000000) << (BMP_BIT - 32), /* 70 -- 8, 4b */
BMP_C(0x4b370000) << (BMP_BIT - 32), /* 71 -- 16, 4b37 */
BMP_C(0x4c000000) << (BMP_BIT - 32), /* 72 -- 6, 13 */
BMP_C(0x4c060000) << (BMP_BIT - 32), /* 73 -- 16, 4c06 */
BMP_C(0x53000000) << (BMP_BIT - 32), /* 74 -- 8, 53 */
BMP_C(0x55000000) << (BMP_BIT - 32), /* 75 -- 8, 55 */
BMP_C(0x55555500) << (BMP_BIT - 32), /* 76 -- 24, 555555 */
BMP_C(0x59350000) << (BMP_BIT - 32), /* 77 -- 16, 5935 */
BMP_C(0x5d380000) << (BMP_BIT - 32), /* 78 -- 16, 5d38 */
BMP_C(0x5d400000) << (BMP_BIT - 32), /* 79 -- 10, 175 */
BMP_C(0x5d6dcb00) << (BMP_BIT - 32), /* 80 -- 24, 5d6dcb */
BMP_C(0x60000000) << (BMP_BIT - 32), /* 81 -- 3, 3 */
BMP_C(0x60e00000) << (BMP_BIT - 32), /* 82 -- 11, 307 */
BMP_C(0x63d00000) << (BMP_BIT - 32), /* 83 -- 16, 63d0 */
BMP_C(0x64000000) << (BMP_BIT - 32), /* 84 -- 6, 19 */
BMP_C(0x66400000) << (BMP_BIT - 32), /* 85 -- 10, 199 */
BMP_C(0x66c50000) << (BMP_BIT - 32), /* 86 -- 16, 66c5 */
BMP_C(0x6f630000) << (BMP_BIT - 32), /* 87 -- 16, 6f63 */
BMP_C(0x6f910000) << (BMP_BIT - 32), /* 88 -- 16, 6f91 */
BMP_C(0x70000000) << (BMP_BIT - 32), /* 89 -- 4, 7 */
BMP_C(0x70a00000) << (BMP_BIT - 32), /* 90 -- 11, 385 */
BMP_C(0x755b0000) << (BMP_BIT - 32), /* 91 -- 16, 755b */
BMP_C(0x765e7680) << (BMP_BIT - 32), /* 92 -- 32,765e7680 */
BMP_C(0x76c20800) << (BMP_BIT - 32), /* 93 -- 32, 0ed841 */
BMP_C(0x7979bd00) << (BMP_BIT - 32), /* 94 -- 24, 7979bd */
BMP_C(0x7e000000) << (BMP_BIT - 32), /* 95 -- 8, 7e */
BMP_C(0x80000000) << (BMP_BIT - 32), /* 96 -- 3, 4 */
BMP_C(0x80006300) << (BMP_BIT - 32), /* 97 -- 24, 800063 */
BMP_C(0x80050000) << (BMP_BIT - 32), /* 98 -- 16, 8005 */
BMP_C(0x800d0000) << (BMP_BIT - 32), /* 99 -- 16, 800d */
BMP_C(0x800fe300) << (BMP_BIT - 32), /* 100 -- 24, 800fe3 */
BMP_C(0x80b40000) << (BMP_BIT - 32), /* 101 -- 14, 202d */
BMP_C(0x80c2e71c) << (BMP_BIT - 32), /* 102 -- 30,2030b9c7 */
BMP_C(0x80f00000) << (BMP_BIT - 32), /* 103 -- 12, 80f */
BMP_C(0x814141ab) << (BMP_BIT - 32), /* 104 -- 32,814141ab */
BMP_C(0x8144c800) << (BMP_BIT - 32), /* 105 -- 21, 102899 */
BMP_C(0x864cfb00) << (BMP_BIT - 32), /* 106 -- 24, 864cfb */
BMP_C(0x87315576) << (BMP_BIT - 32), /* 107 -- 32,87315576 */
BMP_C(0x89ec0000) << (BMP_BIT - 32), /* 108 -- 16, 89ec */
BMP_C(0x8a000000) << (BMP_BIT - 32), /* 109 -- 7, 45 */
BMP_C(0x8b320000) << (BMP_BIT - 32), /* 110 -- 15, 4599 */
BMP_C(0x8bb70000) << (BMP_BIT - 32), /* 111 -- 16, 8bb7 */
BMP_C(0x8cc00000) << (BMP_BIT - 32), /* 112 -- 10, 233 */
BMP_C(0x904cddbf) << (BMP_BIT - 32), /* 113 -- 32,904cddbf */
BMP_C(0x906e0000) << (BMP_BIT - 32), /* 114 -- 16, 906e */
BMP_C(0x94000000) << (BMP_BIT - 32), /* 115 -- 8, 94 */
BMP_C(0x97000000) << (BMP_BIT - 32), /* 116 -- 8, 97 */
BMP_C(0x98000000) << (BMP_BIT - 32), /* 117 -- 6, 26 */
BMP_C(0x99000000) << (BMP_BIT - 32), /* 118 -- 8, 99 */
BMP_C(0x9b000000) << (BMP_BIT - 32), /* 119 -- 8, 9b */
BMP_C(0x9c000000) << (BMP_BIT - 32), /* 120 -- 6, 27 */
BMP_C(0x9d5e4de2) << (BMP_BIT - 32), /* 121 -- 31,4eaf26f1 */
BMP_C(0x9e000000) << (BMP_BIT - 32), /* 122 -- 7, 4f */
BMP_C(0x9ecf0000) << (BMP_BIT - 32), /* 123 -- 16, 9ecf */
BMP_C(0xa0660000) << (BMP_BIT - 32), /* 124 -- 16, a066 */
BMP_C(0xa0970000) << (BMP_BIT - 32), /* 125 -- 16, a097 */
BMP_C(0xa1000000) << (BMP_BIT - 32), /* 126 -- 8, a1 */
BMP_C(0xa3660000) << (BMP_BIT - 32), /* 127 -- 16, a366 */
BMP_C(0xa6000000) << (BMP_BIT - 32), /* 128 -- 7, 53 */
BMP_C(0xa7000000) << (BMP_BIT - 32), /* 129 -- 8, a7 */
BMP_C(0xa8000000) << (BMP_BIT - 32), /* 130 -- 5, 15 */
BMP_C(0xa8190000) << (BMP_BIT - 32), /* 131 -- 16, a819 */
BMP_C(0xa833982b) << (BMP_BIT - 32), /* 132 -- 32,a833982b */
BMP_C(0xabcdef00) << (BMP_BIT - 32), /* 133 -- 24, abcdef */
BMP_C(0xac000000) << (BMP_BIT - 32), /* 134 -- 8, ac */
BMP_C(0xaee70000) << (BMP_BIT - 32), /* 135 -- 16, aee7 */
BMP_C(0xb0000000) << (BMP_BIT - 32), /* 136 -- 4, b */
BMP_C(0xb0010000) << (BMP_BIT - 32), /* 137 -- 16, b001 */
BMP_C(0xb2aa0000) << (BMP_BIT - 32), /* 138 -- 16, b2aa */
BMP_C(0xb3400000) << (BMP_BIT - 32), /* 139 -- 12, b34 */
BMP_C(0xb42d8000) << (BMP_BIT - 32), /* 140 -- 17, 1685b */
BMP_C(0xb4600000) << (BMP_BIT - 32), /* 141 -- 11, 5a3 */
BMP_C(0xb4c80000) << (BMP_BIT - 32), /* 142 -- 16, b4c8 */
BMP_C(0xb4f3e600) << (BMP_BIT - 32), /* 143 -- 24, b4f3e6 */
BMP_C(0xb704ce00) << (BMP_BIT - 32), /* 144 -- 24, b704ce */
BMP_C(0xb798b438) << (BMP_BIT - 32), /* 145 -- 32,b798b438 */
BMP_C(0xbb3d0000) << (BMP_BIT - 32), /* 146 -- 16, bb3d */
BMP_C(0xbc000000) << (BMP_BIT - 32), /* 147 -- 6,2f/ 8,bc */
BMP_C(0xbd0be338) << (BMP_BIT - 32), /* 148 -- 32,bd0be338 */
BMP_C(0xbdf40000) << (BMP_BIT - 32), /* 149 -- 16, bdf4 */
BMP_C(0xbf050000) << (BMP_BIT - 32), /* 150 -- 16, bf05 */
BMP_C(0xc0000000) << (BMP_BIT - 32), /* 151 -- 3, 6 */
BMP_C(0xc2000000) << (BMP_BIT - 32), /* 152 -- 7, 61 */
BMP_C(0xc25a5600) << (BMP_BIT - 32), /* 153 -- 24, c25a56 */
BMP_C(0xc2b70000) << (BMP_BIT - 32), /* 154 -- 16, c2b7 */
BMP_C(0xc2b80000) << (BMP_BIT - 32), /* 155 -- 14, 30ae */
BMP_C(0xc4000000) << (BMP_BIT - 32), /* 156 -- 8, c4 */
BMP_C(0xc6c60000) << (BMP_BIT - 32), /* 157 -- 16, c6c6 */
BMP_C(0xc7000000) << (BMP_BIT - 32), /* 158 -- 8, c7 */
BMP_C(0xc704dd7b) << (BMP_BIT - 32), /* 159 -- 32,c704dd7b */
BMP_C(0xc8000000) << (BMP_BIT - 32), /* 160 -- 5, 19 */
BMP_C(0xc8670000) << (BMP_BIT - 32), /* 161 -- 16, c867 */
BMP_C(0xcbf43926) << (BMP_BIT - 32), /* 162 -- 32,cbf43926 */
BMP_C(0xcde70300) << (BMP_BIT - 32), /* 163 -- 24, cde703 */
BMP_C(0xce3c0000) << (BMP_BIT - 32), /* 164 -- 16, ce3c */
BMP_C(0xd0000000) << (BMP_BIT - 32), /* 165 -- 8, d0 */
BMP_C(0xd02a0000) << (BMP_BIT - 32), /* 166 -- 15, 6815 */
BMP_C(0xd0db0000) << (BMP_BIT - 32), /* 167 -- 16, d0db */
BMP_C(0xd3100000) << (BMP_BIT - 32), /* 168 -- 12, d31 */
BMP_C(0xd3be9568) << (BMP_BIT - 32), /* 169 -- 30,34efa55a */
BMP_C(0xd4d00000) << (BMP_BIT - 32), /* 170 -- 12, d4d */
BMP_C(0xd5000000) << (BMP_BIT - 32), /* 171 -- 8, d5 */
BMP_C(0xd64e0000) << (BMP_BIT - 32), /* 172 -- 16, d64e */
BMP_C(0xda000000) << (BMP_BIT - 32), /* 173 -- 8, da */
BMP_C(0xdaf00000) << (BMP_BIT - 32), /* 174 -- 12, daf */
BMP_C(0xdebb20e3) << (BMP_BIT - 32), /* 175 -- 32,debb20e3 */
BMP_C(0xdf000000) << (BMP_BIT - 32), /* 176 -- 8, df */
BMP_C(0xe0000000) << (BMP_BIT - 32), /* 177 -- 3, 7 */
BMP_C(0xe3069283) << (BMP_BIT - 32), /* 178 -- 32,e3069283 */
BMP_C(0xe3940000) << (BMP_BIT - 32), /* 179 -- 16, e394 */
BMP_C(0xe5cc0000) << (BMP_BIT - 32), /* 180 -- 16, e5cc */
BMP_C(0xe7a80000) << (BMP_BIT - 32), /* 181 -- 13, 1cf5 */
BMP_C(0xe8000000) << (BMP_BIT - 32), /* 182 -- 6, 3a */
BMP_C(0xea000000) << (BMP_BIT - 32), /* 183 -- 7, 75 */
BMP_C(0xea820000) << (BMP_BIT - 32), /* 184 -- 16, ea82 */
BMP_C(0xec000000) << (BMP_BIT - 32), /* 185 -- 6, 3b */
BMP_C(0xf0000000) << (BMP_BIT - 32), /* 186 -- 4, f */
BMP_C(0xf0b80000) << (BMP_BIT - 32), /* 187 -- 16, f0b8 */
BMP_C(0xf1300000) << (BMP_BIT - 32), /* 188 -- 12, f13 */
BMP_C(0xf4000000) << (BMP_BIT - 32), /* 189 -- 8, f4 */
BMP_C(0xf4acfb13) << (BMP_BIT - 32), /* 190 -- 32,f4acfb13 */
BMP_C(0xf5b00000) << (BMP_BIT - 32), /* 191 -- 12, f5b */
BMP_C(0xf6400000) << (BMP_BIT - 32), /* 192 -- 10, 3d9 */
BMP_C(0xf7000000) << (BMP_BIT - 32), /* 193 -- 8, f7 */
BMP_C(0xf8000000) << (BMP_BIT - 32), /* 194 -- 5, 1f */
BMP_C(0xfc000000) << (BMP_BIT - 32), /* 195 -- 6, 3f */
BMP_C(0xfc891918) << (BMP_BIT - 32), /* 196 -- 32,fc891918 */
BMP_C(0xfd000000) << (BMP_BIT - 32), /* 197 -- 8, fd */
BMP_C(0xfe000000) << (BMP_BIT - 32), /* 198 -- 7, 7f */
BMP_C(0xfedcba00) << (BMP_BIT - 32), /* 199 -- 24, fedcba */
BMP_C(0xfee80000) << (BMP_BIT - 32), /* 200 -- 16, fee8 */
BMP_C(0xff000000) << (BMP_BIT - 32), /* 201 -- 8, ff */
BMP_C(0xffc00000) << (BMP_BIT - 32), /* 202 -- 10, 3ff */
BMP_C(0xfff00000) << (BMP_BIT - 32), /* 203 -- 12, fff */
BMP_C(0xfffc0000) << (BMP_BIT - 32), /* 204 -- 14, 3fff */
BMP_C(0xffff0000) << (BMP_BIT - 32), /* 205 -- 16, ffff */
BMP_C(0xffffff00) << (BMP_BIT - 32), /* 206 -- 24, ffffff */
BMP_C(0xfffffffc) << (BMP_BIT - 32), /* 207 -- 30,3fffffff */
BMP_C(0xfffffffe) << (BMP_BIT - 32), /* 208 -- 31,7fffffff */
BMP_C(0xffffffff) << (BMP_BIT - 32), /* 209 -- 32,ffffffff */
BMP_C(0x00010000) << (BMP_BIT - 32), /* 1 -- 16, 0001 */
BMP_C(0x00020000) << (BMP_BIT - 32), /* 2 -- 15, 0001 */
BMP_C(0x00065b00) << (BMP_BIT - 32), /* 3 -- 24, 00065b */
BMP_C(0x007e0000) << (BMP_BIT - 32), /* 4 -- 16, 007e */
BMP_C(0x007f0000) << (BMP_BIT - 32), /* 5 -- 16, 007f */
BMP_C(0x03400000) << (BMP_BIT - 32), /* 6 -- 11, 01a */
BMP_C(0x0376e6e7) << (BMP_BIT - 32), /* 7 -- 32,0376e6e7 */
BMP_C(0x04c11db7) << (BMP_BIT - 32), /* 8 -- 32,04c11db7 */
BMP_C(0x05890000) << (BMP_BIT - 32), /* 9 -- 16, 0589 */
BMP_C(0x07000000) << (BMP_BIT - 32), /* 10 -- 8, 07 */
BMP_C(0x080b0000) << (BMP_BIT - 32), /* 11 -- 16, 080b */
BMP_C(0x09823b6e) << (BMP_BIT - 32), /* 12 -- 31,04c11db7 */
BMP_C(0x0b3c0000) << (BMP_BIT - 32), /* 13 -- 15, 059e */
BMP_C(0x0c000000) << (BMP_BIT - 32), /* 14 -- 6, 03 */
BMP_C(0x0c200000) << (BMP_BIT - 32), /* 15 -- 11, 061 */
BMP_C(0x0c780000) << (BMP_BIT - 32), /* 16 -- 14, 031e */
BMP_C(0x0fb30000) << (BMP_BIT - 32), /* 17 -- 16, 0fb3 */
BMP_C(0x10210000) << (BMP_BIT - 32), /* 18 -- 16, 1021 */
BMP_C(0x12000000) << (BMP_BIT - 32), /* 19 -- 7, 09 */
BMP_C(0x130d2afc) << (BMP_BIT - 32), /* 20 -- 30,04c34abf */
BMP_C(0x144e6300) << (BMP_BIT - 32), /* 21 -- 24, 144e63 */
BMP_C(0x15000000) << (BMP_BIT - 32), /* 22 -- 8, 15 */
BMP_C(0x1697d06a) << (BMP_BIT - 32), /* 23 -- 32,1697d06a */
BMP_C(0x17800000) << (BMP_BIT - 32), /* 24 -- 12, 178 */
BMP_C(0x18000000) << (BMP_BIT - 32), /* 25 -- 6, 06 */
BMP_C(0x19d3c8d8) << (BMP_BIT - 32), /* 26 -- 31,0ce9e46c */
BMP_C(0x1c000000) << (BMP_BIT - 32), /* 27 -- 6, 07 */
BMP_C(0x1d000000) << (BMP_BIT - 32), /* 28 -- 8, 1d */
BMP_C(0x1d0f0000) << (BMP_BIT - 32), /* 29 -- 16, 1d0f */
BMP_C(0x1dcf0000) << (BMP_BIT - 32), /* 30 -- 16, 1dcf */
BMP_C(0x1edc6f41) << (BMP_BIT - 32), /* 31 -- 32,1edc6f41 */
BMP_C(0x1f23b800) << (BMP_BIT - 32), /* 32 -- 24, 1f23b8 */
BMP_C(0x20000000) << (BMP_BIT - 32), /* 33 -- 4, 2 */
BMP_C(0x200fa500) << (BMP_BIT - 32), /* 34 -- 24, 200fa5 */
BMP_C(0x20140000) << (BMP_BIT - 32), /* 35 -- 14, 0805 */
BMP_C(0x20b40000) << (BMP_BIT - 32), /* 36 -- 14, 082d */
BMP_C(0x20fe0000) << (BMP_BIT - 32), /* 37 -- 16, 20fe */
BMP_C(0x21890000) << (BMP_BIT - 32), /* 38 -- 16, 2189 */
BMP_C(0x21cf0200) << (BMP_BIT - 32), /* 39 -- 24, 21cf02 */
BMP_C(0x23ef5200) << (BMP_BIT - 32), /* 40 -- 24, 23ef52 */
BMP_C(0x25000000) << (BMP_BIT - 32), /* 41 -- 8, 25 */
BMP_C(0x26000000) << (BMP_BIT - 32), /* 42 -- 8, 26 */
BMP_C(0x26b10000) << (BMP_BIT - 32), /* 43 -- 16, 26b1 */
BMP_C(0x27818000) << (BMP_BIT - 32), /* 44 -- 17, 04f03 */
BMP_C(0x27d00000) << (BMP_BIT - 32), /* 45 -- 13, 04fa */
BMP_C(0x28000000) << (BMP_BIT - 32), /* 46 -- 5, 05 */
BMP_C(0x29b10000) << (BMP_BIT - 32), /* 47 -- 16, 29b1 */
BMP_C(0x2f000000) << (BMP_BIT - 32), /* 48 -- 8, 2f */
BMP_C(0x30000000) << (BMP_BIT - 32), /* 49 -- 4, 3/ 5, 6 */
BMP_C(0x3010bf7f) << (BMP_BIT - 32), /* 50 -- 32,3010bf7f */
BMP_C(0x31000000) << (BMP_BIT - 32), /* 51 -- 8, 31 */
BMP_C(0x31800000) << (BMP_BIT - 32), /* 52 -- 10, 0c6 */
BMP_C(0x31c30000) << (BMP_BIT - 32), /* 53 -- 16, 31c3 */
BMP_C(0x328b6300) << (BMP_BIT - 32), /* 54 -- 24, 328b63 */
BMP_C(0x34000000) << (BMP_BIT - 32), /* 55 -- 6, 0d */
BMP_C(0x340bc6d9) << (BMP_BIT - 32), /* 56 -- 32,340bc6d9 */
BMP_C(0x37000000) << (BMP_BIT - 32), /* 57 -- 8, 37 */
BMP_C(0x38000000) << (BMP_BIT - 32), /* 58 -- 5, 07 */
BMP_C(0x39000000) << (BMP_BIT - 32), /* 59 -- 8, 39 */
BMP_C(0x3d650000) << (BMP_BIT - 32), /* 60 -- 16, 3d65 */
BMP_C(0x3e000000) << (BMP_BIT - 32), /* 61 -- 8, 3e */
BMP_C(0x40000000) << (BMP_BIT - 32), /* 62 -- 3, 2 */
BMP_C(0x42000000) << (BMP_BIT - 32), /* 63 -- 8, 42 */
BMP_C(0x44c20000) << (BMP_BIT - 32), /* 64 -- 16, 44c2 */
BMP_C(0x45270551) << (BMP_BIT - 32), /* 65 -- 32,45270551 */
BMP_C(0x48000000) << (BMP_BIT - 32), /* 66 -- 5, 09 */
BMP_C(0x49000000) << (BMP_BIT - 32), /* 67 -- 8, 49 */
BMP_C(0x4a800000) << (BMP_BIT - 32), /* 68 -- 10, 12a */
BMP_C(0x4acc0000) << (BMP_BIT - 32), /* 69 -- 15, 2566 */
BMP_C(0x4b000000) << (BMP_BIT - 32), /* 70 -- 8, 4b */
BMP_C(0x4b370000) << (BMP_BIT - 32), /* 71 -- 16, 4b37 */
BMP_C(0x4c000000) << (BMP_BIT - 32), /* 72 -- 6, 13 */
BMP_C(0x4c060000) << (BMP_BIT - 32), /* 73 -- 16, 4c06 */
BMP_C(0x53000000) << (BMP_BIT - 32), /* 74 -- 8, 53 */
BMP_C(0x55000000) << (BMP_BIT - 32), /* 75 -- 8, 55 */
BMP_C(0x55555500) << (BMP_BIT - 32), /* 76 -- 24, 555555 */
BMP_C(0x59350000) << (BMP_BIT - 32), /* 77 -- 16, 5935 */
BMP_C(0x5d380000) << (BMP_BIT - 32), /* 78 -- 16, 5d38 */
BMP_C(0x5d400000) << (BMP_BIT - 32), /* 79 -- 10, 175 */
BMP_C(0x5d6dcb00) << (BMP_BIT - 32), /* 80 -- 24, 5d6dcb */
BMP_C(0x60000000) << (BMP_BIT - 32), /* 81 -- 3, 3 */
BMP_C(0x60e00000) << (BMP_BIT - 32), /* 82 -- 11, 307 */
BMP_C(0x63d00000) << (BMP_BIT - 32), /* 83 -- 16, 63d0 */
BMP_C(0x64000000) << (BMP_BIT - 32), /* 84 -- 6, 19 */
BMP_C(0x66400000) << (BMP_BIT - 32), /* 85 -- 10, 199 */
BMP_C(0x66c50000) << (BMP_BIT - 32), /* 86 -- 16, 66c5 */
BMP_C(0x6f630000) << (BMP_BIT - 32), /* 87 -- 16, 6f63 */
BMP_C(0x6f910000) << (BMP_BIT - 32), /* 88 -- 16, 6f91 */
BMP_C(0x70000000) << (BMP_BIT - 32), /* 89 -- 4, 7 */
BMP_C(0x70a00000) << (BMP_BIT - 32), /* 90 -- 11, 385 */
BMP_C(0x755b0000) << (BMP_BIT - 32), /* 91 -- 16, 755b */
BMP_C(0x765e7680) << (BMP_BIT - 32), /* 92 -- 32,765e7680 */
BMP_C(0x76c20800) << (BMP_BIT - 32), /* 93 -- 32, 0ed841 */
BMP_C(0x7979bd00) << (BMP_BIT - 32), /* 94 -- 24, 7979bd */
BMP_C(0x7e000000) << (BMP_BIT - 32), /* 95 -- 8, 7e */
BMP_C(0x80000000) << (BMP_BIT - 32), /* 96 -- 3, 4 */
BMP_C(0x80006300) << (BMP_BIT - 32), /* 97 -- 24, 800063 */
BMP_C(0x80050000) << (BMP_BIT - 32), /* 98 -- 16, 8005 */
BMP_C(0x800d0000) << (BMP_BIT - 32), /* 99 -- 16, 800d */
BMP_C(0x800fe300) << (BMP_BIT - 32), /* 100 -- 24, 800fe3 */
BMP_C(0x80b40000) << (BMP_BIT - 32), /* 101 -- 14, 202d */
BMP_C(0x80c2e71c) << (BMP_BIT - 32), /* 102 -- 30,2030b9c7 */
BMP_C(0x80f00000) << (BMP_BIT - 32), /* 103 -- 12, 80f */
BMP_C(0x814141ab) << (BMP_BIT - 32), /* 104 -- 32,814141ab */
BMP_C(0x8144c800) << (BMP_BIT - 32), /* 105 -- 21, 102899 */
BMP_C(0x864cfb00) << (BMP_BIT - 32), /* 106 -- 24, 864cfb */
BMP_C(0x87315576) << (BMP_BIT - 32), /* 107 -- 32,87315576 */
BMP_C(0x89ec0000) << (BMP_BIT - 32), /* 108 -- 16, 89ec */
BMP_C(0x8a000000) << (BMP_BIT - 32), /* 109 -- 7, 45 */
BMP_C(0x8b320000) << (BMP_BIT - 32), /* 110 -- 15, 4599 */
BMP_C(0x8bb70000) << (BMP_BIT - 32), /* 111 -- 16, 8bb7 */
BMP_C(0x8cc00000) << (BMP_BIT - 32), /* 112 -- 10, 233 */
BMP_C(0x904cddbf) << (BMP_BIT - 32), /* 113 -- 32,904cddbf */
BMP_C(0x906e0000) << (BMP_BIT - 32), /* 114 -- 16, 906e */
BMP_C(0x94000000) << (BMP_BIT - 32), /* 115 -- 8, 94 */
BMP_C(0x97000000) << (BMP_BIT - 32), /* 116 -- 8, 97 */
BMP_C(0x98000000) << (BMP_BIT - 32), /* 117 -- 6, 26 */
BMP_C(0x99000000) << (BMP_BIT - 32), /* 118 -- 8, 99 */
BMP_C(0x9b000000) << (BMP_BIT - 32), /* 119 -- 8, 9b */
BMP_C(0x9c000000) << (BMP_BIT - 32), /* 120 -- 6, 27 */
BMP_C(0x9d5e4de2) << (BMP_BIT - 32), /* 121 -- 31,4eaf26f1 */
BMP_C(0x9e000000) << (BMP_BIT - 32), /* 122 -- 7, 4f */
BMP_C(0x9ecf0000) << (BMP_BIT - 32), /* 123 -- 16, 9ecf */
BMP_C(0xa0660000) << (BMP_BIT - 32), /* 124 -- 16, a066 */
BMP_C(0xa0970000) << (BMP_BIT - 32), /* 125 -- 16, a097 */
BMP_C(0xa1000000) << (BMP_BIT - 32), /* 126 -- 8, a1 */
BMP_C(0xa3660000) << (BMP_BIT - 32), /* 127 -- 16, a366 */
BMP_C(0xa6000000) << (BMP_BIT - 32), /* 128 -- 7, 53 */
BMP_C(0xa7000000) << (BMP_BIT - 32), /* 129 -- 8, a7 */
BMP_C(0xa8000000) << (BMP_BIT - 32), /* 130 -- 5, 15 */
BMP_C(0xa8190000) << (BMP_BIT - 32), /* 131 -- 16, a819 */
BMP_C(0xa833982b) << (BMP_BIT - 32), /* 132 -- 32,a833982b */
BMP_C(0xabcdef00) << (BMP_BIT - 32), /* 133 -- 24, abcdef */
BMP_C(0xac000000) << (BMP_BIT - 32), /* 134 -- 8, ac */
BMP_C(0xaee70000) << (BMP_BIT - 32), /* 135 -- 16, aee7 */
BMP_C(0xb0000000) << (BMP_BIT - 32), /* 136 -- 4, b */
BMP_C(0xb0010000) << (BMP_BIT - 32), /* 137 -- 16, b001 */
BMP_C(0xb2aa0000) << (BMP_BIT - 32), /* 138 -- 16, b2aa */
BMP_C(0xb3400000) << (BMP_BIT - 32), /* 139 -- 12, b34 */
BMP_C(0xb42d8000) << (BMP_BIT - 32), /* 140 -- 17, 1685b */
BMP_C(0xb4600000) << (BMP_BIT - 32), /* 141 -- 11, 5a3 */
BMP_C(0xb4c80000) << (BMP_BIT - 32), /* 142 -- 16, b4c8 */
BMP_C(0xb4f3e600) << (BMP_BIT - 32), /* 143 -- 24, b4f3e6 */
BMP_C(0xb704ce00) << (BMP_BIT - 32), /* 144 -- 24, b704ce */
BMP_C(0xb798b438) << (BMP_BIT - 32), /* 145 -- 32,b798b438 */
BMP_C(0xbb3d0000) << (BMP_BIT - 32), /* 146 -- 16, bb3d */
BMP_C(0xbc000000) << (BMP_BIT - 32), /* 147 -- 6,2f/ 8,bc */
BMP_C(0xbd0be338) << (BMP_BIT - 32), /* 148 -- 32,bd0be338 */
BMP_C(0xbdf40000) << (BMP_BIT - 32), /* 149 -- 16, bdf4 */
BMP_C(0xbf050000) << (BMP_BIT - 32), /* 150 -- 16, bf05 */
BMP_C(0xc0000000) << (BMP_BIT - 32), /* 151 -- 3, 6 */
BMP_C(0xc2000000) << (BMP_BIT - 32), /* 152 -- 7, 61 */
BMP_C(0xc25a5600) << (BMP_BIT - 32), /* 153 -- 24, c25a56 */
BMP_C(0xc2b70000) << (BMP_BIT - 32), /* 154 -- 16, c2b7 */
BMP_C(0xc2b80000) << (BMP_BIT - 32), /* 155 -- 14, 30ae */
BMP_C(0xc4000000) << (BMP_BIT - 32), /* 156 -- 8, c4 */
BMP_C(0xc6c60000) << (BMP_BIT - 32), /* 157 -- 16, c6c6 */
BMP_C(0xc7000000) << (BMP_BIT - 32), /* 158 -- 8, c7 */
BMP_C(0xc704dd7b) << (BMP_BIT - 32), /* 159 -- 32,c704dd7b */
BMP_C(0xc8000000) << (BMP_BIT - 32), /* 160 -- 5, 19 */
BMP_C(0xc8670000) << (BMP_BIT - 32), /* 161 -- 16, c867 */
BMP_C(0xcbf43926) << (BMP_BIT - 32), /* 162 -- 32,cbf43926 */
BMP_C(0xcde70300) << (BMP_BIT - 32), /* 163 -- 24, cde703 */
BMP_C(0xce3c0000) << (BMP_BIT - 32), /* 164 -- 16, ce3c */
BMP_C(0xd0000000) << (BMP_BIT - 32), /* 165 -- 8, d0 */
BMP_C(0xd02a0000) << (BMP_BIT - 32), /* 166 -- 15, 6815 */
BMP_C(0xd0db0000) << (BMP_BIT - 32), /* 167 -- 16, d0db */
BMP_C(0xd3100000) << (BMP_BIT - 32), /* 168 -- 12, d31 */
BMP_C(0xd3be9568) << (BMP_BIT - 32), /* 169 -- 30,34efa55a */
BMP_C(0xd4d00000) << (BMP_BIT - 32), /* 170 -- 12, d4d */
BMP_C(0xd5000000) << (BMP_BIT - 32), /* 171 -- 8, d5 */
BMP_C(0xd64e0000) << (BMP_BIT - 32), /* 172 -- 16, d64e */
BMP_C(0xda000000) << (BMP_BIT - 32), /* 173 -- 8, da */
BMP_C(0xdaf00000) << (BMP_BIT - 32), /* 174 -- 12, daf */
BMP_C(0xdebb20e3) << (BMP_BIT - 32), /* 175 -- 32,debb20e3 */
BMP_C(0xdf000000) << (BMP_BIT - 32), /* 176 -- 8, df */
BMP_C(0xe0000000) << (BMP_BIT - 32), /* 177 -- 3, 7 */
BMP_C(0xe3069283) << (BMP_BIT - 32), /* 178 -- 32,e3069283 */
BMP_C(0xe3940000) << (BMP_BIT - 32), /* 179 -- 16, e394 */
BMP_C(0xe5cc0000) << (BMP_BIT - 32), /* 180 -- 16, e5cc */
BMP_C(0xe7a80000) << (BMP_BIT - 32), /* 181 -- 13, 1cf5 */
BMP_C(0xe8000000) << (BMP_BIT - 32), /* 182 -- 6, 3a */
BMP_C(0xea000000) << (BMP_BIT - 32), /* 183 -- 7, 75 */
BMP_C(0xea820000) << (BMP_BIT - 32), /* 184 -- 16, ea82 */
BMP_C(0xec000000) << (BMP_BIT - 32), /* 185 -- 6, 3b */
BMP_C(0xf0000000) << (BMP_BIT - 32), /* 186 -- 4, f */
BMP_C(0xf0b80000) << (BMP_BIT - 32), /* 187 -- 16, f0b8 */
BMP_C(0xf1300000) << (BMP_BIT - 32), /* 188 -- 12, f13 */
BMP_C(0xf4000000) << (BMP_BIT - 32), /* 189 -- 8, f4 */
BMP_C(0xf4acfb13) << (BMP_BIT - 32), /* 190 -- 32,f4acfb13 */
BMP_C(0xf5b00000) << (BMP_BIT - 32), /* 191 -- 12, f5b */
BMP_C(0xf6400000) << (BMP_BIT - 32), /* 192 -- 10, 3d9 */
BMP_C(0xf7000000) << (BMP_BIT - 32), /* 193 -- 8, f7 */
BMP_C(0xf8000000) << (BMP_BIT - 32), /* 194 -- 5, 1f */
BMP_C(0xfc000000) << (BMP_BIT - 32), /* 195 -- 6, 3f */
BMP_C(0xfc891918) << (BMP_BIT - 32), /* 196 -- 32,fc891918 */
BMP_C(0xfd000000) << (BMP_BIT - 32), /* 197 -- 8, fd */
BMP_C(0xfe000000) << (BMP_BIT - 32), /* 198 -- 7, 7f */
BMP_C(0xfedcba00) << (BMP_BIT - 32), /* 199 -- 24, fedcba */
BMP_C(0xfee80000) << (BMP_BIT - 32), /* 200 -- 16, fee8 */
BMP_C(0xff000000) << (BMP_BIT - 32), /* 201 -- 8, ff */
BMP_C(0xffc00000) << (BMP_BIT - 32), /* 202 -- 10, 3ff */
BMP_C(0xfff00000) << (BMP_BIT - 32), /* 203 -- 12, fff */
BMP_C(0xfffc0000) << (BMP_BIT - 32), /* 204 -- 14, 3fff */
BMP_C(0xffff0000) << (BMP_BIT - 32), /* 205 -- 16, ffff */
BMP_C(0xffffff00) << (BMP_BIT - 32), /* 206 -- 24, ffffff */
BMP_C(0xfffffffc) << (BMP_BIT - 32), /* 207 -- 30,3fffffff */
BMP_C(0xfffffffe) << (BMP_BIT - 32), /* 208 -- 31,7fffffff */
BMP_C(0xffffffff) << (BMP_BIT - 32), /* 209 -- 32,ffffffff */
};
static const struct malias aliases[];
+1 -1
View File
@@ -168,4 +168,4 @@ def main():
if __name__ == '__main__':
main()
main()
+1 -1
View File
@@ -106,4 +106,4 @@ def main():
if __name__ == "__main__":
main()
main()
+14 -13
View File
@@ -263,9 +263,9 @@ static int CmdBwmCharge(const char *Cmd) {
"Enable or disable BWM battery charging by clearing/setting the\n"
"AW32001E charge-enable bit (CEB, REG01[3]). PM5 only.\n"
_RED_("One-shot:") " the charger watchdog reverts this after ~160 s unless\n"
"serviced, so charging may stop on its own. Use to nudge a top-up.",
"hw bwm charge off --> disable charging\n"
"hw bwm charge on --> enable charging");
"serviced, so charging may stop on its own. Use to nudge a top-up.",
"hw bwm charge off --> disable charging\n"
"hw bwm charge on --> enable charging");
void *argtable[] = {
arg_param_begin,
arg_param_end
@@ -388,12 +388,12 @@ static int CmdBwmSetCap(const char *Cmd) {
static void progressbar(long sent, long total, int style) {
int percent = (int)((double)sent / total * 100);
// Use \r at the start to move the cursor back to the beginning of the line
printf("\rProgress: [%d%%]", percent);
printf("\rProgress: [%d%%]", percent);
// Force stdout to print immediately without waiting for a newline
fflush(stdout);
fflush(stdout);
}
// One full OTA attempt: BEGIN -> WRITE... -> END. The BWM OTA has no resume
@@ -406,8 +406,9 @@ static int bwm_ota_once(const uint8_t *fw, size_t fwlen, uint32_t write_delay_ms
// OTA slot here; that can take 20-40 s on a 4 MB ESP32-C2, so wait longer
// than the device-side 60 s timeout plus USB round-trip.
uint8_t beg[5] = { BWM_OTA_ACTION_BEGIN,
(uint8_t)(fwlen & 0xFF), (uint8_t)((fwlen >> 8) & 0xFF),
(uint8_t)((fwlen >> 16) & 0xFF), (uint8_t)((fwlen >> 24) & 0xFF) };
(uint8_t)(fwlen & 0xFF), (uint8_t)((fwlen >> 8) & 0xFF),
(uint8_t)((fwlen >> 16) & 0xFF), (uint8_t)((fwlen >> 24) & 0xFF)
};
clearCommandBuffer();
SendCommandNG(CMD_PM5_BWM_ESP_OTA, beg, sizeof(beg));
if (WaitForResponseTimeout(CMD_PM5_BWM_ESP_OTA, &resp, 75000) == false) {
@@ -549,7 +550,7 @@ static int CmdBWMUpgrade(const char *Cmd) {
free(fw);
return PM3_EFILE;
}
// Check Chip ID at offset 0x0C (2 bytes, little-endian)
uint16_t chip_id = MemLeToUint2byte(fw + 0x0C);
if (chip_id != 0x000C) {
@@ -565,7 +566,7 @@ static int CmdBWMUpgrade(const char *Cmd) {
free(fw);
return PM3_EFILE;
}
// Record the running version first, so we can confirm the update actually took
// even when the finalize ack is lost (the case that used to discard a completed
// flash and restart from scratch).
@@ -577,8 +578,8 @@ static int CmdBWMUpgrade(const char *Cmd) {
// No resume (DEV.md 8.4): a chunk lost mid-transfer restarts the whole upload.
const int max_attempts = 6; // a single dropped chunk restarts the whole upload;
// more attempts make an all-fail run rare until per-chunk
// retry (offset-idempotent ESP write) lands.
// more attempts make an all-fail run rare until per-chunk
// retry (offset-idempotent ESP write) lands.
for (int attempt = 1; attempt <= max_attempts; attempt++) {
if (attempt > 1) {
// Abort the in-flight ESP OTA (if any) and give a slow erase a chance
+1 -1
View File
@@ -510,7 +510,7 @@ static int CmdFlashMemSpiFFSWipe(const char *Cmd) {
CLIParserInit(&ctx, "mem spiffs wipe",
_RED_("* * * Warning * * *") " \n"
_CYAN_("This command wipes all files on the device SPIFFS file system"),
"mem spiffs wipe");
"mem spiffs wipe");
void *argtable[] = {
arg_param_begin,
+2 -2
View File
@@ -138,8 +138,8 @@ static int CmdFpgaSetPowerPWM(const char *Cmd) {
arg_param_begin,
arg_lit0("l", "lf", "Set the driver voltage for LF. When not specified as LF, default setting for HF."),
arg_int0("c", "count", "<int>", "PWM output low level counting used to control the voltage of the driver. "
"The larger the value, the higher the voltage; "
"the smaller the value, the lower the voltage."),
"The larger the value, the higher the voltage; "
"the smaller the value, the lower the voltage."),
arg_param_end
};
CLIExecWithReturn(ctx, Cmd, argtable, false);
+2 -2
View File
@@ -374,13 +374,13 @@ int CmdHFTune(const char *Cmd) {
return PM3_ETIMEOUT;
}
// All three modes of this command answer under the same command id
// All three modes of this command answer under the same command id
// and there is no sequence number
if ((resp.status != PM3_SUCCESS) || (resp.length != 0)) {
PrintAndLogEx(WARNING, "unexpected reply to HF initialization (status %d, %u bytes)",
resp.status,
(unsigned)resp.length
);
);
}
mode[0] = 2;
+2 -2
View File
@@ -735,7 +735,7 @@ int Hf14443_4aGetCardData(iso14a_card_select_t *card) {
// Annex C uses CRC-B and continuous frames without parity.
static int hf14a_timeslot_exchange(const uint8_t *data, uint16_t len, bool request,
PacketResponseNG *resp, uint16_t *rlen) {
PacketResponseNG *resp, uint16_t *rlen) {
uint8_t frame[11];
if (len > sizeof(frame) - 2) {
return PM3_EINVARG;
@@ -753,7 +753,7 @@ static int hf14a_timeslot_exchange(const uint8_t *data, uint16_t len, bool reque
clearCommandBuffer();
// Timeouts in 128/fc units; inter-frame delay in microseconds.
SendIso14aReaderEx(flags, frame, len, len, request ? 7 : 0,
request ? 79 : 547, request ? 0 : 1100);
request ? 79 : 547, request ? 0 : 1100);
if (WaitForIso14aReply(resp, 1500, rlen, NULL) == false || *rlen == 0) {
return PM3_ETIMEOUT;
}
+1 -1
View File
@@ -2998,7 +2998,7 @@ static int CmdHF14BAPDU(const char *Cmd) {
arg_lit0("t", "tlv", "executes TLV decoder if it possible"),
arg_lit0(NULL, "decode", "decode apdu request if it possible"),
arg_str0("m", "make", "<hex>", "make apdu with head from this field and data from data field.\n"
" must be 4 bytes: <CLA INS P1 P2>"),
" must be 4 bytes: <CLA INS P1 P2>"),
arg_lit0("e", "extended", "make extended length apdu if `m` parameter included"),
arg_int0("l", "le", "<int>", "Le apdu parameter if `m` parameter included"),
arg_str1("d", "data", "<hex>", "<APDU | data> if `m` parameter included"),
+3 -3
View File
@@ -3526,9 +3526,9 @@ static int CmdHF15CFinalize(const char *Cmd) {
CLIParserInit(&ctx, "hf 15 cfinalize",
"Finalize a magic ISO15693 'V3' tag.\n"
_RED_("This operation is irreversible.") " After finalize the configuration\n"
"area is erased and the UID can no longer be changed. Set the UID with\n"
"`" _YELLOW_("hf 15 csetuid --v3") "` first, then lock it in with this command.",
"hf 15 cfinalize -y"
"area is erased and the UID can no longer be changed. Set the UID with\n"
"`" _YELLOW_("hf 15 csetuid --v3") "` first, then lock it in with this command.",
"hf 15 cfinalize -y"
);
void *argtable[] = {
+6 -6
View File
@@ -1937,8 +1937,8 @@ static void felica_info_process_system_services(int level, uint8_t flags,
json_t *data_json = json_object_get(node_json, "data");
const bool has_data_matchers = json_is_object(data_json) && (json_object_size(data_json) > 0);
const size_t matcher_count = felica_parse_service_node_matchers(node_json,
nodes[node_count].matchers,
ARRAYLEN(nodes[node_count].matchers));
nodes[node_count].matchers,
ARRAYLEN(nodes[node_count].matchers));
if (has_data_matchers && matcher_count == 0) {
continue;
}
@@ -2345,9 +2345,9 @@ static int discover_systems(uint8_t flags, const uint8_t *primary_idm,
for (uint32_t attempt = 0; attempt < attempts; attempt++) {
felica_syscode_response_t system_code_response;
const int request_system_code_status = send_request_system_code(flags,
sizeof(request_system_code_request), (uint8_t *)&request_system_code_request,
false, FELICA_OPTIONAL_CMD_TIMEOUT_MS, 0, false,
&system_code_response);
sizeof(request_system_code_request), (uint8_t *)&request_system_code_request,
false, FELICA_OPTIONAL_CMD_TIMEOUT_MS, 0, false,
&system_code_response);
if (request_system_code_status != PM3_SUCCESS) {
continue;
@@ -5152,7 +5152,7 @@ static int felica_discover_nodes(const uint8_t *idm,
bool discovered = false;
if (info->method == FELICA_NODE_DISCOVERY_READ_WITHOUT_ENCRYPTION) {
discovered = felica_discover_nodes_with_read_without_encryption_ex(flags, idm, retry_count, pmm,
visitor, ctx, &discovered_count, &stop_status);
visitor, ctx, &discovered_count, &stop_status);
} else {
discovered = info->run(flags, idm, retry_count, visitor, ctx, &discovered_count, &stop_status);
}
+9 -9
View File
@@ -382,7 +382,7 @@ static int hfgal_create_creds_app(DesfireContext_t *ctx, uint8_t *site_key, uint
// UID is required for key diversification
if (ctx->uidlen == 0) {
PM3_RET_ERR(PM3_EINVARG, "UID is required for key diversification. "
"Please fetch it before calling `hfgal_create_creds_app`");
"Please fetch it before calling `hfgal_create_creds_app`");
}
// Create application
@@ -872,11 +872,11 @@ static int hfgal_read_desfire_card(uint32_t aid, uint8_t *site_key, bool verbose
PM3_RET_IF_ERR_MAYBE_MSG(res, !quiet, "Failed reading card application credentials");
PrintAndLogEx(SUCCESS, "Gallagher (AID %06X) - region: " _GREEN_("%c") " ( " _GREEN_("%u") " )"
", facility: " _GREEN_("%u")
", card number: " _GREEN_("%u")
", issue level: " _GREEN_("%u"),
", facility: " _GREEN_("%u")
", card number: " _GREEN_("%u")
", issue level: " _GREEN_("%u"),
current_aid,
'A' + creds.region_code,
'A' + creds.region_code,
creds.region_code,
creds.facility_code,
creds.card_number,
@@ -1696,10 +1696,10 @@ static int CmdGallagherDecode(const char *cmd) {
gallagher_decode_creds(data_buf, &creds);
PrintAndLogEx(SUCCESS, "Gallagher - region: " _GREEN_("%c") " ( " _GREEN_("%u") " )"
", facility: " _GREEN_("%u")
", card number: " _GREEN_("%u")
", issue level: " _GREEN_("%u"),
'A' + creds.region_code,
", facility: " _GREEN_("%u")
", card number: " _GREEN_("%u")
", issue level: " _GREEN_("%u"),
'A' + creds.region_code,
creds.region_code,
creds.facility_code,
creds.card_number,
+19 -19
View File
@@ -1951,16 +1951,16 @@ static int CmdHF14aDesChk(const char *Cmd) {
if (deskeyListLen || aeskeyListLen || k3kkeyListLen) {
res = AuthCheckDesfire(&dctx,
secureChannel,
&app_ids[x * 3],
deskeyList, deskeyListLen,
aeskeyList, aeskeyListLen,
k3kkeyList, k3kkeyListLen,
autoschann,
found,
&foundKeyThisRound,
verbose
);
secureChannel,
&app_ids[x * 3],
deskeyList, deskeyListLen,
aeskeyList, aeskeyListLen,
k3kkeyList, k3kkeyListLen,
autoschann,
found,
&foundKeyThisRound,
verbose
);
if (res == PM3_EOPABORTED) {
break;
@@ -2305,11 +2305,11 @@ static int CmdHF14aDesDetect(const char *Cmd) {
uint8_t fplen;
if (dctx.keyType == T_DES ||
(
(dctx.keyType == T_3DES) &&
(keylen == 16) &&
(memcmp(candidate, candidate + 8, 8) == 0)
)) {
(
(dctx.keyType == T_3DES) &&
(keylen == 16) &&
(memcmp(candidate, candidate + 8, 8) == 0)
)) {
fp[0] = T_DES; // single DES, however it was written
memcpy(fp + 1, candidate, 8);
@@ -2398,7 +2398,7 @@ static int CmdHF14aDesDetect(const char *Cmd) {
CLIGetOptionListStr(DesfireAlgoOpts, dctx.keyType),
desfire_get_key_length(dctx.keyType),
sprint_hex_inrow(dctx.key, desfire_get_key_length(dctx.keyType))
);
);
// every key in an application uses the same algo, so the rest of
// the key numbers only have to try the one that just worked
@@ -5485,8 +5485,8 @@ static int CmdHF14ADesGetFileIDs(const char *Cmd) {
"Get File IDs list from card. Master key needs to be provided or flag --no-auth set.",
"hf mfdes getfileids --aid 123456 -> execute with defaults from `default` command\n"
"hf mfdes getfileids --dfname D2760000850100 -> select DF by name and get file IDs\n"
"hf mfdes getfileids -n 0 -t des -k 0000000000000000 --aid 123456 -> execute with default factory setup\n"
);
"hf mfdes getfileids -n 0 -t des -k 0000000000000000 --aid 123456 -> execute with default factory setup\n"
);
void *argtable[] = {
arg_param_begin,
@@ -10811,7 +10811,7 @@ static int CmdHF14ADesVerifyCert(const char *Cmd) {
arg_str0(NULL, "fid", "<hex>", "Certificate file ID (1 byte)"), // 15
arg_lit0(NULL, "no-auth", "Read certificate file without authentication"), // 16
arg_strn(NULL, "ca", "<name|cert|pubkey|path|skip>", 0, MFDES_VERIFYCERT_MAX_CAS,
"CA input, or `skip` to skip certificate signature validation. Repeat --ca for multiple entries"), // 17
"CA input, or `skip` to skip certificate signature validation. Repeat --ca for multiple entries"), // 17
arg_str0(NULL, "keyaid", "<hex>", "Key application ID (default: cert app)"), // 18
arg_str0(NULL, "keyisoid", "<hex>", "Key application ISO DF ID (2 bytes)"), // 19
arg_str0(NULL, "keydfname", "<hex>", "Key application DF name (default: cert app)"), // 20
+2 -2
View File
@@ -723,8 +723,8 @@ static int ntag424_authenticate_ev2_first(uint8_t keyno, uint8_t *key, ntag424_s
if (memcmp(response.rnd_a, &rnd_a_clear[1], 15) != 0 ||
response.rnd_a[15] != rnd_a_clear[0]) {
PrintAndLogEx(ERR, "Incorrect response from card\n"
"expected: %s\n"
"got: %s"
"expected: %s\n"
"got: %s"
, sprint_hex(rnd_a_clear, 16),
sprint_hex(response.rnd_a, 16));
return PM3_ESOFT;
+5 -5
View File
@@ -476,11 +476,11 @@ static int CmdHFHIDConfigSim(const char *Cmd) {
strncpy(uid_str, sprint_hex_inrow(uid, uidlen), sizeof(uid_str) - 1);
uid_str[sizeof(uid_str) - 1] = '\0';
PrintAndLogEx(INFO, "HID Config Card sim:"
" UID " _YELLOW_("%s")
" AID " _YELLOW_("%s")
" ATS len " _YELLOW_("%d")
" APDU overrides " _YELLOW_("%u")
" default resp " _YELLOW_("%s"),
" UID " _YELLOW_("%s")
" AID " _YELLOW_("%s")
" ATS len " _YELLOW_("%d")
" APDU overrides " _YELLOW_("%u")
" default resp " _YELLOW_("%s"),
uid_str, aid_str, ats_len, apdu_count,
has_default_resp ? sprint_hex_inrow(default_resp, default_resp_len_sz) : "9000 (builtin)");
PrintAndLogEx(INFO, "Press " _GREEN_("pm3 button") " or " _GREEN_("<Enter>") " to abort simulation");
+4 -4
View File
@@ -1894,11 +1894,11 @@ int CmdLFRelay(const char *Cmd) {
" --rdr : Reading device, act as IP client and reads LF tag and sends data\n"
" --tag : Simulation device, act as IP server and simulates relayed data\n",
_WHITE_("Device A, reading LF tag, client") "\n"
"lf relay --rdr --ip 192.168.1.141 -> Client, connect to IP 192.168.1.141:8000\n"
"lf relay --rdr --ip 192.168.1.141 -p 18111 -> Client, connect to IP 192.168.1.141:18111 \n\n"
"lf relay --rdr --ip 192.168.1.141 -> Client, connect to IP 192.168.1.141:8000\n"
"lf relay --rdr --ip 192.168.1.141 -p 18111 -> Client, connect to IP 192.168.1.141:18111 \n\n"
_WHITE_("Device B, simulate LF tag, server") "\n"
"lf relay --tag -p 8111 -> Server listening port 8111, recv 30000 samples\n"
"lf relay --tag -s 10000 -> Server listening port 8000, recv 10000 samples\n"
"lf relay --tag -p 8111 -> Server listening port 8111, recv 30000 samples\n"
"lf relay --tag -s 10000 -> Server listening port 8000, recv 10000 samples\n"
);
void *argtable[] = {
+6 -6
View File
@@ -1495,12 +1495,12 @@ static int CmdLFHitag2Restore(const char *Cmd) {
CLIParserFree(ctx);
if ((ukeylen != 0) && (ukeylen != HITAG_PASSWORD_SIZE) && (ukeylen != HITAG_CRYPTOKEY_SIZE)) {
PrintAndLogEx(ERR, "Key must be %u bytes (password) or %u bytes (crypto), got %i",
HITAG_PASSWORD_SIZE,
HITAG_CRYPTOKEY_SIZE,
ukeylen
);
HITAG_PASSWORD_SIZE,
HITAG_CRYPTOKEY_SIZE,
ukeylen
);
return PM3_EINVARG;
}
@@ -1966,7 +1966,7 @@ static int CmdLFHitagEload(const char *Cmd) {
// A Hitag u image is the 6 byte UID followed by its pages, and is the largest
// of the four. Everything still fits one NG frame.
#define HITAGU_EIMAGE_SIZE (HITAGU_UID_SIZE + (HITAGU_MAX_PAGE_ADVANCED_PLUS * HITAGU_BLOCK_SIZE))
#define HITAGU_EIMAGE_SIZE (HITAGU_UID_SIZE + (HITAGU_MAX_PAGE_ADVANCED_PLUS * HITAGU_BLOCK_SIZE))
// read dump file
uint8_t *dump = NULL;
+6 -6
View File
@@ -130,9 +130,9 @@ void annotateHitagU(char *exp, size_t size, const uint8_t *cmd, uint8_t cmdsize,
concatbits(&block_count, 0, cmd, 5 + 6 + 8, 8, false);
snprintf(exp + strlen(exp), size - strlen(exp), "READ MULTIPLE BLOCK start:%d num:%d"
, reflect8(block_addr)
, reflect8(block_count)
);
, reflect8(block_addr)
, reflect8(block_count)
);
break;
}
case HITAGU_CMD_WRITE_SINGLE_BLOCK: {
@@ -143,9 +143,9 @@ void annotateHitagU(char *exp, size_t size, const uint8_t *cmd, uint8_t cmdsize,
concatbits(block_data, 0, cmd, 5 + 6 + 8, 32, false);
snprintf(exp + strlen(exp), size - strlen(exp), "WRITE SINGLE BLOCK start:%d data:[%s]"
, reflect8(block_addr)
, sprint_hex_inrow(block_data, 4)
);
, reflect8(block_addr)
, sprint_hex_inrow(block_data, 4)
);
break;
}
case HITAGU_CMD_SELECT: {
+3 -3
View File
@@ -868,9 +868,9 @@ static int CmdT55xxReadBlock(const char *Cmd) {
_CYAN_("Use of read with password on a tag not configured") "\n"
_CYAN_("for a password can damage the tag") "\n"
_RED_(" * * * * * * * * * *"),
"lf t55xx read -b 0 --> read data from block 0\n"
"lf t55xx read -b 0 --pwd 01020304 --> read data from block 0, pwd 01020304\n"
"lf t55xx read -b 0 --pwd 01020304 -o --> read data from block 0, pwd 01020304, override\n"
"lf t55xx read -b 0 --> read data from block 0\n"
"lf t55xx read -b 0 --pwd 01020304 --> read data from block 0, pwd 01020304\n"
"lf t55xx read -b 0 --pwd 01020304 -o --> read data from block 0, pwd 01020304, override\n"
);
// 1 (help) + 4(four user specified params) + (5 T55XX_DLMODE_SINGLE)
+2 -2
View File
@@ -1473,7 +1473,7 @@ int CmdTraceListAlias(const char *Cmd, const char *alias, const char *protocol)
arg_lit0("r", NULL, "show frame delay times relative to the previous transfer"),
arg_lit0("u", NULL, "display times in microseconds instead of clock cycles"),
arg_lit0("x", NULL, "show hexdump to convert to pcap(ng)\n"
" or to import into Wireshark using encapsulation type \"ISO 14443\""),
" or to import into Wireshark using encapsulation type \"ISO 14443\""),
arg_str0("f", "file", "<fn>", "filename of dictionary"),
arg_param_end
};
@@ -1528,7 +1528,7 @@ int CmdTraceList(const char *Cmd) {
arg_lit0("r", NULL, "show frame delay times relative to the previous transfer"),
arg_lit0("u", NULL, "display times in microseconds instead of clock cycles"),
arg_lit0("x", NULL, "show hexdump to convert to pcap(ng)\n"
" or to import into Wireshark using encapsulation type \"ISO 14443\""),
" or to import into Wireshark using encapsulation type \"ISO 14443\""),
arg_str0("t", "type", "<str>", "protocol to annotate the trace"),
arg_str0("f", "file", "<fn>", "filename of dictionary"),
arg_param_end
+1 -1
View File
@@ -100,7 +100,7 @@ bool WaitForTxIdle(uint32_t ms_timeout) {
if (msclock() - start >= ms_timeout) {
return false;
}
xyield(); // just to avoid CPU busy loop
}
}
+2 -2
View File
@@ -187,8 +187,8 @@ bool path_is_absolute(const char *path) {
/**
* @brief expands a leading "~" into the user home directory.
*
* The pm3 prompt is not a shell, so nobody expands "~" for us and it wouldotherwise be taken as a directory named "~".
*
* The pm3 prompt is not a shell, so nobody expands "~" for us and it wouldotherwise be taken as a directory named "~".
*
* "~user/..." is not supported and is returned unchanged.
*
* @param path
+1 -1
View File
@@ -173,7 +173,7 @@ static int build_segs_from_phdrs(flash_file_t *ctx, flash_dev_t *flash_dev) {
offset);
if (filesz != memsz) {
PrintAndLogEx(ERR, "Error: PHDR file size does not equal memory size\n"
"(DATA+BSS PHDRs do not make sense on ROM platforms!)");
"(DATA+BSS PHDRs do not make sense on ROM platforms!)");
return PM3_EFILE;
}
if (paddr < last_end) {
+4 -4
View File
@@ -300,10 +300,10 @@ void print_gallagher_creds(GallagherCredentials_t *creds) {
return;
}
PrintAndLogEx(SUCCESS, "Gallagher - region: " _GREEN_("%c") " ( " _GREEN_("%u") " )"
", facility: " _GREEN_("%u")
", card number: " _GREEN_("%u")
", issue level: " _GREEN_("%u"),
'A' + creds->region_code,
", facility: " _GREEN_("%u")
", card number: " _GREEN_("%u")
", issue level: " _GREEN_("%u"),
'A' + creds->region_code,
creds->region_code,
creds->facility_code,
creds->card_number,
+41 -41
View File
@@ -366,24 +366,24 @@ int hexact_parser_parse(const uint8_t *dump, size_t dumplen) {
PrintAndLogEx(INFO, "Payload............ sector %u and %u, " _YELLOW_("%s"),
HEXACT_DATA_SECTOR_A, HEXACT_DATA_SECTOR_B,
all_ff ? "erased, card not personalised" : "not read"
);
);
return PM3_SUCCESS;
}
PrintAndLogEx(INFO, "Payload............ sector %u and %u, " _YELLOW_("mask removed"),
HEXACT_DATA_SECTOR_A,
HEXACT_DATA_SECTOR_B
);
HEXACT_DATA_SECTOR_A,
HEXACT_DATA_SECTOR_B
);
for (uint8_t i = 0; i < HEXACT_PAYLOAD_BLOCKS; i++) {
char line[(2 * 16) + 4] = {0};
str_append(line, sizeof(line), "%s ", sprint_hex_inrow(rec[i], 8));
str_append(line, sizeof(line), "%s", sprint_hex_inrow(rec[i] + 8, 8));
PrintAndLogEx(INFO, " sector %2u blk %u.. %s",
hexact_payload[i].sector,
hexact_payload[i].blk,
line
);
hexact_payload[i].sector,
hexact_payload[i].blk,
line
);
}
const uint8_t *uid = dump;
@@ -425,16 +425,16 @@ int hexact_parser_parse(const uint8_t *dump, size_t dumplen) {
uint8_t pt[MFBLOCK_SIZE];
hexact_decrypt(spare, HEXACT_DATA_SECTOR_B, 2, pt);
PrintAndLogEx(INFO, " sector %2u blk 2.. %s " _YELLOW_("( other generation )"),
HEXACT_DATA_SECTOR_B,
sprint_hex_inrow(pt, MFBLOCK_SIZE)
);
HEXACT_DATA_SECTOR_B,
sprint_hex_inrow(pt, MFBLOCK_SIZE)
);
}
if (wiped == false) {
PrintAndLogEx(INFO, "Cross checks....... %u / %u ( %s )", pass, total,
(pass == total) ? _GREEN_("bound bytes agree with sector 0, 15 and the UID")
: _RED_("bound bytes disagree, see above")
);
: _RED_("bound bytes disagree, see above")
);
}
// two badges of one building carry the same row, two buildings never do
@@ -583,10 +583,10 @@ int hexact_selftest(void) {
uint8_t rec[HEXACT_PAYLOAD_BLOCKS][MFBLOCK_SIZE];
for (uint8_t i = 0; i < HEXACT_PAYLOAD_BLOCKS; i++) {
hexact_decrypt(dump + ((mfFirstBlockOfSector(hexact_payload[i].sector) + hexact_payload[i].blk) * MFBLOCK_SIZE),
hexact_payload[i].sector,
hexact_payload[i].blk,
rec[i]
);
hexact_payload[i].sector,
hexact_payload[i].blk,
rec[i]
);
}
bool written[HEXACT_PAYLOAD_BLOCKS];
@@ -594,20 +594,20 @@ int hexact_selftest(void) {
uint8_t total = 0;
uint8_t pass = hexact_cross_check(
rec,
dump + (2 * MFBLOCK_SIZE),
dump,
dump + (mfFirstBlockOfSector(HEXACT_ID_SECTOR) + 2) * MFBLOCK_SIZE,
written,
&total,
false
);
rec,
dump + (2 * MFBLOCK_SIZE),
dump,
dump + (mfFirstBlockOfSector(HEXACT_ID_SECTOR) + 2) * MFBLOCK_SIZE,
written,
&total,
false
);
PrintAndLogEx(INFO, " intact card........ %u / %u ( %s )",
pass,
total,
(pass == total) ? _GREEN_("ok") : _RED_("fail")
);
pass,
total,
(pass == total) ? _GREEN_("ok") : _RED_("fail")
);
if (pass != total) {
return PM3_ESOFT;
@@ -615,20 +615,20 @@ int hexact_selftest(void) {
dump[0] ^= 0x01;
uint8_t broken = hexact_cross_check(
rec,
dump + (2 * MFBLOCK_SIZE),
dump,
dump + (mfFirstBlockOfSector(HEXACT_ID_SECTOR) + 2) * MFBLOCK_SIZE,
written,
&total,
false
);
rec,
dump + (2 * MFBLOCK_SIZE),
dump,
dump + (mfFirstBlockOfSector(HEXACT_ID_SECTOR) + 2) * MFBLOCK_SIZE,
written,
&total,
false
);
PrintAndLogEx(INFO, " one UID bit flipped %u / %u ( %s )"
, broken
, total
, (broken == total - 4) ? _GREEN_("ok") : _RED_("fail")
);
, broken
, total
, (broken == total - 4) ? _GREEN_("ok") : _RED_("fail")
);
if (broken != total - 4) {
return PM3_ESOFT;
+3 -3
View File
@@ -103,7 +103,7 @@ int proac_parser_parse(const uint8_t *dump, size_t dumplen) {
PROAC_MAD_AID,
mad_count_aid(s0, PROAC_MAD_AID),
MAD1_NUM_AIDS
);
);
// The one card this was written against carries a MAD whose CRC was never
// filled in, so a reader in this system cannot be validating it. Say so
@@ -133,9 +133,9 @@ int proac_parser_parse(const uint8_t *dump, size_t dumplen) {
}
PrintAndLogEx(INFO, "Payload............ sector %u and %u, 96 bytes, " _YELLOW_("not decoded"),
PROAC_BLOB_SECTOR_A,
PROAC_BLOB_SECTOR_A,
PROAC_BLOB_SECTOR_B
);
);
const uint8_t sectors[2] = { PROAC_BLOB_SECTOR_A, PROAC_BLOB_SECTOR_B };
+16 -16
View File
@@ -94,7 +94,7 @@ static uint8_t vigik_shadow(uint8_t b) {
}
// Recover the message an ISO 9796-1 signature carries, checking the redundancy on
// the way. `sig` is the signature as it sits on the card, `modulus` the public key to try.
// the way. `sig` is the signature as it sits on the card, `modulus` the public key to try.
// On success msg holds msglen bytes.
static int vigik_iso9796_recover(const uint8_t *sig, const char *modulus, uint8_t *msg, size_t *msglen) {
@@ -217,15 +217,15 @@ static void vigik_print_date(const char *label, const uint8_t *v, const char *su
if (sane) {
PrintAndLogEx(INFO, "%s %s ( " _YELLOW_("%04u-%02u-%02u %02u:%02u") " )%s",
label,
sprint_hex_inrow(v, 5),
1900 + v[0],
v[1],
v[2],
v[3],
v[4],
suffix
);
label,
sprint_hex_inrow(v, 5),
1900 + v[0],
v[1],
v[2],
v[3],
v[4],
suffix
);
} else {
PrintAndLogEx(INFO, "%s %s" "%s", label, sprint_hex_inrow(v, 5), suffix);
}
@@ -296,10 +296,10 @@ int vigik_verify(mfc_vigik_t *d) {
// The service code on the card says which service issued it, so it should name the key
if (vigik_rsa_pk[i].code != (uint16_t)d->service_code) {
PrintAndLogEx(WARNING, "Card says service 0x%04X but the key that verified is listed as 0x%04X ( %s )",
(uint16_t)d->service_code,
vigik_rsa_pk[i].code,
(uint16_t)d->service_code,
vigik_rsa_pk[i].code,
vigik_rsa_pk[i].desc
);
);
}
PrintAndLogEx(SUCCESS, "Signature verification: " _GREEN_("successful"));
@@ -600,9 +600,9 @@ static int vigik_print_urmet_captiv(const uint8_t *dump, size_t dumplen) {
char num[URMET_DIGITS_LEN + 1] = {0};
memcpy(num, b1 + URMET_DIGITS_OFF, URMET_DIGITS_LEN);
PrintAndLogEx(INFO, "Number............. " _YELLOW_("%s") "%s"
, num
, (strspn(num, "0") == URMET_DIGITS_LEN) ? " ( all zero, unset )" : ""
);
, num
, (strspn(num, "0") == URMET_DIGITS_LEN) ? " ( all zero, unset )" : ""
);
} else {
PrintAndLogEx(INFO, "Number............. %s ( not ASCII digits )", sprint_hex_inrow(b1 + URMET_DIGITS_OFF, URMET_DIGITS_LEN));
}
+3 -3
View File
@@ -2756,9 +2756,9 @@ static int _wrap_new_pm3(lua_State *L) {
}
SWIG_Lua_pusherrstring(L, "Wrong arguments for overloaded function 'new_pm3'\n"
" Possible C/C++ prototypes are:\n"
" pm3::pm3()\n"
" pm3::pm3(char *)\n");
" Possible C/C++ prototypes are:\n"
" pm3::pm3()\n"
" pm3::pm3(char *)\n");
lua_error(L);
return 0;
}
+2 -2
View File
@@ -831,7 +831,7 @@ static void show_help(bool showFullHelp, char *exec_name) {
PrintAndLogEx(NORMAL, " -v/--version print client version");
PrintAndLogEx(NORMAL, " -p/--port serial port to connect to");
PrintAndLogEx(NORMAL, " -w/--wait 20sec waiting the serial port to appear in the OS\n"
" with a tcp: port, listen and wait for an incoming connection instead");
" with a tcp: port, listen and wait for an incoming connection instead");
PrintAndLogEx(NORMAL, " -f/--flush output will be flushed after every print");
PrintAndLogEx(NORMAL, " -d/--debug <0|1|2> set debugmode");
PrintAndLogEx(NORMAL, "\nOptions in client mode:");
@@ -945,7 +945,7 @@ static int dumpmem_pm3(char *serial_port_name, const char *filename, uint32_t ad
PrintAndLogEx(INFO, "Device is running the bootloader.");
} else {
PrintAndLogEx(ERR, "Device is running the bootloader, but the bootloader"
" doesn't understand the READ MEM command.");
" doesn't understand the READ MEM command.");
goto finish2;
}
}
+2 -2
View File
@@ -418,8 +418,8 @@ static int l_kbd_enter_pressed(lua_State *L) {
* lua-scripts to do stuff like "core.console('hf mf mifare')"
* core.console(cmd [, capture [, quiet]])
*
* Same idea as the python binding
* `capture` hands the command's output back as a string,
* Same idea as the python binding
* `capture` hands the command's output back as a string,
* `quiet` keeps it off the// terminal
* @param L
* @return
+1 -1
View File
@@ -743,7 +743,7 @@ bool bytes_equal_not_null(const void *a, size_t a_len, const void *b, size_t b_l
}
// Append a formatted string to buf without ever writing past buf_len.
// Returns the length of the resulting string.
// Returns the length of the resulting string.
// buf must already be a valid NULL terminated string.
size_t str_append(char *buf, size_t buf_len, const char *fmt, ...) {