Skip to content

Commit 51f8a5b

Browse files
committed
Convert pf commands to rzshell
1 parent c0abdb8 commit 51f8a5b

35 files changed

+10905
-18034
lines changed

librz/bin/d/bios

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# BIOS parameter block
2-
pf.bpb .b.[8]zwbwbwwbwwwxx jmp oem_id bytes_per_sector sectors_per_cluster reserved_sectors num_fat num_dir_ent num_sectors type sectors_per_fat sectors_per_track num_heads num_hidden large_sectors
3-
pf.ebpb16 bbbx[11]z[8]z[448].w drive_num ntflags_or_reserved signature volume_id volume_label system_id bootable_signature
4-
pf.ebpb32 xwbbxww[12]bbbbx[11]z[8]z[420].w sectors_per_fat flags version.major version.minor root_cluster fsinfo_cluster backup_boot_cluster reserved drive_num ntflags_or_reserved signature volume_id volume_label system_id bootable_signature
5-
pf.bpb16 ?? (bpb)bios_parameter_block (ebpb16)extended_boot_record
6-
pf.bpb32 ?? (bpb)bios_parameter_block (ebpb32)extended_boot_record
2+
pfn bpb ".b.[8]zwbwbwwbwwwxx jmp oem_id bytes_per_sector sectors_per_cluster reserved_sectors num_fat num_dir_ent num_sectors type sectors_per_fat sectors_per_track num_heads num_hidden large_sectors"
3+
pfn ebpb16 "bbbx[11]z[8]z[448].w drive_num ntflags_or_reserved signature volume_id volume_label system_id bootable_signature"
4+
pfn ebpb32 "xwbbxww[12]bbbbx[11]z[8]z[420].w sectors_per_fat flags version.major version.minor root_cluster fsinfo_cluster backup_boot_cluster reserved drive_num ntflags_or_reserved signature volume_id volume_label system_id bootable_signature"
5+
pfn bpb16 "?? (bpb)bios_parameter_block (ebpb16)extended_boot_record"
6+
pfn bpb32 "?? (bpb)bios_parameter_block (ebpb32)extended_boot_record"
77

88
# Data access packet (for INT 13h)
9-
pf.dap bbwwwq size reserved sector offset segment start
9+
pfn dap "bbwwwq size reserved sector offset segment start"

librz/bin/d/dex

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pf.dex_magic [8]c
1+
pfn dex_magic "[8]c"

librz/bin/d/elf32

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
pfo elf_enums
2-
pf.elf_ident [4]z[1]E[1]E[1]E.:: magic (elf_class)class (elf_data)data (elf_hdr_version)version
3-
pf.elf_header ?[2]E[2]E[4]ExxxxN2N2N2N2N2N2 (elf_ident)ident (elf_type)type (elf_machine)machine (elf_obj_version)version entry phoff shoff flags ehsize phentsize phnum shentsize shnum shstrndx
4-
pf.elf_phdr [4]Exxxxx[4]Ex (elf_p_type)type offset vaddr paddr filesz memsz (elf_p_flags)flags align
5-
pf.elf_shdr x[4]E[4]Exxxxxxx name (elf_s_type)type (elf_s_flags_32)flags addr offset size link info addralign entsize
2+
pfn elf_ident "[4]z[1]E[1]E[1]E.:: magic (elf_class)class (elf_data)data (elf_hdr_version)version"
3+
pfn elf_header "?[2]E[2]E[4]ExxxxN2N2N2N2N2N2 (elf_ident)ident (elf_type)type (elf_machine)machine (elf_obj_version)version entry phoff shoff flags ehsize phentsize phnum shentsize shnum shstrndx"
4+
pfn elf_phdr "[4]Exxxxx[4]Ex (elf_p_type)type offset vaddr paddr filesz memsz (elf_p_flags)flags align"
5+
pfn elf_shdr "x[4]E[4]Exxxxxxx name (elf_s_type)type (elf_s_flags_32)flags addr offset size link info addralign entsize"

librz/bin/d/elf64

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
pfo elf_enums
2-
pf.elf_ident [4]z[1]E[1]E[1]E.:: magic (elf_class)class (elf_data)data (elf_hdr_version)version
3-
pf.elf_header ?[2]E[2]E[4]EqqqxN2N2N2N2N2N2 (elf_ident)ident (elf_type)type (elf_machine)machine (elf_obj_version)version entry phoff shoff flags ehsize phentsize phnum shentsize shnum shstrndx
4-
pf.elf_phdr [4]E[4]Eqqqqqq (elf_p_type)type (elf_p_flags)flags offset vaddr paddr filesz memsz align
5-
pf.elf_shdr x[4]E[8]Eqqqxxqq name (elf_s_type)type (elf_s_flags_64)flags addr offset size link info addralign entsize
2+
pfn elf_ident "[4]z[1]E[1]E[1]E.:: magic (elf_class)class (elf_data)data (elf_hdr_version)version"
3+
pfn elf_header "?[2]E[2]E[4]EqqqxN2N2N2N2N2N2 (elf_ident)ident (elf_type)type (elf_machine)machine (elf_obj_version)version entry phoff shoff flags ehsize phentsize phnum shentsize shnum shstrndx"
4+
pfn elf_phdr "[4]E[4]Eqqqqqq (elf_p_type)type (elf_p_flags)flags offset vaddr paddr filesz memsz align"
5+
pfn elf_shdr "x[4]E[8]Eqqqxxqq name (elf_s_type)type (elf_s_flags_64)flags addr offset size link info addralign entsize"

librz/bin/d/fat

-3
This file was deleted.

librz/bin/d/macho

+29-27
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,32 @@ td "enum mach0_header_filetype {MH_OBJECT=1, MH_EXECUTE=2, MH_FVMLIB=3, MH_CORE=
55
td "enum mach0_header_flags {MH_NOUNDEFS=1, MH_INCRLINK=2,MH_DYLDLINK=4,MH_BINDATLOAD=8,MH_PREBOUND=0x10, MH_SPLIT_SEGS=0x20,MH_LAZY_INIT=0x40,MH_TWOLEVEL=0x80, MH_FORCE_FLAT=0x100,MH_NOMULTIDEFS=0x200,MH_NOFIXPREBINDING=0x400, MH_PREBINDABLE=0x800, MH_ALLMODSBOUND=0x1000, MH_SUBSECTIONS_VIA_SYMBOLS=0x2000, MH_CANONICAL=0x4000,MH_WEAK_DEFINES=0x8000, MH_BINDS_TO_WEAK=0x10000,MH_ALLOW_STACK_EXECUTION=0x20000, MH_ROOT_SAFE=0x40000,MH_SETUID_SAFE=0x80000, MH_NO_REEXPORTED_DYLIBS=0x100000,MH_PIE=0x200000, MH_DEAD_STRIPPABLE_DYLIB=0x400000, MH_HAS_TLV_DESCRIPTORS=0x800000, MH_NO_HEAP_EXECUTION=0x1000000};"
66
td "enum mach0_section_types {S_REGULAR=0, S_ZEROFILL=1, S_CSTRING_LITERALS=2, S_4BYTE_LITERALS=3, S_8BYTE_LITERALS=4, S_LITERAL_POINTERS=5, S_NON_LAZY_SYMBOL_POINTERS=6, S_LAZY_SYMBOL_POINTERS=7, S_SYMBOL_STUBS=8, S_MOD_INIT_FUNC_POINTERS=9, S_MOD_TERM_FUNC_POINTERS=0xa, S_COALESCED=0xb, S_GB_ZEROFILL=0xc, S_INTERPOSING=0xd, S_16BYTE_LITERALS=0xe, S_DTRACE_DOF=0xf, S_LAZY_DYLIB_SYMBOL_POINTERS=0x10, S_THREAD_LOCAL_REGULAR=0x11, S_THREAD_LOCAL_ZEROFILL=0x12, S_THREAD_LOCAL_VARIABLES=0x13, S_THREAD_LOCAL_VARIABLE_POINTERS=0x14, S_THREAD_LOCAL_INIT_FUNCTION_POINTERS=0x15, S_INIT_FUNC_OFFSETS=0x16};"
77
td "enum mach0_section_attrs {S_ATTR_PURE_INSTRUCTIONS=0x800000ULL, S_ATTR_NO_TOC=0x400000ULL, S_ATTR_STRIP_STATIC_SYMS=0x200000ULL, S_ATTR_NO_DEAD_STRIP=0x100000ULL, S_ATTR_LIVE_SUPPORT=0x080000ULL, S_ATTR_SELF_MODIFYING_CODE=0x040000ULL, S_ATTR_DEBUG=0x020000ULL, S_ATTR_SOME_INSTRUCTIONS=0x000004ULL, S_ATTR_EXT_RELOC=0x000002ULL, S_ATTR_LOC_RELOC=0x000001ULL};"
8-
pf.mach0_header xxx[4]Edd[4]B magic cputype cpusubtype (mach0_header_filetype)filetype ncmds sizeofcmds (mach0_header_flags)flags
9-
pf.mach0_segment [4]Ed[16]zxxxxoodx (mach0_load_command_type)cmd cmdsize segname vmaddr vmsize fileoff filesize maxprot initprot nsects flags
10-
pf.mach0_segment64 [4]Ed[16]zqqqqoodx (mach0_load_command_type)cmd cmdsize segname vmaddr vmsize fileoff filesize maxprot initprot nsects flags
11-
pf.mach0_symtab_command [4]Edxdxd (mach0_load_command_type)cmd cmdsize symoff nsyms stroff strsize
12-
pf.mach0_dysymtab_command [4]Edddddddddddxdxdxxxd (mach0_load_command_type)cmd cmdsize ilocalsym nlocalsym iextdefsym nextdefsym iundefsym nundefsym tocoff ntoc moddtaboff nmodtab extrefsymoff nextrefsyms inddirectsymoff nindirectsyms extreloff nextrel locreloff nlocrel
13-
pf.mach0_section [16]z[16]zxxxxxx[1]E[3]Bxx sectname segname addr size offset align reloff nreloc (mach0_section_types)flags_type (mach0_section_attrs)flags_attr reserved1 reserved2
14-
pf.mach0_section64 [16]z[16]zqqxxxx[1]E[3]Bxxx sectname segname addr size offset align reloff nreloc (mach0_section_types)flags_type (mach0_section_attrs)flags_attr reserved1 reserved2 reserved3
15-
pf.mach0_dylib xxxxz name_offset timestamp current_version compatibility_version name
16-
pf.mach0_dylib_command [4]Ed? (mach0_load_command_type)cmd cmdsize (mach0_dylib)dylib
17-
pf.mach0_id_dylib_command [4]Ed? (mach0_load_command_type)cmd cmdsize (mach0_dylib)dylib
18-
pf.mach0_uuid_command [4]Ed[16]b (mach0_load_command_type)cmd cmdsize uuid
19-
pf.mach0_rpath_command [4]Edxz (mach0_load_command_type)cmd cmdsize path_offset path
20-
pf.mach0_entry_point_command [4]Edqq (mach0_load_command_type)cmd cmdsize entryoff stacksize
21-
pf.mach0_encryption_info64_command [4]Edxddx (mach0_load_command_type)cmd cmdsize offset size id padding
22-
pf.mach0_encryption_info_command [4]Edxdd (mach0_load_command_type)cmd cmdsize offset size id
23-
pf.mach0_code_signature_command [4]Edxd (mach0_load_command_type)cmd cmdsize offset size
24-
pf.mach0_dyld_info_only_command [4]Edxdxdxdxdxd (mach0_load_command_type)cmd cmdsize rebase_off rebase_size bind_off bind_size weak_bind_off weak_bind_size lazy_bind_off lazy_bind_size export_off export_size
25-
pf.mach0_load_dylinker_command [4]Edxz (mach0_load_command_type)cmd cmdsize name_offset name
26-
pf.mach0_id_dylinker_command [4]Edxz (mach0_load_command_type)cmd cmdsize name_offset name
27-
pf.mach0_build_version_command [4]Ed[4]Exxd (mach0_load_command_type)cmd cmdsize (mach0_build_platform)platform minos sdk ntools
28-
pf.mach0_build_version_tool [4]Ex (mach0_build_tool)tool version
29-
pf.mach0_source_version_command [4]Edq (mach0_load_command_type)cmd cmdsize version
30-
pf.mach0_function_starts_command [4]Edxd (mach0_load_command_type)cmd cmdsize offset size
31-
pf.mach0_data_in_code_command [4]Edxd (mach0_load_command_type)cmd cmdsize offset size
32-
pf.mach0_version_min_command [4]Edxx (mach0_load_command_type)cmd cmdsize version reserved
33-
pf.mach0_segment_split_info_command [4]Edxd (mach0_load_command_type)cmd cmdsize offset size
34-
pf.mach0_unixthread_command [4]Eddd (mach0_load_command_type)cmd cmdsize flavor count
8+
pfn mach0_header "xxx[4]Edd[4]B magic cputype cpusubtype (mach0_header_filetype)filetype ncmds
9+
sizeofcmds (mach0_header_flags)flags"
10+
pfn mach0_segment "[4]Ed[16]zxxxxoodx (mach0_load_command_type)cmd cmdsize segname vmaddr vmsize fileoff filesize maxprot initprot nsects flags"
11+
pfn mach0_segment64 "[4]Ed[16]zqqqqoodx (mach0_load_command_type)cmd cmdsize segname vmaddr vmsize fileoff filesize maxprot initprot nsects flags"
12+
pfn mach0_symtab_command "[4]Edxdxd (mach0_load_command_type)cmd cmdsize symoff nsyms stroff strsize"
13+
pfn mach0_dysymtab_command "[4]Edddddddddddxdxdxxxd (mach0_load_command_type)cmd cmdsize ilocalsym nlocalsym iextdefsym nextdefsym iundefsym nundefsym tocoff ntoc moddtaboff nmodtab extrefsymoff nextrefsyms inddirectsymoff nindirectsyms extreloff nextrel locreloff nlocrel"
14+
pfn mach0_section "[16]z[16]zxxxxxx[1]E[3]Bxx sectname segname addr size offset align reloff nreloc (mach0_section_types)flags_type (mach0_section_attrs)flags_attr reserved1 reserved2"
15+
pfn mach0_section64 "[16]z[16]zqqxxxx[1]E[3]Bxxx sectname segname addr size offset align reloff
16+
nreloc (mach0_section_types)flags_type (mach0_section_attrs)flags_attr reserved1 reserved2 reserved3"
17+
pfn mach0_dylib "xxxxz name_offset timestamp current_version compatibility_version name"
18+
pfn mach0_dylib_command "[4]Ed? (mach0_load_command_type)cmd cmdsize (mach0_dylib)dylib"
19+
pfn mach0_id_dylib_command "[4]Ed? (mach0_load_command_type)cmd cmdsize (mach0_dylib)dylib"
20+
pfn mach0_uuid_command "[4]Ed[16]b (mach0_load_command_type)cmd cmdsize uuid"
21+
pfn mach0_rpath_command "[4]Edxz (mach0_load_command_type)cmd cmdsize path_offset path"
22+
pfn mach0_entry_point_command "[4]Edqq (mach0_load_command_type)cmd cmdsize entryoff stacksize"
23+
pfn mach0_encryption_info64_command "[4]Edxddx (mach0_load_command_type)cmd cmdsize offset size id padding"
24+
pfn mach0_encryption_info_command "[4]Edxdd (mach0_load_command_type)cmd cmdsize offset size id"
25+
pfn mach0_code_signature_command "[4]Edxd (mach0_load_command_type)cmd cmdsize offset size"
26+
pfn mach0_dyld_info_only_command "[4]Edxdxdxdxdxd (mach0_load_command_type)cmd cmdsize rebase_off rebase_size bind_off bind_size weak_bind_off weak_bind_size lazy_bind_off lazy_bind_size export_off export_size"
27+
pfn mach0_load_dylinker_command "[4]Edxz (mach0_load_command_type)cmd cmdsize name_offset name"
28+
pfn mach0_id_dylinker_command "[4]Edxz (mach0_load_command_type)cmd cmdsize name_offset name"
29+
pfn mach0_build_version_command "[4]Ed[4]Exxd (mach0_load_command_type)cmd cmdsize (mach0_build_platform)platform minos sdk ntools"
30+
pfn mach0_build_version_tool "[4]Ex (mach0_build_tool)tool version"
31+
pfn mach0_source_version_command "[4]Edq (mach0_load_command_type)cmd cmdsize version"
32+
pfn mach0_function_starts_command "[4]Edxd (mach0_load_command_type)cmd cmdsize offset size"
33+
pfn mach0_data_in_code_command "[4]Edxd (mach0_load_command_type)cmd cmdsize offset size"
34+
pfn mach0_version_min_command "[4]Edxx (mach0_load_command_type)cmd cmdsize version reserved"
35+
pfn mach0_segment_split_info_command "[4]Edxd (mach0_load_command_type)cmd cmdsize offset size"
36+
pfn mach0_unixthread_command "[4]Eddd (mach0_load_command_type)cmd cmdsize flavor count"

librz/bin/d/meson.build

-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ format_files = [
169169
'elf64',
170170
'elf_enums',
171171
'pe32',
172-
'trx',
173172
'mz',
174173
'zip'
175174
]

librz/bin/d/mz

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pf.dos_header [2]zwwwwwwwwwwwww[4]www[10]wx e_magic e_cblp e_cp e_crlc e_cparhdr e_minalloc e_maxalloc e_ss e_sp e_csum e_ip e_cs e_lfarlc e_ovno e_res e_oemid e_oeminfo e_res2 e_lfanew
1+
pfn dos_header "[2]zwwwwwwwwwwwww[4]www[10]wx e_magic e_cblp e_cp e_crlc e_cparhdr e_minalloc e_maxalloc e_ss e_sp e_csum e_ip e_cs e_lfarlc e_ovno e_res e_oemid e_oeminfo e_res2 e_lfanew"

librz/bin/d/ntfs

-2
This file was deleted.

librz/bin/d/pe32

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
pfo mz
2-
pf.pe_nt_image_headers32 [4]z?? signature (pe_image_file_header)fileHeader (pe_image_optional_header32)optionalHeader
3-
pf.pe_image_optional_header32 [2]Ebbxxxxxxxxxwwwwwwxxxx[2]E[2]Bxxxxxx[16]? (pe_magic)magic majorLinkerVersion minorLinkerVersion sizeOfCode sizeOfInitializedData sizeOfUninitializedData addressOfEntryPoint baseOfCode baseOfData imageBase sectionAlignment fileAlignment majorOperatingSystemVersion minorOperatingSystemVersion majorImageVersion minorImageVersion majorSubsystemVersion minorSubsystemVersion win32VersionValue sizeOfImage sizeOfHeaders checkSum (pe_subsystem)subsystem (pe_dllcharacteristics)dllCharacteristics sizeOfStackReserve sizeOfStackCommit sizeOfHeapReserve sizeOfHeapCommit loaderFlags numberOfRvaAndSizes (pe_image_data_directory)dataDirectory
4-
pf.pe_image_file_header [2]Ewtxxw[2]B (pe_machine)machine numberOfSections timeDateStamp pointerToSymbolTable numberOfSymbols sizeOfOptionalHeader (pe_characteristics)characteristics
5-
pf.pe_image_data_directory xx virtualAddress size
2+
pfn pe_nt_image_headers32 "[4]z?? signature (pe_image_file_header)fileHeader (pe_image_optional_header32)optionalHeader"
3+
pfn pe_image_optional_header32 "[2]Ebbxxxxxxxxxwwwwwwxxxx[2]E[2]Bxxxxxx[16]? (pe_magic)magic majorLinkerVersion minorLinkerVersion sizeOfCode sizeOfInitializedData sizeOfUninitializedData addressOfEntryPoint baseOfCode baseOfData imageBase sectionAlignment fileAlignment majorOperatingSystemVersion minorOperatingSystemVersion majorImageVersion minorImageVersion majorSubsystemVersion minorSubsystemVersion win32VersionValue sizeOfImage sizeOfHeaders checkSum (pe_subsystem)subsystem (pe_dllcharacteristics)dllCharacteristics sizeOfStackReserve sizeOfStackCommit sizeOfHeapReserve sizeOfHeapCommit loaderFlags numberOfRvaAndSizes (pe_image_data_directory)dataDirectory"
4+
pfn pe_image_file_header "[2]Ewtxxw[2]B (pe_machine)machine numberOfSections timeDateStamp pointerToSymbolTable numberOfSymbols sizeOfOptionalHeader (pe_characteristics)characteristics"
5+
pfn pe_image_data_directory "xx virtualAddress size"

librz/bin/d/trx

-27
This file was deleted.

librz/bin/d/zip

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
pf.zip_local_file_hdr xwwwwwxxxww magic extract flags compression last_mod_time last_mod_date crc32 compressed_size uncompressed_size namlen extras
2-
pf.zip_data_desc xxx crc32 compressed_size uncompressed_size
3-
pf.zip_central_directory_hdr xwwwwwwxxxwwwwwxx magic encoder extract flags compression last_mod_time last_mod_date crc32 compressed_size uncompressed_size namlen extras comment diskstart filetype filemode offset
4-
pf.zip_end_central_dir xwwwwxxw magic disk finaldisk entries finalentries rootsize rootseek comment
5-
pf.zip64_end_central_dir xqwwxxqqqq magic size encoder extract disk finaldisk entries finalentries rootsize rootseek
6-
pf.zip64_end_central_dir_loc xxqx magic disk rootseek disks
1+
pfn zip_local_file_hdr "xwwwwwxxxww magic extract flags compression last_mod_time last_mod_date crc32 compressed_size uncompressed_size namlen extras"
2+
pfn zip_data_desc "xxx crc32 compressed_size uncompressed_size"
3+
pfn zip_central_directory_hdr "xwwwwwwxxxwwwwwxx magic encoder extract flags compression last_mod_time last_mod_date crc32 compressed_size uncompressed_size namlen extras comment diskstart filetype filemode offset"
4+
pfn zip_end_central_dir "xwwwwxxw magic disk finaldisk entries finalentries rootsize rootseek comment"
5+
pfn zip64_end_central_dir "xqwwxxqqqq magic size encoder extract disk finaldisk entries finalentries rootsize rootseek"
6+
pfn zip64_end_central_dir_loc "xxqx magic disk rootseek disks"

librz/core/canalysis.c

+7-4
Original file line numberDiff line numberDiff line change
@@ -5121,8 +5121,9 @@ RZ_API RZ_OWN char *rz_core_analysis_var_display(RZ_NONNULL RzCore *core, RZ_NON
51215121
// TODO: convert to API
51225122
r = rz_core_cmd_strf(core, "pxr $w @r:%s", var->storage.reg);
51235123
} else {
5124-
// TODO: convert to API
5125-
r = rz_core_cmd_strf(core, "pf r (%s)", var->storage.reg);
5124+
char *regfmt = rz_str_newf("r (%s)", var->storage.reg);
5125+
r = rz_core_print_format(core, regfmt, RZ_PRINT_MUSTSEE);
5126+
free(regfmt);
51265127
}
51275128
rz_strbuf_append(sb, r);
51285129
free(r);
@@ -5135,8 +5136,10 @@ RZ_API RZ_OWN char *rz_core_analysis_var_display(RZ_NONNULL RzCore *core, RZ_NON
51355136
// TODO: convert to API
51365137
r = rz_core_cmd_strf(core, "pxr $w @ 0x%" PFMT64x, addr);
51375138
} else {
5138-
// TODO: convert to API
5139-
r = rz_core_cmd_strf(core, "pf %s @ 0x%" PFMT64x, fmt, addr);
5139+
ut64 oldoff = core->offset;
5140+
rz_core_seek(core, addr, true);
5141+
r = rz_core_print_format(core, fmt, RZ_PRINT_MUSTSEE);
5142+
rz_core_seek(core, oldoff, true);
51405143
}
51415144
rz_strbuf_append(sb, r);
51425145
free(r);

librz/core/cmd/cmd_analysis.c

+8-2
Original file line numberDiff line numberDiff line change
@@ -2025,8 +2025,14 @@ RZ_IPI RzCmdStatus rz_analysis_global_variable_print_handler(RzCore *core, int a
20252025
free(fmt);
20262026
return RZ_CMD_STATUS_ERROR;
20272027
}
2028-
// TODO: Convert to the API
2029-
rz_core_cmdf(core, "pf %s @ 0x%08" PFMT64x "\n", fmt, glob->addr);
2028+
ut64 oldoff = core->offset;
2029+
rz_core_seek(core, glob->addr, true);
2030+
char *r = rz_core_print_format(core, fmt, RZ_PRINT_MUSTSEE);
2031+
if (r) {
2032+
rz_cons_print(r);
2033+
}
2034+
free(r);
2035+
rz_core_seek(core, oldoff, true);
20302036
free(fmt);
20312037
return RZ_CMD_STATUS_OK;
20322038
}

0 commit comments

Comments
 (0)