Skip to content

Commit

Permalink
pfo files must be .h or .r2 ##print
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed Dec 21, 2024
1 parent 790eed9 commit 2841f3d
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 9 deletions.
12 changes: 5 additions & 7 deletions libr/bin/d/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,12 @@ clean:

.PHONY: all clean install install-symlink symstall uninstall

FORMATS=dex macho elf32 elf64 elf_enums pe32 trx mz zip symclass.sdb

install: $(F_SDB)
@echo "[i] Installing bin format files"
rm -rf "$P"
mkdir -p "$P"
-cp -f $(FORMATS) "$P" || true
-cp -f *.r2 *.h "$P" || true
-cp -f symclass.sdb "$P" || true
mkdir -p "$P/dll"
cp -f dll/*.sdb "$P/dll"

Expand All @@ -53,10 +52,9 @@ symclass.sdb:
CWD=$(shell pwd)
symstall install-symlink: symclass.sdb
mkdir -p "$P"
for FILE in * ; do \
if [ "$$FILE" != Makefile ]; then \
[ ! -d "$P/$$FILE" ] && ln -fs "${CWD}/$$FILE" "$P/$$FILE" ; \
fi ; \
rm -rf "$P/dll"
for FILE in *.r2 *.h dll symclass.sdb ; do \
[ ! -d "$P/$$FILE" ] && ln -fs "${CWD}/$$FILE" "$P/$$FILE" ; \
done

$(DLL_SDB):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 13 additions & 2 deletions libr/core/cmd_print.inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2105,6 +2105,17 @@ static void cmd_pfb(RCore *core, const char *_input) {
}
}

static bool is_pfo_file(const char *fn) {
if (*fn != '.') {
if (r_str_endswith (fn, ".r2")) {
return true;
}
if (r_str_endswith (fn, ".h")) {
return true;
}
}
return false;
}
static void cmd_print_format(RCore *core, const char *_input, const ut8* block, int len) {
char *input = NULL;
bool v2 = false;
Expand Down Expand Up @@ -2235,7 +2246,7 @@ static void cmd_print_format(RCore *core, const char *_input, const ut8* block,
if (home) {
files = r_sys_dir (home);
r_list_foreach (files, iter, fn) {
if (*fn != '.') {
if (is_pfo_file (fn)) {
r_cons_println (fn);
}
}
Expand All @@ -2246,7 +2257,7 @@ static void cmd_print_format(RCore *core, const char *_input, const ut8* block,
if (path) {
files = r_sys_dir (path);
r_list_foreach (files, iter, fn) {
if (*fn != '.') {
if (is_pfo_file (fn)) {
r_cons_println (fn);
}
}
Expand Down

0 comments on commit 2841f3d

Please sign in to comment.