Skip to content

Commit 7962df7

Browse files
committed
Add 'pxe' command (emoji dump) - thanks @earada
1 parent 40abd9c commit 7962df7

2 files changed

Lines changed: 86 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ File Formats:
4040
Operating Systems:
4141

4242
Android, GNU/Linux, [Net|Free|Open]BSD, iOS,
43-
OSX, QNX, w32, w64, Solaris, FirefoxOS
43+
OSX, QNX, w32, w64, Solaris, Haiku, FirefoxOS
4444

4545
Bindings:
4646

libr/core/cmd_print.c

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,6 +1274,91 @@ static int cmd_print(void *data, const char *input) {
12741274
core->block, len, 16, 1);
12751275
core->print->flags &= (((ut32)-1) & (~R_PRINT_FLAGS_SPARSE));
12761276
break;
1277+
case 'e':
1278+
{
1279+
int j;
1280+
char emoji[] = {'\x8c','\x80','\x8c','\x82','\x8c','\x85','\x8c','\x88',
1281+
'\x8c','\x99','\x8c','\x9e','\x8c','\x9f','\x8c','\xa0',
1282+
'\x8c','\xb0','\x8c','\xb1','\x8c','\xb2','\x8c','\xb3',
1283+
'\x8c','\xb4','\x8c','\xb5','\x8c','\xb7','\x8c','\xb8',
1284+
'\x8c','\xb9','\x8c','\xba','\x8c','\xbb','\x8c','\xbc',
1285+
'\x8c','\xbd','\x8c','\xbe','\x8c','\xbf','\x8d','\x80',
1286+
'\x8d','\x81','\x8d','\x82','\x8d','\x83','\x8d','\x84',
1287+
'\x8d','\x85','\x8d','\x86','\x8d','\x87','\x8d','\x88',
1288+
'\x8d','\x89','\x8d','\x8a','\x8d','\x8b','\x8d','\x8c',
1289+
'\x8d','\x8d','\x8d','\x8e','\x8d','\x8f','\x8d','\x90',
1290+
'\x8d','\x91','\x8d','\x92','\x8d','\x93','\x8d','\x94',
1291+
'\x8d','\x95','\x8d','\x96','\x8d','\x97','\x8d','\x98',
1292+
'\x8d','\x9c','\x8d','\x9d','\x8d','\x9e','\x8d','\x9f',
1293+
'\x8d','\xa0','\x8d','\xa1','\x8d','\xa2','\x8d','\xa3',
1294+
'\x8d','\xa4','\x8d','\xa5','\x8d','\xa6','\x8d','\xa7',
1295+
'\x8d','\xa8','\x8d','\xa9','\x8d','\xaa','\x8d','\xab',
1296+
'\x8d','\xac','\x8d','\xad','\x8d','\xae','\x8d','\xaf',
1297+
'\x8d','\xb0','\x8d','\xb1','\x8d','\xb2','\x8d','\xb3',
1298+
'\x8d','\xb4','\x8d','\xb5','\x8d','\xb6','\x8d','\xb7',
1299+
'\x8d','\xb8','\x8d','\xb9','\x8d','\xba','\x8d','\xbb',
1300+
'\x8d','\xbc','\x8e','\x80','\x8e','\x81','\x8e','\x82',
1301+
'\x8e','\x83','\x8e','\x84','\x8e','\x85','\x8e','\x88',
1302+
'\x8e','\x89','\x8e','\x8a','\x8e','\x8b','\x8e','\x8c',
1303+
'\x8e','\x8d','\x8e','\x8e','\x8e','\x8f','\x8e','\x92',
1304+
'\x8e','\x93','\x8e','\xa0','\x8e','\xa1','\x8e','\xa2',
1305+
'\x8e','\xa3','\x8e','\xa4','\x8e','\xa5','\x8e','\xa6',
1306+
'\x8e','\xa7','\x8e','\xa8','\x8e','\xa9','\x8e','\xaa',
1307+
'\x8e','\xab','\x8e','\xac','\x8e','\xad','\x8e','\xae',
1308+
'\x8e','\xaf','\x8e','\xb0','\x8e','\xb1','\x8e','\xb2',
1309+
'\x8e','\xb3','\x8e','\xb4','\x8e','\xb5','\x8e','\xb7',
1310+
'\x8e','\xb8','\x8e','\xb9','\x8e','\xba','\x8e','\xbb',
1311+
'\x8e','\xbd','\x8e','\xbe','\x8e','\xbf','\x8f','\x80',
1312+
'\x8f','\x81','\x8f','\x82','\x8f','\x83','\x8f','\x84',
1313+
'\x8f','\x86','\x8f','\x87','\x8f','\x88','\x8f','\x89',
1314+
'\x8f','\x8a','\x90','\x80','\x90','\x81','\x90','\x82',
1315+
'\x90','\x83','\x90','\x84','\x90','\x85','\x90','\x86',
1316+
'\x90','\x87','\x90','\x88','\x90','\x89','\x90','\x8a',
1317+
'\x90','\x8b','\x90','\x8c','\x90','\x8d','\x90','\x8e',
1318+
'\x90','\x8f','\x90','\x90','\x90','\x91','\x90','\x92',
1319+
'\x90','\x93','\x90','\x94','\x90','\x95','\x90','\x96',
1320+
'\x90','\x97','\x90','\x98','\x90','\x99','\x90','\x9a',
1321+
'\x90','\x9b','\x90','\x9c','\x90','\x9d','\x90','\x9e',
1322+
'\x90','\x9f','\x90','\xa0','\x90','\xa1','\x90','\xa2',
1323+
'\x90','\xa3','\x90','\xa4','\x90','\xa5','\x90','\xa6',
1324+
'\x90','\xa7','\x90','\xa8','\x90','\xa9','\x90','\xaa',
1325+
'\x90','\xab','\x90','\xac','\x90','\xad','\x90','\xae',
1326+
'\x90','\xaf','\x90','\xb0','\x90','\xb1','\x90','\xb2',
1327+
'\x90','\xb3','\x90','\xb4','\x90','\xb5','\x90','\xb6',
1328+
'\x90','\xb7','\x90','\xb8','\x90','\xb9','\x90','\xba',
1329+
'\x90','\xbb','\x90','\xbc','\x90','\xbd','\x90','\xbe',
1330+
'\x91','\x80','\x91','\x82','\x91','\x83','\x91','\x84',
1331+
'\x91','\x85','\x91','\x86','\x91','\x87','\x91','\x88',
1332+
'\x91','\x89','\x91','\x8a','\x91','\x8b','\x91','\x8c',
1333+
'\x91','\x8d','\x91','\x8e','\x91','\x8f','\x91','\x90',
1334+
'\x91','\x91','\x91','\x92','\x91','\x93','\x91','\x94',
1335+
'\x91','\x95','\x91','\x96','\x91','\x97','\x91','\x98',
1336+
'\x91','\x99','\x91','\x9a','\x91','\x9b','\x91','\x9c',
1337+
'\x91','\x9d','\x91','\x9e','\x91','\x9f','\x91','\xa0',
1338+
'\x91','\xa1','\x91','\xa2','\x91','\xa3','\x91','\xa4',
1339+
'\x91','\xa5','\x91','\xa6','\x91','\xa7','\x91','\xa8',
1340+
'\x91','\xa9','\x91','\xaa','\x91','\xae','\x91','\xaf',
1341+
'\x91','\xba','\x91','\xbb','\x91','\xbc','\x91','\xbd',
1342+
'\x91','\xbe','\x91','\xbf','\x92','\x80','\x92','\x81',
1343+
'\x92','\x82','\x92','\x83','\x92','\x84','\x92','\x85'};
1344+
for (i=0; i<len; i+=16) {
1345+
r_print_addr (core->print, core->offset+i);
1346+
for (j=i; j<i+16; j+=1) {
1347+
ut8 *p = (ut8*)core->block+j;
1348+
if (j<len)
1349+
r_cons_printf ("\xf0\x9f%c%c ", emoji[*p*2], emoji[*p*2+1]);
1350+
else
1351+
r_cons_printf (" ");
1352+
}
1353+
r_cons_printf (" ");
1354+
for (j=i; j<len && j<i+16; j+=1) {
1355+
ut8 *p = (ut8*)core->block+j;
1356+
r_print_byte (core->print, "%c", j, *p);
1357+
}
1358+
r_cons_printf ("\n");
1359+
}
1360+
}
1361+
break;
12771362
default: {
12781363
ut64 from = r_config_get_i (core->config, "diff.from");
12791364
ut64 to = r_config_get_i (core->config, "diff.to");

0 commit comments

Comments
 (0)