From e6f2cd0b2a7fe25b3a1fcd82dadc14bbf219e173 Mon Sep 17 00:00:00 2001 From: pancake Date: Thu, 2 Dec 2021 17:39:59 +0100 Subject: [PATCH] Remove trailing spaces (#19460) $ git grep ' $' | grep -v ^test/ | cut -d : -f 1 | sort -u > /tmp/trailing $ for a in `cat /tmp/trailing` ; do sed -i -e 's/ *$//' $a ; done --- .github/upload.sh | 2 +- .github/workflows/ci.yml | 2 +- .github/workflows/codeql-analysis.yml | 2 +- Makefile | 2 +- configure-plugins | 2 +- dist/maemo/description.txt | 2 +- dist/snapcraft/snapcraft.yaml | 12 +- doc/android.md | 4 +- doc/avr.md | 2 +- doc/brainfuck.md | 2 +- doc/capstone.md | 2 +- doc/debug-internals.md | 14 +- doc/dospart | 44 ++-- doc/emscripten.md | 2 +- doc/esil.md | 2 +- doc/gdb.md | 6 +- doc/iocache | 18 +- doc/iphone.md | 6 +- doc/lang-plugins | 2 +- doc/license.md | 6 +- doc/maemo.md | 2 +- doc/oo.md | 2 +- doc/pdb/index.js | 24 +- doc/r2s/r2-5.5.0.r2s | 2 +- doc/rap.md | 2 +- doc/sandbox/rabin2.sb | 2 +- doc/sandbox/radare2.sb | 2 +- doc/sdb_ordinal.md | 2 +- doc/snap.md | 32 +-- libr/anal/class.c | 8 +- libr/anal/esil.c | 6 +- libr/anal/global.c | 2 +- libr/anal/p/anal_arm_cs.c | 66 +++--- libr/anal/p/anal_arm_regprofile.inc | 2 +- libr/anal/p/anal_arm_v35.c | 80 +++---- libr/anal/p/anal_dalvik.c | 16 +- libr/anal/p/anal_gb.c | 2 +- libr/anal/p/anal_mips_cs.c | 8 +- libr/anal/p/anal_mips_gnu.c | 10 +- libr/anal/p/anal_riscv.c | 2 +- libr/anal/p/anal_vax.c | 2 +- libr/anal/p/anal_x86_cs.c | 10 +- libr/anal/p/arm_v35.mk | 2 +- libr/anal/type_pdb.c | 26 +-- libr/anal/var.c | 2 +- libr/asm/arch/arc/gnu/arc-ext.h | 2 +- libr/asm/arch/arc/gnu/arc-opc.c | 2 +- libr/asm/arch/arc/gnu/arc.h | 2 +- libr/asm/arch/arm/aarch64/aarch64-tbl.h | 2 +- libr/asm/arch/arm/armass.c | 42 ++-- libr/asm/arch/arm/armass64.c | 2 +- libr/asm/arch/arm/gnu/floatformat.c | 6 +- libr/asm/arch/arm/winedbg/be_arm.c | 2 +- libr/asm/arch/avr/avr_disasm.c | 16 +- libr/asm/arch/avr/avr_disasm.h | 6 +- libr/asm/arch/avr/avr_instructionset.c | 12 +- libr/asm/arch/avr/errorcodes.h | 2 +- libr/asm/arch/avr/format.c | 2 +- libr/asm/arch/avr/format.h | 4 +- libr/asm/arch/dcpu16/asm.c | 4 +- libr/asm/arch/dcpu16/main.c | 8 +- libr/asm/arch/gb/gbasm.c | 2 +- libr/asm/arch/hexagon/hexagon_disas.c | 158 ++++++------- libr/asm/arch/i8080/i8080dis.c | 4 +- libr/asm/arch/i8080/i8080dis.h | 2 +- libr/asm/arch/include/elf/mips.h | 2 +- libr/asm/arch/include/elf/xtensa.h | 6 +- libr/asm/arch/include/libiberty.h | 6 +- libr/asm/arch/include/mybfd.h | 2 +- libr/asm/arch/include/opcode/cris.h | 2 +- libr/asm/arch/include/opcode/hppa.h | 16 +- libr/asm/arch/include/opcode/lanai.h | 6 +- libr/asm/arch/include/opcode/mips.h | 4 +- libr/asm/arch/include/opcode/nios2.h | 20 +- libr/asm/arch/include/opintl.h | 2 +- libr/asm/arch/include/symcat.h | 4 +- libr/asm/arch/include/wine-arm.h | 2 +- libr/asm/arch/include/xtensa-isa.h | 12 +- libr/asm/arch/lanai/gnu/lanai-dis.c | 14 +- libr/asm/arch/lanai/gnu/lanai-opc.c | 26 +-- libr/asm/arch/mips/gnu/micromips-opc.c | 2 +- libr/asm/arch/mips/gnu/mips-dis.c | 4 +- libr/asm/arch/mips/gnu/mips-formats.h | 4 +- libr/asm/arch/mips/gnu/mips-opc.c | 2 +- libr/asm/arch/mips/gnu/mips16-opc.c | 2 +- libr/asm/arch/msp430/msp430_disas.c | 4 +- libr/asm/arch/nios/gnu/nios2-dis.c | 4 +- libr/asm/arch/ppc/gnu/ppc-opc.c | 16 +- libr/asm/arch/ppc/libps/libps.c | 2 +- libr/asm/arch/ppc/libvle/vle.c | 4 +- libr/asm/arch/propeller/propeller_disas.c | 2 +- libr/asm/arch/riscv/riscv.c | 2 +- libr/asm/arch/sh/gnu/sh-opc.h | 2 +- libr/asm/arch/sparc/gnu/sparc-dis.c | 2 +- libr/asm/arch/tms320/c55x_plus/hashtable.c | 210 +++++++++--------- libr/asm/arch/tms320/c55x_plus/ins.c | 2 +- libr/asm/arch/tricore/gnu/cpu-tricore.c | 6 +- libr/asm/arch/tricore/gnu/tricore-dis.c | 10 +- libr/asm/arch/xtensa/gnu/xtensa-dis.c | 4 +- libr/asm/arch/z80/expressions.c | 2 +- libr/asm/d/8051.sdb.txt | 2 +- libr/asm/d/dalvik.sdb.txt | 22 +- libr/asm/d/java.sdb.txt | 162 +++++++------- libr/asm/d/riscv.sdb.txt | 4 +- libr/asm/d/z80.sdb.txt | 144 ++++++------ libr/asm/p/asm_arm_v35.c | 2 +- libr/asm/p/asm_snes.h | 2 +- libr/asm/p/asm_x86_nz.c | 2 +- libr/asm/p/mcore.mk | 2 +- libr/asm/p/ppc_cs.mk | 2 +- libr/bin/format/elf/elf.c | 2 +- libr/bin/format/elf/elf.h | 2 +- libr/bin/format/elf/elf_write.c | 8 +- libr/bin/format/le/le_specs.h | 2 +- libr/bin/format/mach0/mach0.c | 6 +- libr/bin/format/ne/ne.c | 4 +- libr/bin/format/omf/omf.h | 2 +- libr/bin/format/pe/pe.c | 4 +- libr/bin/format/pyc/marshal.c | 2 +- libr/bin/format/qnx/qnx.h | 4 +- libr/bin/format/qnx/qnx_specs.h | 4 +- libr/bin/format/xbe/xbe.h | 2 +- libr/bin/mangling/cxx/Makefile | 2 +- libr/bin/mangling/cxx/ansidecl.h | 2 +- libr/bin/mangling/cxx/cp-demangle.c | 16 +- libr/bin/mangling/cxx/cp-demangle.h | 2 +- libr/bin/mangling/cxx/libiberty.h | 8 +- libr/bin/mangling/swift-sd.c | 2 +- libr/bin/p/bin_msx.c | 2 +- libr/bin/p/bin_tic.c | 6 +- libr/bin/p/bin_write_mach0.c | 2 +- libr/bin/p/java.mk | 2 +- libr/bin/p/mach0.mk | 2 +- libr/bin/p/qnx.mk | 4 +- libr/bin/p/symbols.mk | 2 +- libr/bin/pdb/tpi.c | 18 +- libr/bin/pdb/types.h | 2 +- libr/cons/d/ayu | 2 +- libr/cons/d/focus | 8 +- libr/cons/d/white2 | 2 +- libr/cons/stiv.c | 2 +- libr/core/cmd.c | 2 +- libr/core/cmd_anal.c | 4 +- libr/core/cmd_flag.c | 4 +- libr/core/cmd_print.c | 2 +- libr/core/cmd_search.c | 2 +- libr/core/cmd_search_rop.c | 8 +- libr/core/disasm_stackptr.inc | 2 +- libr/core/patch.c | 2 +- libr/core/vslides.c | 2 +- libr/crypto/p/crypto_aes_wrap.c | 2 +- libr/crypto/p/crypto_serpent_algo.c | 16 +- libr/debug/p/native/arm.c | 2 +- libr/debug/p/native/darwin.c | 2 +- libr/debug/p/native/linux/reg/linux-s390x.h | 8 +- libr/debug/p/native/maps/darwin.c | 4 +- libr/debug/p/native/windows/windows_debug.c | 2 +- libr/debug/p/native/xnu/xnu_debug.c | 14 +- libr/debug/p/rap.mk | 2 +- libr/egg/README | 6 +- libr/fs/fs.c | 2 +- libr/hash/entropy.c | 2 +- libr/hash/md5.c | 4 +- libr/hash/sha1.h | 18 +- libr/hash/sha2.h | 4 +- libr/hash/xxhash.h | 10 +- .../internal/jemalloc_internal_defs.h | 40 ++-- libr/include/heap/r_jemalloc/jemalloc_defs.h | 16 +- libr/include/heap/r_windows.h | 2 +- libr/include/r_anal.h | 2 +- libr/include/r_bind.h | 2 +- libr/include/r_config.h | 2 +- libr/include/r_qrcode.h | 14 +- libr/include/r_util/r_graph_drawable.h | 8 +- libr/include/r_util/r_idpool.h | 2 +- libr/include/r_util/r_str_util.h | 2 +- libr/include/r_util/r_x509.h | 2 +- libr/include/sflib/common/sftypes.h | 4 +- libr/include/sflib/darwin-arm-64/sflib.h | 6 +- libr/include/sflib/darwin-arm-64/sfsyscall.h | 4 +- libr/include/sflib/darwin-arm-64/sfsysnr.h | 10 +- libr/include/sflib/darwin-x86-32/sflib.h | 6 +- libr/include/sflib/darwin-x86-32/sfsyscall.h | 8 +- libr/include/sflib/darwin-x86-32/sfsysnr.h | 10 +- libr/include/sflib/darwin-x86-64/sflib.h | 6 +- libr/include/sflib/darwin-x86-64/sfsyscall.h | 4 +- libr/include/sflib/darwin-x86-64/sfsysnr.h | 10 +- libr/include/sflib/freebsd-x86-32/sflib.h | 6 +- libr/include/sflib/freebsd-x86-32/sfsyscall.h | 8 +- libr/include/sflib/freebsd-x86-32/sfsysnr.h | 8 +- libr/include/sflib/linux-arm-32/sflib.h | 6 +- libr/include/sflib/linux-arm-32/sfsysnr.h | 6 +- libr/include/sflib/linux-arm-64/sflib.h | 6 +- libr/include/sflib/linux-arm-64/sfsysnr.h | 6 +- libr/include/sflib/linux-x86-32/sflib.h | 6 +- libr/include/sflib/linux-x86-32/sfsyscall.h | 8 +- libr/include/sflib/linux-x86-32/sfsysnr.h | 6 +- libr/include/sflib/linux-x86-64/sflib.h | 6 +- libr/include/sflib/linux-x86-64/sfsyscall.h | 6 +- libr/include/sflib/linux-x86-64/sfsysnr.h | 6 +- libr/io/p/debug.mk | 2 +- libr/io/p/zip.mk | 2 +- libr/io/undo.h | 2 +- libr/libs.custom.mk.example | 2 +- libr/magic/ascmagic.c | 6 +- libr/magic/d/default/apple | 16 +- libr/magic/d/default/archive | 4 +- libr/magic/d/default/cafebabe | 4 +- libr/magic/d/default/compressed | 2 +- libr/magic/d/default/database | 58 ++--- libr/magic/d/default/filesystems | 40 ++-- libr/magic/d/default/jpeg | 22 +- libr/magic/d/default/microsoft | 18 +- libr/magic/d/default/mime | 2 +- libr/magic/d/default/netbsd | 22 +- libr/magic/d/default/openbsd | 26 +-- libr/magic/d/default/riff | 2 +- libr/magic/d/default/vim | 2 +- libr/magic/file.h | 4 +- libr/magic/funcs.c | 4 +- libr/magic/is_tar.c | 8 +- libr/magic/magic.c | 4 +- libr/magic/names.h | 4 +- libr/magic/tar.h | 4 +- libr/main/rasm2.c | 2 +- libr/parse/c/COPYING | 2 +- libr/parse/c/tcclib.h | 6 +- libr/parse/c/tccpp.c | 2 +- libr/search/aes_find.c | 8 +- libr/search/privkey_find.c | 4 +- libr/search/strings.c | 2 +- libr/syscall/d/meson.build | 2 +- libr/util/big.c | 2 +- libr/util/d/ascii.sdb.txt | 4 +- libr/util/print.c | 2 +- libr/util/qrcode.c | 2 +- libr/util/skiplist.c | 2 +- libr/util/sys.c | 2 +- libr/util/syscmd.c | 2 +- pkgcfg/r_anal.pc.acr | 4 +- pkgcfg/r_asm.pc.acr | 4 +- pkgcfg/r_bin.pc.acr | 4 +- pkgcfg/r_bp.pc.acr | 4 +- pkgcfg/r_config.pc.acr | 4 +- pkgcfg/r_cons.pc.acr | 4 +- pkgcfg/r_crypto.pc.acr | 4 +- pkgcfg/r_debug.pc.acr | 4 +- pkgcfg/r_egg.pc.acr | 4 +- pkgcfg/r_flag.pc.acr | 4 +- pkgcfg/r_fs.pc.acr | 4 +- pkgcfg/r_hash.pc.acr | 2 +- pkgcfg/r_io.pc.acr | 4 +- pkgcfg/r_lang.pc.acr | 4 +- pkgcfg/r_magic.pc.acr | 2 +- pkgcfg/r_parse.pc.acr | 4 +- pkgcfg/r_reg.pc.acr | 4 +- pkgcfg/r_search.pc.acr | 4 +- pkgcfg/r_socket.pc.acr | 4 +- pkgcfg/r_syscall.pc.acr | 4 +- pkgcfg/r_util.pc.acr | 2 +- shlr/bochs/include/libbochs.h | 2 +- .../.oobfix-X86_insn_reg_intel.patch | 2 +- .../capstone-patches/v4/capstone-calloc.patch | 6 +- shlr/capstone-patches/v4/fix-x86-16.patch | 6 +- shlr/capstone-patches/v4/sstream-null.patch | 2 +- shlr/capstone-patches/v5/fix-x86-16.patch | 6 +- shlr/capstone-patches/v5/mmm.patch | 4 +- shlr/grub/fs/btrfs.c | 2 +- shlr/grub/fs/cpio.c | 2 +- shlr/grub/fs/hfsplus.c | 2 +- shlr/grub/fs/jfs.c | 2 +- shlr/grub/fs/minix.c | 2 +- shlr/grub/fs/ufs.c | 4 +- shlr/grub/include/config-util.h | 2 +- shlr/grub/include/grub/fshelp.h | 2 +- shlr/grub/include/grub/relocator.h | 2 +- shlr/grub/include/grub/relocator_private.h | 14 +- shlr/grub/include/grub/types.h | 30 +-- shlr/grub/main.c | 2 +- shlr/qnx/include/libqnxr.h | 2 +- shlr/sdb/Makefile | 2 +- shlr/sdb/config.mk | 2 +- shlr/sdb/src/array.c | 10 +- shlr/sdb/src/json/js0n.c | 4 +- shlr/sdb/src/ls.c | 2 +- shlr/sdb/src/sdb.h | 2 +- shlr/sdb/src/text.c | 8 +- shlr/www/f/index.html | 6 +- shlr/www/graph/index.js | 4 +- shlr/www/graph/js-graph-it.js | 20 +- shlr/www/graph/sf-homepage.css | 2 +- shlr/www/old/index.html | 10 +- shlr/www/old/style.css | 2 +- shlr/zip/include/zip.h | 6 +- shlr/zip/include/zipint.h | 4 +- shlr/zip/zip/config.h | 2 +- shlr/zip/zip/zip_add.c | 2 +- shlr/zip/zip/zip_add_dir.c | 2 +- shlr/zip/zip/zip_add_entry.c | 2 +- shlr/zip/zip/zip_close.c | 10 +- shlr/zip/zip/zip_delete.c | 2 +- shlr/zip/zip/zip_dir_add.c | 2 +- shlr/zip/zip/zip_dirent.c | 42 ++-- shlr/zip/zip/zip_discard.c | 4 +- shlr/zip/zip/zip_entry.c | 2 +- shlr/zip/zip/zip_err_str.c | 4 +- shlr/zip/zip/zip_error.c | 4 +- shlr/zip/zip/zip_error_clear.c | 2 +- shlr/zip/zip/zip_error_get.c | 2 +- shlr/zip/zip/zip_error_get_sys_type.c | 2 +- shlr/zip/zip/zip_error_strerror.c | 2 +- shlr/zip/zip/zip_error_to_str.c | 2 +- shlr/zip/zip/zip_extra_field.c | 22 +- shlr/zip/zip/zip_extra_field_api.c | 40 ++-- shlr/zip/zip/zip_fdopen.c | 4 +- shlr/zip/zip/zip_file_add.c | 2 +- shlr/zip/zip/zip_file_error_clear.c | 2 +- shlr/zip/zip/zip_file_error_get.c | 2 +- shlr/zip/zip/zip_file_get_comment.c | 2 +- shlr/zip/zip/zip_file_get_offset.c | 4 +- shlr/zip/zip/zip_file_rename.c | 6 +- shlr/zip/zip/zip_file_replace.c | 6 +- shlr/zip/zip/zip_file_set_comment.c | 2 +- shlr/zip/zip/zip_file_strerror.c | 2 +- shlr/zip/zip/zip_filerange_crc.c | 4 +- shlr/zip/zip/zip_fopen.c | 2 +- shlr/zip/zip/zip_fopen_encrypted.c | 2 +- shlr/zip/zip/zip_fopen_index.c | 2 +- shlr/zip/zip/zip_fopen_index_encrypted.c | 4 +- shlr/zip/zip/zip_fread.c | 2 +- shlr/zip/zip/zip_get_archive_comment.c | 2 +- shlr/zip/zip/zip_get_archive_flag.c | 2 +- .../zip/zip_get_compression_implementation.c | 2 +- .../zip/zip_get_encryption_implementation.c | 2 +- shlr/zip/zip/zip_get_file_comment.c | 2 +- shlr/zip/zip/zip_get_name.c | 2 +- shlr/zip/zip/zip_get_num_entries.c | 2 +- shlr/zip/zip/zip_get_num_files.c | 2 +- shlr/zip/zip/zip_name_locate.c | 2 +- shlr/zip/zip/zip_new.c | 4 +- shlr/zip/zip/zip_open.c | 42 ++-- shlr/zip/zip/zip_rename.c | 2 +- shlr/zip/zip/zip_replace.c | 2 +- shlr/zip/zip/zip_set_archive_comment.c | 4 +- shlr/zip/zip/zip_set_archive_flag.c | 4 +- shlr/zip/zip/zip_set_default_password.c | 4 +- shlr/zip/zip/zip_set_file_comment.c | 2 +- shlr/zip/zip/zip_set_file_compression.c | 10 +- shlr/zip/zip/zip_set_name.c | 2 +- shlr/zip/zip/zip_source_buffer.c | 8 +- shlr/zip/zip/zip_source_close.c | 4 +- shlr/zip/zip/zip_source_crc.c | 10 +- shlr/zip/zip/zip_source_deflate.c | 10 +- shlr/zip/zip/zip_source_error.c | 2 +- shlr/zip/zip/zip_source_file.c | 2 +- shlr/zip/zip/zip_source_filep.c | 4 +- shlr/zip/zip/zip_source_free.c | 2 +- shlr/zip/zip/zip_source_function.c | 4 +- shlr/zip/zip/zip_source_layered.c | 4 +- shlr/zip/zip/zip_source_open.c | 6 +- shlr/zip/zip/zip_source_pkware.c | 4 +- shlr/zip/zip/zip_source_pop.c | 2 +- shlr/zip/zip/zip_source_read.c | 4 +- shlr/zip/zip/zip_source_stat.c | 4 +- shlr/zip/zip/zip_source_window.c | 4 +- shlr/zip/zip/zip_source_zip.c | 6 +- shlr/zip/zip/zip_source_zip_new.c | 2 +- shlr/zip/zip/zip_stat.c | 2 +- shlr/zip/zip/zip_stat_index.c | 6 +- shlr/zip/zip/zip_stat_init.c | 2 +- shlr/zip/zip/zip_strerror.c | 2 +- shlr/zip/zip/zip_string.c | 14 +- shlr/zip/zip/zip_unchange.c | 4 +- shlr/zip/zip/zip_unchange_all.c | 2 +- shlr/zip/zip/zip_unchange_archive.c | 4 +- shlr/zip/zip/zip_unchange_data.c | 2 +- shlr/zip/zip/zip_utf-8.c | 4 +- shlr/zip/zip/zipint.h | 6 +- sys/CONFIG | 2 +- sys/android-release.sh | 2 +- sys/cccl | 4 +- sys/indent.sh | 4 +- sys/install.sh | 2 +- sys/ios-cydia.sh | 2 +- sys/ios-sdk.sh | 6 +- sys/purge.sh | 2 +- sys/shellcheck.sh | 2 +- sys/source_bat.bash | 12 +- sys/sync.sh | 2 +- 389 files changed, 1502 insertions(+), 1502 deletions(-) diff --git a/.github/upload.sh b/.github/upload.sh index 2922abab93..3318987475 100755 --- a/.github/upload.sh +++ b/.github/upload.sh @@ -4,7 +4,7 @@ set +x # Do not leak information # Exit immediately if one of the files given as arguments is not there # because we don't want to delete the existing release if we don't have -# the new files that should be uploaded +# the new files that should be uploaded for file in "$@" do if [ ! -e "$file" ] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 050c56dc49..058d7bf852 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -190,7 +190,7 @@ jobs: with: name: radare2-${{ steps.r2v.outputs.branch }}-static.tar.xz path: r2-static.tar.xz - - name: Static static r2 with meson + - name: Static static r2 with meson run: | sudo apt-get --assume-yes install python3-wheel python3-setuptools cabextract gperf sudo pip3 install meson ninja diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index eb7456a32e..3dd515b454 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -25,7 +25,7 @@ jobs: # the head of the pull request instead of the merge commit. - run: git checkout HEAD^2 if: ${{ github.event_name == 'pull_request' }} - + # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v1 diff --git a/Makefile b/Makefile index 88408986ce..2dac7992b9 100644 --- a/Makefile +++ b/Makefile @@ -171,7 +171,7 @@ ifneq ($(USE_ZIP),NO) $(ZIP) -r "${ZIPNAME}" "radare2-${WINBITS}-${VERSION}" endif -clean: +clean: rm -f libr/libr.a libr/libr.dylib libr/include/r_version.h rm -rf libr/.libr for DIR in shlr libr binr ; do $(MAKE) -C "$$DIR" clean ; done diff --git a/configure-plugins b/configure-plugins index 5a8cf81a80..0712ec59b6 100755 --- a/configure-plugins +++ b/configure-plugins @@ -37,7 +37,7 @@ if [ ! -f "$cfg" ]; then fi load () { - if [ -e $cfg ]; then + if [ -e $cfg ]; then echo "configure-plugins: Loading $cfg .." . $cfg else diff --git a/dist/maemo/description.txt b/dist/maemo/description.txt index 32ef9dd2d0..f221fa66bd 100644 --- a/dist/maemo/description.txt +++ b/dist/maemo/description.txt @@ -1,2 +1,2 @@ Advanced command line debugger and hexadecimal editor -It is composed by an hexadecimal editor (radare) with a wrapped IO layer supporting multiple backends for local/remote files, accessing filesystems, debugger (osx,bsd,linux,w32), stream analyzer, assembler/disassembler (rasm) for x86,arm,ppc,m68k,java,msil,sparc code analysis modules and scripting facilities. A bindiffer named radiff, base converter (rax), shellcode development helper (rasc), a binary information extractor supporting (pe, mach0, elf, class, ...) named rabin, and a block-based hash utility called rahash. +It is composed by an hexadecimal editor (radare) with a wrapped IO layer supporting multiple backends for local/remote files, accessing filesystems, debugger (osx,bsd,linux,w32), stream analyzer, assembler/disassembler (rasm) for x86,arm,ppc,m68k,java,msil,sparc code analysis modules and scripting facilities. A bindiffer named radiff, base converter (rax), shellcode development helper (rasc), a binary information extractor supporting (pe, mach0, elf, class, ...) named rabin, and a block-based hash utility called rahash. diff --git a/dist/snapcraft/snapcraft.yaml b/dist/snapcraft/snapcraft.yaml index 0b96be1942..a344ed6749 100644 --- a/dist/snapcraft/snapcraft.yaml +++ b/dist/snapcraft/snapcraft.yaml @@ -3,12 +3,12 @@ version: '4.5.0' base: core18 summary: Radare2 reverse engineering framework and tool description: | - Radare2 (also known as r2) is a complete framework for reverse-engineering - and analyzing binaries; composed of a set of small utilities - that can be used together or independently from the command line. - Built around a disassembler for computer software which generates - assembly language source code from machine-executable code, - it supports a variety of executable formats for different processors + Radare2 (also known as r2) is a complete framework for reverse-engineering + and analyzing binaries; composed of a set of small utilities + that can be used together or independently from the command line. + Built around a disassembler for computer software which generates + assembly language source code from machine-executable code, + it supports a variety of executable formats for different processors and operating systems. grade: devel # Development version, can only publish to beta/candidate channels. diff --git a/doc/android.md b/doc/android.md index 156c660d79..be9ef78d1d 100644 --- a/doc/android.md +++ b/doc/android.md @@ -21,11 +21,11 @@ To compile for android-x86 To package: - mkdir + mkdir make install DESTDIR=/usr Build farm, see `sys/android-shell.sh` and `sys/android-build.sh` - + sys/android-shell.sh sys/android-build.sh arm-static Environment: diff --git a/doc/avr.md b/doc/avr.md index 49733f4235..1165557016 100644 --- a/doc/avr.md +++ b/doc/avr.md @@ -3,7 +3,7 @@ AVR (arduino, atmega128, ..) Install JTAG serial driver: - http://www.wch.cn/download/CH341SER_MAC_ZIP.html + http://www.wch.cn/download/CH341SER_MAC_ZIP.html Install SDK from Arduino: diff --git a/doc/brainfuck.md b/doc/brainfuck.md index 50f155dcbc..2d274c5cfd 100644 --- a/doc/brainfuck.md +++ b/doc/brainfuck.md @@ -16,7 +16,7 @@ To debug a brainfuck program: The debugger creates virtual sections for code, data, screen and input. -TODO +TODO ---- - add support for comments, ignore invalid instructions as nops - enhance io and debugger plugins to generate sections and set arch opts diff --git a/doc/capstone.md b/doc/capstone.md index 419591b9ee..887868ffa0 100644 --- a/doc/capstone.md +++ b/doc/capstone.md @@ -1,7 +1,7 @@ Capstone ======== -Capstone Engine is the disassembler engine used by radare2 by default for +Capstone Engine is the disassembler engine used by radare2 by default for some architectures. R2 supports capstone 3, 4 and 5. diff --git a/doc/debug-internals.md b/doc/debug-internals.md index 131471ae22..1e3028a582 100644 --- a/doc/debug-internals.md +++ b/doc/debug-internals.md @@ -139,13 +139,13 @@ following files: // architecture-specific debugger code libr/debug/p/native/arm.c // unused? - + // code for handling backtracing libr/debug/p/native/bt.c libr/debug/p/native/bt/fuzzy-all.c libr/debug/p/native/bt/generic-x64.c libr/debug/p/native/bt/generic-x86.c - + // architecture-specific register handling libr/debug/p/native/drx.c // x86-specific debug registers libr/debug/p/native/reg.c // cute include of the files below @@ -155,11 +155,11 @@ following files: libr/debug/p/native/reg/netbsd-x86.h libr/debug/p/native/reg/windows-x64.h libr/debug/p/native/reg/windows-x86.h - + // platform-specific debugger code on Linux libr/debug/p/native/linux/linux_debug.c // main linux-specific debugging code libr/debug/p/native/linux/linux_debug.h // including cute penguin ascii art - + // architecture-specific register handling on Linux (?? what is this format??) libr/debug/p/native/linux/reg/linux-arm.h libr/debug/p/native/linux/reg/linux-arm64.h @@ -168,13 +168,13 @@ following files: libr/debug/p/native/linux/reg/linux-x64.h libr/debug/p/native/linux/reg/linux-x64-32.h libr/debug/p/native/linux/reg/linux-x86.h - + // platform-specific debugger code on Windows libr/debug/p/native/w32.c // !! not used by anything else libr/debug/p/native/maps/windows.c // platform-specific memory map handling libr/debug/p/native/windows/windows_debug.c // main code for win32 debugger plugin libr/debug/p/native/windows/windows_debug.h // including cute windows ascii art - + // platform-specific debugger code on XNU (OSX/iOS/etc) libr/debug/p/native/darwin.c // !! not used by anything else libr/debug/p/native/maps/darwin.c // platform-specific memory map handling @@ -185,7 +185,7 @@ following files: libr/debug/p/native/xnu/xnu_excthreads.c // additional XNU thread handling libr/debug/p/native/xnu/xnu_threads.c // XNU thread and register handling libr/debug/p/native/xnu/xnu_threads.h - + // architecture-specific register handling on XNU (?? what is this format??) libr/debug/p/native/xnu/reg/darwin-x86.h libr/debug/p/native/xnu/reg/darwin-arm.h diff --git a/doc/dospart b/doc/dospart index 13e63a1f60..90e63481b7 100644 --- a/doc/dospart +++ b/doc/dospart @@ -22,7 +22,7 @@ 0a OS/2 Boot ManagerOS/2 is the operating system designed by Microsoft and IBM to be 0a Coherent swap partition 0a OPUSOpen Parallel Unisys Server. -0b WIN95 OSR2 FAT32Partitions up to 2047GB. See +0b WIN95 OSR2 FAT32Partitions up to 2047GB. See 0c WIN95 OSR2 FAT32, LBA-mappedExtended-INT13 equivalent of 0b. 0e WIN95: DOS 16-bit FAT, LBA-mapped 0f WIN95: Extended partition, LBA-mappedWindows 95 uses 0e and 0f as the extended-INT13 equivalents @@ -31,7 +31,7 @@ 11 Leading Edge DOS 3.x 12 Configuration/diagnostics partitionID 12 (decimal 18) is used by Compaq for their configuration utility 14 Hidden DOS 16-bit FAT <32M(Ralf Brown's interrupt list adds: `ID 14 resulted from using Novell -14 AST DOS with +14 AST DOS with 16 Hidden DOS 16-bit FAT >=32M 17 Hidden IFS (e.g., HPFS) 18 AST SmartSleep PartitionAscentia laptops have a `Zero Volt Suspend Partition' @@ -40,18 +40,18 @@ 1c Hidden WIN95 OSR2 FAT32, LBA-mappedSometimes a hidden IBM rescue partition. 1e Hidden WIN95 16-bit FAT, LBA-mapped 20 UnusedRumoured to be used by Willowsoft Overture File System (OFS1), -21 Reserved(according to +21 Reserved(according to 21 UnusedClaimed for FSo2 (Oxygen File System) by Dave Poirier 22 UnusedClaimed for Oxygen Extended Partition Table by ekstazya@sprint.ca. 23 Reserved -24 NEC DOS 3.xThis is NEC MS-DOS 3.30 +24 NEC DOS 3.xThis is NEC MS-DOS 3.30 26 Reserved 27 PQserviceAcer laptop hidden rescue partition. Must be FAT32. 27 Windows RE hidden partitionOn MBR disks, type 0x27. On GPT disks, GUID: 27 MirOS partition 27 RouterBOOT kernel partitionSee 2a AtheOS File System (AFS)AtheOS is an open source operating system written by Kurt Skauen. -2b SyllableSecure (SylStor)A variation on AthFS is +2b SyllableSecure (SylStor)A variation on AthFS is 31 Reserved 32 NOSSimon Butcher (simonb@alien.net.au) writes: 33 Reserved @@ -64,7 +64,7 @@ 3a THEOS ver 4 4gb partition 3b THEOS ver 4 extended partitionTHEOS is a multiuser multitasking OS for PCs founded by Timothy Williams 3c PartitionMagic recovery partitionCody Batt (codyb@powerquest.com) writes: -3d Hidden NetWareAccording to +3d Hidden NetWareAccording to 40 Venix 80286A very old Unix-like operating system for PCs. 40 PICKRoss Stell writes: 41 Linux/MINIX (sharing disk with DRDOS)Very old FAQs recommended to use 41 etc instead of 81 etc @@ -76,18 +76,18 @@ 43 Linux native (sharing disk with DRDOS) 44 GoBack partition 45 Boot-US boot managerUlrich Straub (ustraub@boot-us.de) writes: -45 PriamAccording to -45 EUMEL/Elan -46 EUMEL/Elan -47 EUMEL/Elan +45 PriamAccording to +45 EUMEL/Elan +46 EUMEL/Elan +47 EUMEL/Elan 48 EUMEL/Elan Eumel, and later Ergos L3, are multiuser multitasking systems -4a Mark Aitchison's ALFS/THIN lightweight filesystem for DOSAccording to +4a Mark Aitchison's ALFS/THIN lightweight filesystem for DOSAccording to 4a AdaOS Aquila (Withdrawn)Nick Roberts at some point in time announced that he would use 4a -4c Oberon partitionSee +4c Oberon partitionSee 4d QNX4.x 4e QNX4.x 2nd part 4f QNX4.x 3rd partQNX is a POSIX-certified, microkernel, distributed, fault-tolerant -4f Oberon partitionSee +4f Oberon partitionSee 50 OnTrack Disk Manager (older versions) RODisk Manager is a program of OnTrack, to enable people to use 50 Lynx RTOS"Beginning with version 3.0, LynxOS gives users the ability to 50 Native Oberon (alt) @@ -124,14 +124,14 @@ 76 Reserved 77 M2FS/M2CS partitionJeff Merkey writes: 77 is one we are using internally for M2FS/M2CS partitions. 77 VNDI Partition(According to disk.c in the Netware source. Not in actual use.) -78 XOSL FSXOSL Bootloader filesystem, see +78 XOSL FSXOSL Bootloader filesystem, see 7e UnusedClaimed for F.I.X. by gruberr@kapsch.net. See dejanews. -7f UnusedProposed for the +7f UnusedProposed for the 80 MINIX until 1.4a 81 MINIX since 1.4b, early LinuxMinix is a Unix-like operating system written by Andy Tanenbaum 81 Mitac disk manager 82 Prime -82 Solaris x86Solaris creates a single partition with id 0x82, then uses Sun disk labels +82 Solaris x86Solaris creates a single partition with id 0x82, then uses Sun disk labels 82 Linux swap 83 Linux native partitionLinux is a Unix-like operating system written by Linus Torvalds 84 OS/2 hidden C: driveOS/2-renumbered type 04 partition. @@ -145,7 +145,7 @@ 8b Legacy Fault Tolerant FAT32 volume 8c Legacy Fault Tolerant FAT32 volume using BIOS extd INT 13h 8d Free FDISK 0.96+ hidden Primary DOS FAT12 partitition -8e Linux Logical Volume Manager partitionSee +8e Linux Logical Volume Manager partitionSee 90 Free FDISK 0.96+ hidden Primary DOS FAT16 partitition 91 Free FDISK 0.96+ hidden DOS extended partitition 92 Free FDISK 0.96+ hidden Primary DOS large FAT16 partitition @@ -156,7 +156,7 @@ 96 CHRP ISO-9660 filesystem 97 Free FDISK 0.96+ hidden Primary DOS FAT32 partitition 98 Free FDISK 0.96+ hidden Primary DOS FAT32 partitition (LBA) -98 Datalight ROM-DOS Super-Boot PartitionSee +98 Datalight ROM-DOS Super-Boot PartitionSee 99 DCE376 logical driveNo, it's not a hibernation partition; it's closest to a DOS extended 9a Free FDISK 0.96+ hidden Primary DOS FAT16 partitition (LBA) 9b Free FDISK 0.96+ hidden DOS extended partitition (LBA) @@ -200,7 +200,7 @@ c0 REAL/32 secure small partitionSee d0 below. c0 NTFT PartitionAccording to disk.c in the Netware source. c0 DR-DOS/Novell DOS secured partitionDR-DOS 7.02+ / OpenDOS 7.01 / Novell DOS 7 secured partition. c1 DRDOS/secured (FAT-12) -c2 UnusedAccording to +c2 UnusedAccording to c2 Hidden Linux c3 Hidden Linux swapBenedict Chong (bchong@blueskyinnovations.com) writes: c4 DRDOS/secured (FAT-16, < 32M) @@ -214,7 +214,7 @@ c9 Reserved for DR-DOS 8.0+ ca Reserved for DR-DOS 8.0+ cb DR-DOS 7.04+ secured FAT32 (CHS)/ cc DR-DOS 7.04+ secured FAT32 (LBA)/ -cd CTOS Memdump? +cd CTOS Memdump? ce DR-DOS 7.04+ FAT16X (LBA)/ cf DR-DOS 7.04+ secured EXT DOS (LBA)/ d0 REAL/32 secure big partitionREAL/32 is a continuation of DR Multiuser DOS. @@ -229,11 +229,11 @@ da Powercopy BackupPowercopy Backup (shielded disk), db Digital Research CP/M, Concurrent CP/M, Concurrent DOS db CTOS (Convergent Technologies OS -Unisys) db KDG Telemetry SCPU bootMark Morgan Lloyd (markMLl.in@telemetry.co.uk) writes: -dd Hidden CTOS Memdump? +dd Hidden CTOS Memdump? de Dell PowerEdge Server utilities (FAT fs) df DG/UX virtual disk manager partitionGlenn Steen (glenn.steen@ap1.se) writes: df BootIt EMBRMThe boot manager BootIt manages its own partition table, -e0 Reserved by +e0 Reserved by e1 DOS access or SpeedStor 12-bit FAT extended partitionKevin Cummings reports in alt.os.linux: e3 DOS R/O or SpeedStor e4 SpeedStor 16-bit FAT extended partition < 1024 cyl. diff --git a/doc/emscripten.md b/doc/emscripten.md index 8e07c87ea3..6acfaa0af6 100644 --- a/doc/emscripten.md +++ b/doc/emscripten.md @@ -19,7 +19,7 @@ Building for the browser export CC="emcc --ignore-dynamic-linking" ./configure --prefix=/usr --disable-shared --enable-static --disable-debugger --with-compiler=emscripten --without-pic --with-nonpic -emmake make -j4 +emmake make -j4 cd binr/radare2 emcc ../../libr/*/*.o radare2.c -I ../../libr/include/ -DR2_BIRTH=\"pop\" -DR2_GITTIP=\"123\" ../../libr/db/sdb/src/*.o diff --git a/doc/esil.md b/doc/esil.md index f805088c13..6e7d0911f5 100644 --- a/doc/esil.md +++ b/doc/esil.md @@ -43,7 +43,7 @@ Conditionals are expressed with the '?' char at the beginning of the expression. cmp eax, 123 -> 123,eax,==,$z,zf,= jz eax -> zf,?{,eax,eip,=,} -So.. if you want to run more than one expression under a conditional, you'll have to write it +So.. if you want to run more than one expression under a conditional, you'll have to write it zf,?{,eip,esp,=[],eax,eip,=,$r,esp,-=,} diff --git a/doc/gdb.md b/doc/gdb.md index 9854afcab9..1c08aca0b7 100644 --- a/doc/gdb.md +++ b/doc/gdb.md @@ -36,7 +36,7 @@ Supported Commands - read registers Reading registers is currently implemented through the packet of the gdb protocol. - It returns the whole register profile at once. + It returns the whole register profile at once. - write registers @@ -51,7 +51,7 @@ Supported Packets: - `g` : Reads the whole register Profile at once - `G` : Writes the whole register Profile at once -- `m` : Reads memory +- `m` : Reads memory - `M` : Writes memory - `vCont,v` : continues execution of the binary - `P` : Write one register @@ -59,7 +59,7 @@ Supported Packets: TODO ---- -- Implement GDBserver to allow other apps use r2 debugger +- Implement GDBserver to allow other apps use r2 debugger - Fix that usese the gdb internal stepping version - Fix softstep, that it finally recoils correct (it just have to reset the eip/rip) - Add Breakpoints (should be an easy add of the function, because its already implemented in the gdb lib) diff --git a/doc/iocache b/doc/iocache index 984905b241..b5aa3c6d4f 100644 --- a/doc/iocache +++ b/doc/iocache @@ -1,20 +1,20 @@ io cache and write changes -[0x000018a0]> wc? +[0x000018a0]> wc? Usage: wc[ir*?] wc list all write changes wc* "" in radare commands wcr reset all write changes in cache wci commit write cache NOTE: Needs io.cache=true -[0x000018a0]> e io.cache=true -[0x000018a0]> wx 9090 -[0x000018a0]> wc +[0x000018a0]> e io.cache=true +[0x000018a0]> wx 9090 +[0x000018a0]> wc addr=0x000018a0 size=2 -[0x000018a0]> wc* +[0x000018a0]> wc* wx 9090 @ 0x000018a0 -[0x000018a0]> wci +[0x000018a0]> wci r_io_write: cannot write on fd 3 -[0x000018a0]> wcr -[0x000018a0]> wc -[0x000018a0]> +[0x000018a0]> wcr +[0x000018a0]> wc +[0x000018a0]> diff --git a/doc/iphone.md b/doc/iphone.md index 4a499b98ac..8d61164c52 100644 --- a/doc/iphone.md +++ b/doc/iphone.md @@ -43,7 +43,7 @@ Setup SDK for ARMv6 5) Get the varinclude tarball - wget lolcathost.org/b/varinclude.tar.gz + wget lolcathost.org/b/varinclude.tar.gz tar xzvf varinclude.tar.gz -C / Compilation @@ -67,7 +67,7 @@ Building with the ARMv7 SDK From coolstar repo we get the ios toolchain apt-get coreutils install wget inetutils - apt-get install basename git make expat + apt-get install basename git make expat apt-get install org.coolstar.iostoolchain * Copy crt1.o and dylib1.o from your iOS SDK into /usr/lib @@ -80,7 +80,7 @@ From coolstar repo we get the ios toolchain cd /usr/bin ln -fs clang gcc - + Build ----- export CC=clang diff --git a/doc/lang-plugins b/doc/lang-plugins index 9d3044ab01..2d1b23cb52 100644 --- a/doc/lang-plugins +++ b/doc/lang-plugins @@ -7,7 +7,7 @@ interface from each method hook. We should define a common and simple way to design those inter- language communications. -With this interface properly defined we can get some more fun and +With this interface properly defined we can get some more fun and write the language bindings using the same lang-C api. A simple perl script can be used to parse function signatures and diff --git a/doc/license.md b/doc/license.md index 49e2aee48f..4ba37b1be2 100644 --- a/doc/license.md +++ b/doc/license.md @@ -1,6 +1,6 @@ # Licensing -Before you try to statically link r2, you should know about the licenses that go along with it, +Before you try to statically link r2, you should know about the licenses that go along with it, http://stackoverflow.com/questions/10130143/gpl-lgpl-and-static-linking @@ -8,7 +8,7 @@ Also this stackoverflow page explains the legal case of using it via r2pipe, http://stackoverflow.com/questions/1394623/can-i-dynamically-call-a-lgpl-gpl-software-in-my-closed-source-application -LGPLv3 keeps the freedom to the user to switch to a different version of the r2 libraries, so static linking is not permitted unless the privative software is distributed with the object files needed to do the full static link, so the users will be able to upgrade or modify r2 libraries even if +LGPLv3 keeps the freedom to the user to switch to a different version of the r2 libraries, so static linking is not permitted unless the privative software is distributed with the object files needed to do the full static link, so the users will be able to upgrade or modify r2 libraries even if r2 is licensed under the LGPL license, which permits statically linking, but forces you to liberate the object files and a way to allow users to link them. @@ -52,7 +52,7 @@ Please refer to the radare2-webui repository for a detailed list of all the java ## Non-LGPL code shipped in r2 -Some parts of r2 are not under the LGPL license, this is a list of them sorted +Some parts of r2 are not under the LGPL license, this is a list of them sorted ### GPL: More restrictive than LGPL diff --git a/doc/maemo.md b/doc/maemo.md index 6e73fa0bd6..2f92da3d0d 100644 --- a/doc/maemo.md +++ b/doc/maemo.md @@ -1,7 +1,7 @@ Build for maemo6 (Harmattan) N9 - N950 ====================================== -1. Install QtSDK +1. Install QtSDK http://qt.nokia.com/downloads/ diff --git a/doc/oo.md b/doc/oo.md index ecad156afb..c7343daf66 100644 --- a/doc/oo.md +++ b/doc/oo.md @@ -26,7 +26,7 @@ Global picture - simplify code A library implements a set of functionalities, those ones are mainly -the lifecycle of the class containing the state of +the lifecycle of the class containing the state of Plugins are singletons. Or we will have to create factories for every class. diff --git a/doc/pdb/index.js b/doc/pdb/index.js index d03be9b77a..b27714e573 100644 --- a/doc/pdb/index.js +++ b/doc/pdb/index.js @@ -60,14 +60,14 @@ var extract_pdb_file = function (archive_name, dbg_fname) { console.log('check if cabextract is installed'); process.exit(1); }); - + cab_extractor_cmd.on('exit', function (code) { if (code != 0) { console.log("Failed to extract with code: " + code); } else { fs.unlink(archive_name); console.log("File " + archive_name + " has been uncompressed successfully"); - } + } }); }; @@ -75,14 +75,14 @@ var curl_start = function(guid, dbg_fname) { var archive_name = dbg_fname; var link_end = ''; var spawn = require('child_process').spawn; - - archive_name = archive_name.substring(0, archive_name.length - 1) + '_'; + + archive_name = archive_name.substring(0, archive_name.length - 1) + '_'; link_end = '/' + dbg_fname + '/' + guid + '/' + archive_name; var stream = fs.createWriteStream(archive_name, {flags:'a'}); - + console.log("downloading file: " + archive_name); - + var curl_ = new curl(DOWNLOABLE_LINK + link_end, {RAW:0}, function(err) { console.info(this); return; @@ -95,13 +95,13 @@ var curl_start = function(guid, dbg_fname) { stream.write(chunk); return chunk.length; }); - + curl_.on('error', function(e) { console.log('File: ' + archive_name + 'has not been downloaded successfully'); curl_.close(); return; }); - + curl_.on('end', function() { console.log('File ' + archive_name + 'has been downloaded and saved successfully'); console.log('Decompress of file: ' + archive_name); @@ -125,13 +125,13 @@ var downloader = function (currentValue, index, array) { if (currentValue.indexOf('pdb') != -1) { return; } - + rabin2_cmd.stdout.on('error', function (err) { console.log('check if rabin is installed'); process.exit(1); }); - - rabin2_cmd.stdout.on('data', function (data) { + + rabin2_cmd.stdout.on('data', function (data) { data.toString().split(EOL).map(function (str) { var parts = str.split(' '); @@ -171,7 +171,7 @@ walk(IN_FOLDER, function(err, results) { console.log('Error while walking the directory.Error: ' + err); process.exit(1); } - + results.forEach(downloader); }); diff --git a/doc/r2s/r2-5.5.0.r2s b/doc/r2s/r2-5.5.0.r2s index f12c95e671..ff770b5d59 100644 --- a/doc/r2s/r2-5.5.0.r2s +++ b/doc/r2s/r2-5.5.0.r2s @@ -38,7 +38,7 @@ is then taken by the text before '.vasm' This is an optional feature, so it's also optional to test it unless you are looking for modiying binaries for the supported architectures. -Supported archs: +Supported archs: * arm.vasm, 6502.vasm, 6809, c16x, jagrisc, m68k, * pdp11, ppc, qnice, tr3200, vidcore, x86, z80" diff --git a/doc/rap.md b/doc/rap.md index 9eac43f929..c6d382f5d9 100644 --- a/doc/rap.md +++ b/doc/rap.md @@ -72,7 +72,7 @@ This is how are constructed the packets: << 84 RAP_CLOSE - >> 05 FD=(4 bytes) + >> 05 FD=(4 bytes) << 85 RET=(4 bytes) RAP_SYSTEM diff --git a/doc/sandbox/rabin2.sb b/doc/sandbox/rabin2.sb index 86ed10463f..6f1bb9d53c 100644 --- a/doc/sandbox/rabin2.sb +++ b/doc/sandbox/rabin2.sb @@ -34,6 +34,6 @@ #"^/usr/lib/system/*" #"^/usr/lib/libr*" #"^/usr/bin/rabin2" - ) + ) ) (deny default) diff --git a/doc/sandbox/radare2.sb b/doc/sandbox/radare2.sb index dbfff5ce53..a05b065444 100644 --- a/doc/sandbox/radare2.sb +++ b/doc/sandbox/radare2.sb @@ -37,6 +37,6 @@ #"^/usr/lib/libr*" #"^/usr/bin/r2" #"^/bin/ls" - ) + ) ) (deny default) diff --git a/doc/sdb_ordinal.md b/doc/sdb_ordinal.md index c0803f8ed0..eef21bc54a 100644 --- a/doc/sdb_ordinal.md +++ b/doc/sdb_ordinal.md @@ -1,6 +1,6 @@ # Cannot find R2PATH/format/dll/DLLNAME.sdb -1. Execute `rabin2 -rs DLLNAME.dll | grep -i DLLNAME | grep -v Ordi |grep ^k| cut -d / -f 4- > DLLNAME.sdb.txt` +1. Execute `rabin2 -rs DLLNAME.dll | grep -i DLLNAME | grep -v Ordi |grep ^k| cut -d / -f 4- > DLLNAME.sdb.txt` 2. Upload file `DLLNAME.sdb.txt` in https://github.com/radareorg/radare2/tree/master/libr/bin/d/dll 3. Change the following [Makefile](https://github.com/radareorg/radare2/blob/master/libr/bin/d/Makefile#L14) 4. Create a Pull Request to Master diff --git a/doc/snap.md b/doc/snap.md index 800fc42576..f165a1fac6 100644 --- a/doc/snap.md +++ b/doc/snap.md @@ -1,25 +1,25 @@ Installing the snap package of radare2 ====================================== -radare2 is also available as a snap package and can be installed on a system that supports snap packages. See [Installing snapd](https://snapcraft.io/docs/installing-snapd) to setup your system to support snap packages. +radare2 is also available as a snap package and can be installed on a system that supports snap packages. See [Installing snapd](https://snapcraft.io/docs/installing-snapd) to setup your system to support snap packages. Status of snap package support ------------------------------ -Currently, radare2 is available as a _beta_ snap package that works in _devmode_ security confinement (developer mode). Refer back to this section for updated instructions when radare2 is out of _beta/devmode_. +Currently, radare2 is available as a _beta_ snap package that works in _devmode_ security confinement (developer mode). Refer back to this section for updated instructions when radare2 is out of _beta/devmode_. -Currently, you need to prepend `radare2.` to each command you want to run. For example, use `radare2.rabin2` to run `rabin2`. +Currently, you need to prepend `radare2.` to each command you want to run. For example, use `radare2.rabin2` to run `rabin2`. Snap packages that work in _devmode_ security confinement do not appear in search results, when you search for them in the Snap Store. To find information about this snap package, run `snap info radare2`. See the section below on this. Installing radare2 ----------------- -This command installs the `radare2` snap package from the _beta_ channel, using the _devmode_ (developer mode) security confinement type. The _devmode_ security confinement disables any restrictions that are applied to typical snap packages. _devmode_ makes a package to work similar to APT and RPM packages. +This command installs the `radare2` snap package from the _beta_ channel, using the _devmode_ (developer mode) security confinement type. The _devmode_ security confinement disables any restrictions that are applied to typical snap packages. _devmode_ makes a package to work similar to APT and RPM packages. $ sudo snap install radare2 --channel=beta --devmode - + Running commands ---------------- -Currently, the radare2 commands can be invoked with the following names: +Currently, the radare2 commands can be invoked with the following names: - `radare2` or `radare2.radare2`: The `r2`/`radare2` command. - `radare2.r2pm` : The `r2pm` command. @@ -43,12 +43,12 @@ Run the following command to get info about the radare2 snap package. You can se $ snap info radare2 ... description: | - Radare2 (also known as r2) is a complete framework for reverse-engineering - and analyzing binaries; composed of a set of small utilities - that can be used together or independently from the command line. - Built around a disassembler for computer software which generates - assembly language source code from machine-executable code, - it supports a variety of executable formats for different processors + Radare2 (also known as r2) is a complete framework for reverse-engineering + and analyzing binaries; composed of a set of small utilities + that can be used together or independently from the command line. + Built around a disassembler for computer software which generates + assembly language source code from machine-executable code, + it supports a variety of executable formats for different processors and operating systems. commands: @@ -79,11 +79,11 @@ Updating radare2 ---------------- The snap packages that are installed in _devmode_ are not updated automatically. -You can update manually: +You can update manually: $ sudo snap refresh radare2 -See the section above on how to get info about the radare2 snap package and how to determine whether there is an updated version available. +See the section above on how to get info about the radare2 snap package and how to determine whether there is an updated version available. Uninstalling radare2 -------------------- @@ -106,7 +106,7 @@ Troubleshooting --------------- - _error: snap "radare2" is not available on stable_: When installing the snap package of radare2, you currently need to specify the _beta_ channel. Append `--channel=beta` on the installation command line. -- _error: The publisher of snap "radare2" has indicated that they do not consider this revision to be of production quality_: When installing the snap package of radare2, you currently need to specify the _devmode_ confinement. Append `--devmode` on the installation command line. -- _How can I download the snap package for offline use?_: Use the command `snap download radare2 --channel=beta`. You can then run `sudo snap install` to install the `.snap` package that was just downloaded. +- _error: The publisher of snap "radare2" has indicated that they do not consider this revision to be of production quality_: When installing the snap package of radare2, you currently need to specify the _devmode_ confinement. Append `--devmode` on the installation command line. +- _How can I download the snap package for offline use?_: Use the command `snap download radare2 --channel=beta`. You can then run `sudo snap install` to install the `.snap` package that was just downloaded. - _Do I need to use "sudo" with snap commands?_: You need to prepend `sudo` when you run most snap commands that perform privileged actions. However, if you log in into the Snap Store using `sudo snap login`, then you do not need anymore to prepend `sudo`. diff --git a/libr/anal/class.c b/libr/anal/class.c index 19e986111b..fb54a49839 100644 --- a/libr/anal/class.c +++ b/libr/anal/class.c @@ -1205,7 +1205,7 @@ R_API void r_anal_class_list_vtables(RAnal *anal, const char *class_name) { static void list_all_functions_at_vtable_offset(RAnal *anal, const char *class_name, ut64 offset) { RVTableContext vtableContext; r_anal_vtable_begin (anal, &vtableContext); - ut8 function_ptr_size = vtableContext.word_size; + ut8 function_ptr_size = vtableContext.word_size; ut64 func_address; RVector *vtables = r_anal_class_vtable_get_all (anal, class_name); @@ -1252,10 +1252,10 @@ R_API void r_anal_class_list_vtable_offset_functions(RAnal *anal, const char *cl } /** - * @brief Creates RGraph from class inheritance information where + * @brief Creates RGraph from class inheritance information where * each node has RGraphNodeInfo as generic data - * - * @param anal + * + * @param anal * @return RGraph* NULL if failure */ R_API RGraph *r_anal_class_get_inheritance_graph(RAnal *anal) { diff --git a/libr/anal/esil.c b/libr/anal/esil.c index 7e16aec575..069b617745 100644 --- a/libr/anal/esil.c +++ b/libr/anal/esil.c @@ -7,7 +7,7 @@ #ifdef __wasi__ #define FE_OVERFLOW 0 -#define feclearexcept(x) +#define feclearexcept(x) #endif // should these be here? #include @@ -598,7 +598,7 @@ R_API bool r_anal_esil_signext(RAnalEsil *esil, bool assign) { } //Make sure the other bits are 0 - src &= UT64_MAX >> (64 - dst); + src &= UT64_MAX >> (64 - dst); ut64 m = 0; if (dst < 64) { @@ -1737,7 +1737,7 @@ static void mult64to128(ut64 op1, ut64 op2, ut64 *hi, ut64 *lo) { static bool esil_long_mul(RAnalEsil *esil) { bool ret = false; - ut64 s, d; + ut64 s, d; ut64 hi, lo; char *dst = r_anal_esil_pop (esil); char *src = r_anal_esil_pop (esil); diff --git a/libr/anal/global.c b/libr/anal/global.c index f2061182bd..4402af71c4 100644 --- a/libr/anal/global.c +++ b/libr/anal/global.c @@ -31,7 +31,7 @@ R_API bool r_anal_global_add(RAnal *anal, ut64 addr, const char *type_name, cons r_flag_item_set_type (fi, fmtstr); } r_meta_set (anal, R_META_TYPE_FORMAT, addr, fmtsize, fmtstr); - // implicit + // implicit r_type_set_link (anal->sdb_types, fmtstr, addr); return true; } diff --git a/libr/anal/p/anal_arm_cs.c b/libr/anal/p/anal_arm_cs.c index 1bf977cb1c..f5e021185c 100644 --- a/libr/anal/p/anal_arm_cs.c +++ b/libr/anal/p/anal_arm_cs.c @@ -1040,10 +1040,10 @@ static void vector64_append(RStrBuf *sb, csh *handle, cs_insn *insn, int n, int size_t s = sizeof (bitmask_by_width) / sizeof (*bitmask_by_width); int width = size > 0? (size - 1) % s: 0; if (shift > 0) { - r_strbuf_appendf (sb, "0x%"PFMT64x",%d,%s%s,>>,&", + r_strbuf_appendf (sb, "0x%"PFMT64x",%d,%s%s,>>,&", bitmask_by_width[width], shift, REG64 (n), regc); } else { - r_strbuf_appendf (sb, "0x%"PFMT64x",%s%s,&", + r_strbuf_appendf (sb, "0x%"PFMT64x",%s%s,&", bitmask_by_width[width], REG64 (n), regc); } } else { @@ -1080,11 +1080,11 @@ static void vector64_dst_append(RStrBuf *sb, csh *handle, cs_insn *insn, int n, } if (shift > 0 && shift < 64) { - r_strbuf_appendf (sb, "%d,SWAP,0x%"PFMT64x",&,<<,%s%s,0x%"PFMT64x",&,|,%s%s", + r_strbuf_appendf (sb, "%d,SWAP,0x%"PFMT64x",&,<<,%s%s,0x%"PFMT64x",&,|,%s%s", shift, mask, REG64 (n), regc, VEC64_MASK (shift, size), REG64 (n), regc); } else { int dimsize = size % 64; - r_strbuf_appendf (sb, "0x%"PFMT64x",&,%s%s,0x%"PFMT64x",&,|,%s%s", + r_strbuf_appendf (sb, "0x%"PFMT64x",&,%s%s,0x%"PFMT64x",&,|,%s%s", mask, REG64 (n), regc, VEC64_MASK (shift, dimsize), REG64 (n), regc); } } else { @@ -1098,13 +1098,13 @@ static ut64 shifted_imm64(csh *handle, cs_insn *insn, int n, int sz) { cs_arm64_op op = INSOP64 (n); int sft = op.shift.value; switch (op.shift.type) { - case ARM64_SFT_MSL: + case ARM64_SFT_MSL: return (IMM64 (n) << sft) | ((1 << sft) - 1); case ARM64_SFT_LSL: return IMM64 (n) << sft; case ARM64_SFT_LSR: return IMM64 (n) >> sft; - case ARM64_SFT_ROR: + case ARM64_SFT_ROR: return (IMM64 (n) >> sft)|(IMM64 (n) << (sz - sft)); case ARM64_SFT_ASR: switch (sz) { @@ -1224,7 +1224,7 @@ static void arm64fpmath(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int le cs_arm64_op dst = INSOP64 (0); int start = -1; - int end = 0; + int end = 0; int convert = size == 64 ? 0 : 1; if (dst.vas) { start = 0; @@ -1462,7 +1462,7 @@ static int analop64_esil(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int l cs_arm64_op src = INSOP64 (1); if (dst.vas && src.vas) { - r_strbuf_setf (&op->esil, "%sh,%sh,=,%sl,%sl,=", + r_strbuf_setf (&op->esil, "%sh,%sh,=,%sl,%sl,=", REG64 (1), REG64 (0), REG64 (1), REG64 (0)); } else { ARG64_APPEND (&op->esil, 1); @@ -1477,7 +1477,7 @@ static int analop64_esil(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int l case ARM64_INS_FCCMP: case ARM64_INS_FCCMPE: if (ISREG64 (1)) { - r_strbuf_setf (&op->esil, + r_strbuf_setf (&op->esil, "%d,%s,F2D,NAN,%d,%s,F2D,NAN,|,vf,:=" ",%d,%s,F2D,%d,%s,F2D,F==,vf,|,zf,:=" ",%d,%s,F2D,%d,%s,F2D,F<,vf,|,nf,:=", @@ -1486,7 +1486,7 @@ static int analop64_esil(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int l REGBITS64 (1), REG64 (1), REGBITS64 (1), REG64 (0) ); } else { - r_strbuf_setf (&op->esil, + r_strbuf_setf (&op->esil, "%d,%s,F2D,NAN,vf,:=" ",0,I2D,%d,%s,F2D,F==,vf,|,zf,:=" ",0,I2D,%d,%s,F2D,F<,vf,|,nf,:=", @@ -1504,7 +1504,7 @@ static int analop64_esil(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int l } break; case ARM64_INS_FCVT: - r_strbuf_setf (&op->esil, "%d,%d,%s,F2D,D2F,%s,=", + r_strbuf_setf (&op->esil, "%d,%d,%s,F2D,D2F,%s,=", REGBITS64 (0), REGBITS64 (1), REG64 (1), REG64 (0)); break; case ARM64_INS_SCVTF: @@ -1565,17 +1565,17 @@ static int analop64_esil(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int l REGBITS64 (1), REG64 (1), REG64 (0)); break; case ARM64_INS_FNEG: - r_strbuf_setf (&op->esil, "%d,DUP,%s,F2D,-F,D2F,%s,=", + r_strbuf_setf (&op->esil, "%d,DUP,%s,F2D,-F,D2F,%s,=", REGBITS64 (1), REG64 (1), REG64 (0)); break; case ARM64_INS_FMIN: - r_strbuf_setf (&op->esil, "%d,%s,F2D,%d,%s,F2D,F<,?{,%s,}{,%s,},%s,=", - REGBITS64 (2), REG64 (2), + r_strbuf_setf (&op->esil, "%d,%s,F2D,%d,%s,F2D,F<,?{,%s,}{,%s,},%s,=", + REGBITS64 (2), REG64 (2), REGBITS64 (1), REG64 (1), REG64 (1), REG64 (2), REG64 (0)); break; case ARM64_INS_FMAX: - r_strbuf_setf (&op->esil, "%d,%s,F2D,%d,%s,F2D,F<,!,?{,%s,}{,%s,},%s,=", - REGBITS64 (2), REG64 (2), + r_strbuf_setf (&op->esil, "%d,%s,F2D,%d,%s,F2D,F<,!,?{,%s,}{,%s,},%s,=", + REGBITS64 (2), REG64 (2), REGBITS64 (1), REG64 (1), REG64 (1), REG64 (2), REG64 (0)); break; case ARM64_INS_FADD: @@ -1591,26 +1591,26 @@ static int analop64_esil(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int l FPOPCALL_NEGATE("*"); break; case ARM64_INS_FMADD: - r_strbuf_setf (&op->esil, "%d,DUP,%s,F2D,%d,%s,F2D,F*,%d,%s,F2D,F+,D2F,%s,=", - REGBITS64 (1), REG64 (1), - REGBITS64 (2), REG64 (2), + r_strbuf_setf (&op->esil, "%d,DUP,%s,F2D,%d,%s,F2D,F*,%d,%s,F2D,F+,D2F,%s,=", + REGBITS64 (1), REG64 (1), + REGBITS64 (2), REG64 (2), REGBITS64 (3), REG64 (3), REG64 (0)); break; case ARM64_INS_FNMADD: - r_strbuf_setf (&op->esil, "%d,DUP,%s,F2D,%d,%s,F2D,F*,-F,%d,%s,F2D,F+,-F,D2F,%s,=", - REGBITS64 (1), REG64 (1), - REGBITS64 (2), REG64 (2), + r_strbuf_setf (&op->esil, "%d,DUP,%s,F2D,%d,%s,F2D,F*,-F,%d,%s,F2D,F+,-F,D2F,%s,=", + REGBITS64 (1), REG64 (1), + REGBITS64 (2), REG64 (2), REGBITS64 (3), REG64 (3), REG64 (0)); break; case ARM64_INS_FMSUB: - r_strbuf_setf (&op->esil, "%d,DUP,%s,F2D,%d,%s,F2D,F*,%d,%s,F2D,F-,D2F,%s,=", - REGBITS64 (1), REG64 (1), - REGBITS64 (2), REG64 (2), + r_strbuf_setf (&op->esil, "%d,DUP,%s,F2D,%d,%s,F2D,F*,%d,%s,F2D,F-,D2F,%s,=", + REGBITS64 (1), REG64 (1), + REGBITS64 (2), REG64 (2), REGBITS64 (3), REG64 (3), REG64 (0)); break; case ARM64_INS_FNMSUB: - r_strbuf_setf (&op->esil, "%d,DUP,%s,F2D,%d,%s,F2D,F*,-F,%d,%s,F2D,F-,-F,D2F,%s,=", - REGBITS64 (1), REG64 (1), + r_strbuf_setf (&op->esil, "%d,DUP,%s,F2D,%d,%s,F2D,F*,-F,%d,%s,F2D,F-,-F,D2F,%s,=", + REGBITS64 (1), REG64 (1), REGBITS64 (2), REG64 (2), REGBITS64 (3), REG64 (3), REG64 (0)); break; @@ -1624,7 +1624,7 @@ static int analop64_esil(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int l /* TODO: support WZR XZR to specify 32, 64bit op */ OPCALL("/"); break; -#if CS_API_MAJOR > 4 +#if CS_API_MAJOR > 4 case ARM64_INS_BRAA: case ARM64_INS_BRAAZ: case ARM64_INS_BRAB: @@ -1640,7 +1640,7 @@ static int analop64_esil(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int l case ARM64_INS_BL: r_strbuf_setf (&op->esil, "pc,lr,=,%"PFMT64d",pc,=", IMM64 (0)); break; -#if CS_API_MAJOR > 4 +#if CS_API_MAJOR > 4 case ARM64_INS_BLRAA: case ARM64_INS_BLRAAZ: case ARM64_INS_BLRAB: @@ -1738,7 +1738,7 @@ static int analop64_esil(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int l if (HASMEMINDEX64 (1)) { if (LSHIFT2_64 (1) || EXT64 (1)) { ARG64_APPEND (&op->esil, 1); - r_strbuf_appendf (&op->esil, ",%s,+,[%d],%s,=", + r_strbuf_appendf (&op->esil, ",%s,+,[%d],%s,=", MEMBASE64 (1), size, REG64 (0)); } else { r_strbuf_appendf (&op->esil, "%s,%s,+,[%d],%s,=", @@ -1902,7 +1902,7 @@ static int analop64_esil(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int l ARG64_APPEND(&op->esil, 1); COMMA(&op->esil); ARG64_APPEND(&op->esil, 0); - r_strbuf_appendf (&op->esil, ",==,$z,zf,:=,%d,$s,nf,:=,%d,$b,!,cf,:=,%d,$o,vf,:=", + r_strbuf_appendf (&op->esil, ",==,$z,zf,:=,%d,$s,nf,:=,%d,$b,!,cf,:=,%d,$o,vf,:=", REGBITS64 (0) - 1, REGBITS64 (0), REGBITS64 (0) -1); if (insn->id == ARM64_INS_CCMP || insn->id == ARM64_INS_CCMN) { @@ -2159,7 +2159,7 @@ static int analop64_esil(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int l break; case ARM64_INS_RBIT: // slightly shorter expression to reverse bits - r_strbuf_setf (&op->esil, "0,tmp,=,0,DUP,DUP,DUP,%d,-,%s,>>,1,&,<<,tmp,+=,%d,-,?{,++,4,GOTO,},tmp,%s,=", + r_strbuf_setf (&op->esil, "0,tmp,=,0,DUP,DUP,DUP,%d,-,%s,>>,1,&,<<,tmp,+=,%d,-,?{,++,4,GOTO,},tmp,%s,=", REGBITS64 (1)-1, REG64 (1), REGBITS64 (1)-1, REG64 (0)); break; case ARM64_INS_MVN: @@ -2169,7 +2169,7 @@ static int analop64_esil(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int l cs_arm64_op src = INSOP64 (1); if (dst.vas && src.vas) { - r_strbuf_setf (&op->esil, "%sh,-1,^,%sh,=,%sl,-1,^,%sl,=", + r_strbuf_setf (&op->esil, "%sh,-1,^,%sh,=,%sl,-1,^,%sl,=", REG64 (1), REG64 (0), REG64 (1), REG64 (0)); } else { ARG64_APPEND (&op->esil, 1); diff --git a/libr/anal/p/anal_arm_regprofile.inc b/libr/anal/p/anal_arm_regprofile.inc index 4a63c6c452..0ce00b9c58 100644 --- a/libr/anal/p/anal_arm_regprofile.inc +++ b/libr/anal/p/anal_arm_regprofile.inc @@ -322,7 +322,7 @@ static char *get_reg_profile(RAnal *anal) { "fpu v30h .64 776 0\n" "fpu v31h .64 792 0\n" - // this sucks but q* is a valid alias + // this sucks but q* is a valid alias // for the vector registers in arm64 /* 128 bit vector */ diff --git a/libr/anal/p/anal_arm_v35.c b/libr/anal/p/anal_arm_v35.c index 0aa25f10b5..126fbcc915 100644 --- a/libr/anal/p/anal_arm_v35.c +++ b/libr/anal/p/anal_arm_v35.c @@ -501,13 +501,13 @@ static ut64 shifted_imm64(Instruction *insn, int n, int sz) { InstructionOperand op = INSOP64 (n); int sft = op.shiftValue; switch (op.shiftType) { - case ShiftType_MSL: + case ShiftType_MSL: return (GETIMM64 (n) << sft) | ((1 << sft) - 1); case ShiftType_LSL: return GETIMM64 (n) << sft; case ShiftType_LSR: return GETIMM64 (n) >> sft; - case ShiftType_ROR: + case ShiftType_ROR: return (GETIMM64 (n) >> sft)|(GETIMM64 (n) << (sz - sft)); case ShiftType_ASR: switch (sz) { @@ -554,10 +554,10 @@ static void vector64_append(RStrBuf *sb, Instruction *insn, int n, int i) { size_t s = sizeof (bitmask_by_width) / sizeof (*bitmask_by_width); int width = size > 0? (size - 1) % s: 0; if (shift > 0) { - r_strbuf_appendf (sb, "0x%"PFMT64x",%d,%s%s,>>,&", + r_strbuf_appendf (sb, "0x%"PFMT64x",%d,%s%s,>>,&", bitmask_by_width[width], shift, REG64 (n), regc); } else { - r_strbuf_appendf (sb, "0x%"PFMT64x",%s%s,&", + r_strbuf_appendf (sb, "0x%"PFMT64x",%s%s,&", bitmask_by_width[width], REG64 (n), regc); } } else { @@ -590,10 +590,10 @@ static void vector64_dst_append(RStrBuf *sb, Instruction *insn, int n, int i) { } if (shift > 0 && shift < 64) { - r_strbuf_appendf (sb, "%d,SWAP,0x%"PFMT64x",&,<<,%s%s,0x%"PFMT64x",&,|,%s%s", + r_strbuf_appendf (sb, "%d,SWAP,0x%"PFMT64x",&,<<,%s%s,0x%"PFMT64x",&,|,%s%s", shift, mask, REG64 (n), regc, VEC64_MASK (shift, size), REG64 (n), regc); } else { - r_strbuf_appendf (sb, "0x%"PFMT64x",&,%s%s,0x%"PFMT64x",&,|,%s%s", + r_strbuf_appendf (sb, "0x%"PFMT64x",&,%s%s,0x%"PFMT64x",&,|,%s%s", mask, REG64 (n), regc, VEC64_MASK (shift, size), REG64 (n), regc); } } else { @@ -692,7 +692,7 @@ static void arm64fpmath(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int le InstructionOperand dst = INSOP64 (0); int start = -1; - int end = 0; + int end = 0; int convert = size == 64 ? 0 : 1; int count = vas_count(dst.arrSpec); if (count) { @@ -1064,7 +1064,7 @@ static void anop64(RAnal *a, RAnalOp *op, Instruction *insn) { op->stackop = R_ANAL_STACK_INC; op->stackptr = -GETIMM64 (2); } - if (0) { // REGID64(0) == REG_PC) { v35 has no REG_PC? + if (0) { // REGID64(0) == REG_PC) { v35 has no REG_PC? op->type = R_ANAL_OP_TYPE_UJMP; /*if (insn->detail->arm.cc != ARM_CC_AL) { //op->type = R_ANAL_OP_TYPE_MCJMP; @@ -1302,8 +1302,8 @@ static int analop_esil(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int len break; case ARM64_SUBS: OPCALL("-"); - r_strbuf_appendf (&op->esil, - ",$z,zf,:=,%d,$s,nf,:=,%d,$b,!,cf,:=,%d,$o,vf,:=", + r_strbuf_appendf (&op->esil, + ",$z,zf,:=,%d,$s,nf,:=,%d,$b,!,cf,:=,%d,$o,vf,:=", REGBITS64 (0) - 1, REGBITS64 (0), REGBITS64 (0) -1); break; @@ -1414,7 +1414,7 @@ static int analop_esil(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int len case ARM64_FMOV: { if (0) { - r_strbuf_setf (&op->esil, "%sh,%sh,=,%sl,%sl,=", + r_strbuf_setf (&op->esil, "%sh,%sh,=,%sl,%sl,=", REG64 (1), REG64 (0), REG64 (1), REG64 (0)); } else { ARG64_APPEND (&op->esil, 1); @@ -1429,7 +1429,7 @@ static int analop_esil(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int len case ARM64_FCCMP: case ARM64_FCCMPE: if (ISREG64 (1)) { - r_strbuf_setf (&op->esil, + r_strbuf_setf (&op->esil, "%d,%s,F2D,NAN,%d,%s,F2D,NAN,|,vf,:=" ",%d,%s,F2D,%d,%s,F2D,F==,vf,|,zf,:=" ",%d,%s,F2D,%d,%s,F2D,F<,vf,|,nf,:=", @@ -1438,7 +1438,7 @@ static int analop_esil(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int len REGBITS64 (1), REG64 (1), REGBITS64 (1), REG64 (0) ); } else { - r_strbuf_setf (&op->esil, + r_strbuf_setf (&op->esil, "%d,%s,F2D,NAN,vf,:=" ",0,I2D,%d,%s,F2D,F==,vf,|,zf,:=" ",0,I2D,%d,%s,F2D,F<,vf,|,nf,:=", @@ -1456,7 +1456,7 @@ static int analop_esil(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int len } break; case ARM64_FCVT: - r_strbuf_setf (&op->esil, "%d,%d,%s,F2D,D2F,%s,=", + r_strbuf_setf (&op->esil, "%d,%d,%s,F2D,D2F,%s,=", REGBITS64 (0), REGBITS64 (1), REG64 (1), REG64 (0)); break; case ARM64_SCVTF: @@ -1521,23 +1521,23 @@ static int analop_esil(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int len REGBITS64 (1), REG64 (1), REG64 (0)); break; case ARM64_FNEG: - r_strbuf_setf (&op->esil, "%d,DUP,%s,F2D,-F,D2F,%s,=", + r_strbuf_setf (&op->esil, "%d,DUP,%s,F2D,-F,D2F,%s,=", REGBITS64 (1), REG64 (1), REG64 (0)); break; case ARM64_FSQRT: - r_strbuf_setf (&op->esil, "%d,DUP,%s,F2D,SQRT,D2F,%s,=", + r_strbuf_setf (&op->esil, "%d,DUP,%s,F2D,SQRT,D2F,%s,=", REGBITS64 (1), REG64 (1), REG64 (0)); break; case ARM64_FMINNM: case ARM64_FMIN: - r_strbuf_setf (&op->esil, "%d,%s,F2D,%d,%s,F2D,F<,?{,%s,}{,%s,},%s,=", - REGBITS64 (2), REG64 (2), + r_strbuf_setf (&op->esil, "%d,%s,F2D,%d,%s,F2D,F<,?{,%s,}{,%s,},%s,=", + REGBITS64 (2), REG64 (2), REGBITS64 (1), REG64 (1), REG64 (1), REG64 (2), REG64 (0)); break; case ARM64_FMAXNM: case ARM64_FMAX: - r_strbuf_setf (&op->esil, "%d,%s,F2D,%d,%s,F2D,F<,!,?{,%s,}{,%s,},%s,=", - REGBITS64 (2), REG64 (2), + r_strbuf_setf (&op->esil, "%d,%s,F2D,%d,%s,F2D,F<,!,?{,%s,}{,%s,},%s,=", + REGBITS64 (2), REG64 (2), REGBITS64 (1), REG64 (1), REG64 (1), REG64 (2), REG64 (0)); break; case ARM64_FADD: @@ -1553,26 +1553,26 @@ static int analop_esil(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int len FPOPCALL_NEGATE("*"); break; case ARM64_FMADD: - r_strbuf_setf (&op->esil, "%d,DUP,%s,F2D,%d,%s,F2D,F*,%d,%s,F2D,F+,D2F,%s,=", - REGBITS64 (1), REG64 (1), - REGBITS64 (2), REG64 (2), + r_strbuf_setf (&op->esil, "%d,DUP,%s,F2D,%d,%s,F2D,F*,%d,%s,F2D,F+,D2F,%s,=", + REGBITS64 (1), REG64 (1), + REGBITS64 (2), REG64 (2), REGBITS64 (3), REG64 (3), REG64 (0)); break; case ARM64_FNMADD: - r_strbuf_setf (&op->esil, "%d,DUP,%s,F2D,%d,%s,F2D,F*,-F,%d,%s,F2D,F+,-F,D2F,%s,=", - REGBITS64 (1), REG64 (1), - REGBITS64 (2), REG64 (2), + r_strbuf_setf (&op->esil, "%d,DUP,%s,F2D,%d,%s,F2D,F*,-F,%d,%s,F2D,F+,-F,D2F,%s,=", + REGBITS64 (1), REG64 (1), + REGBITS64 (2), REG64 (2), REGBITS64 (3), REG64 (3), REG64 (0)); break; case ARM64_FMSUB: - r_strbuf_setf (&op->esil, "%d,DUP,%s,F2D,%d,%s,F2D,F*,%d,%s,F2D,F-,D2F,%s,=", - REGBITS64 (1), REG64 (1), - REGBITS64 (2), REG64 (2), + r_strbuf_setf (&op->esil, "%d,DUP,%s,F2D,%d,%s,F2D,F*,%d,%s,F2D,F-,D2F,%s,=", + REGBITS64 (1), REG64 (1), + REGBITS64 (2), REG64 (2), REGBITS64 (3), REG64 (3), REG64 (0)); break; case ARM64_FNMSUB: - r_strbuf_setf (&op->esil, "%d,DUP,%s,F2D,%d,%s,F2D,F*,-F,%d,%s,F2D,F-,-F,D2F,%s,=", - REGBITS64 (1), REG64 (1), + r_strbuf_setf (&op->esil, "%d,DUP,%s,F2D,%d,%s,F2D,F*,-F,%d,%s,F2D,F-,-F,D2F,%s,=", + REGBITS64 (1), REG64 (1), REGBITS64 (2), REG64 (2), REGBITS64 (3), REG64 (3), REG64 (0)); break; @@ -1775,7 +1775,7 @@ static int analop_esil(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int len if (ISMEM64 (1)) { if (HASMEMINDEX64 (1)) { ARG64_APPEND (&op->esil, 1); - r_strbuf_appendf (&op->esil, ",%s,+,[%d],%s,=", + r_strbuf_appendf (&op->esil, ",%s,+,[%d],%s,=", MEMBASE64 (1), size, REG64 (0)); } else { if (LSHIFT2_64 (1)) { @@ -1935,7 +1935,7 @@ static int analop_esil(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int len ARG64_APPEND(&op->esil, 1); COMMA(&op->esil); ARG64_APPEND(&op->esil, 0); - r_strbuf_appendf (&op->esil, ",==,$z,zf,:=,%d,$s,nf,:=,%d,$b,!,cf,:=,%d,$o,vf,:=", + r_strbuf_appendf (&op->esil, ",==,$z,zf,:=,%d,$s,nf,:=,%d,$b,!,cf,:=,%d,$o,vf,:=", REGBITS64 (0) - 1, REGBITS64 (0), REGBITS64 (0) -1); if (insn->operation == ARM64_CCMP || insn->operation == ARM64_CCMN) { @@ -1980,7 +1980,7 @@ static int analop_esil(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int len r_strbuf_appendf (&op->esil, "%s,}{,1,%s,+,},%s,=", REG64 (1), REG64 (2), REG64 (0)); postfix = ""; break; - case ARM64_CINV: + case ARM64_CINV: if ISCOND64(1) { v35arm_prefix_cond (op, insn->operands[1].cond); } @@ -1994,7 +1994,7 @@ static int analop_esil(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int len r_strbuf_appendf (&op->esil, "%s,}{,-1,%s,^,},%s,=", REG64 (1), REG64 (2), REG64 (0)); postfix = ""; break; - case ARM64_CNEG: + case ARM64_CNEG: if ISCOND64(1) { v35arm_prefix_cond (op, insn->operands[1].cond); } @@ -2027,13 +2027,13 @@ static int analop_esil(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int len { int size = REGSIZE64 (0); switch (insn->operation) { - case ARM64_STRB: + case ARM64_STRB: case ARM64_STURB: case ARM64_STTRB: { size = 1; break; - } + } case ARM64_STRH: case ARM64_STURH: case ARM64_STTRH: @@ -2246,14 +2246,14 @@ static int analop_esil(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int len break; case ARM64_RBIT: // slightly shorter expression to reverse bits - r_strbuf_setf (&op->esil, "0,tmp,=,0,DUP,DUP,DUP,%d,-,%s,>>,1,&,<<,tmp,+=,%d,-,?{,++,4,GOTO,},tmp,%s,=", + r_strbuf_setf (&op->esil, "0,tmp,=,0,DUP,DUP,DUP,%d,-,%s,>>,1,&,<<,tmp,+=,%d,-,?{,++,4,GOTO,},tmp,%s,=", REGBITS64 (1)-1, REG64 (1), REGBITS64 (1)-1, REG64 (0)); break; case ARM64_MVN: case ARM64_MOVN: { if (0) { - r_strbuf_setf (&op->esil, "%sh,-1,^,%sh,=,%sl,-1,^,%sl,=", + r_strbuf_setf (&op->esil, "%sh,-1,^,%sh,=,%sl,-1,^,%sl,=", REG64 (1), REG64 (0), REG64 (1), REG64 (0)); } else { ARG64_APPEND (&op->esil, 1); @@ -2418,7 +2418,7 @@ static int analop_esil(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int len case ARM64_SVC: r_strbuf_setf (&op->esil, "%" PFMT64u ",$", GETIMM64 (0)); break; - default: + default: break; } diff --git a/libr/anal/p/anal_dalvik.c b/libr/anal/p/anal_dalvik.c index cf590e2eac..f1f3c6b66b 100644 --- a/libr/anal/p/anal_dalvik.c +++ b/libr/anal/p/anal_dalvik.c @@ -235,7 +235,7 @@ static void format51l(int len, const unsigned char* data, ut32* dst, st64* src) #define OPCALL(x, y, z) dalvik_math_op(op, data, len, mask, x, y, z) -static void dalvik_math_op(RAnalOp* op, const unsigned char* data, int len, +static void dalvik_math_op(RAnalOp* op, const unsigned char* data, int len, RAnalOpMask mask, char* operation, unsigned int optype, OperandType ot) { ut32 vA = 0, vB = 0, vC = 0; @@ -275,7 +275,7 @@ static void dalvik_math_op(RAnalOp* op, const unsigned char* data, int len, } else if (ot == OP_FLOAT) { esilprintf (op, "32,32,v%u,F2D,32,v%u,F2D,F%s,D2F,v%u,=", vC, vB, operation, vA); } else if (ot == OP_DOUBLE) { - esilprintf (op, GETWIDE "," GETWIDE ",F%s," SETWIDE, + esilprintf (op, GETWIDE "," GETWIDE ",F%s," SETWIDE, vC+1, vC, vB+1, vB, operation, vA, vA+1); } } @@ -302,7 +302,7 @@ static int dalvik_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *data, int l vC = data[3]; } switch (data[0]) { - case 0x00: + case 0x00: op->type = R_ANAL_OP_TYPE_NOP; if (mask & R_ANAL_OP_MASK_ESIL) { esilprintf (op, ","); @@ -784,8 +784,8 @@ static int dalvik_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *data, int l case 0xeb: // sput-wide-volatile case 0xf5: // iput-quick case 0xf6: - case 0xfc: - case 0xfe: + case 0xfc: + case 0xfe: op->type = R_ANAL_OP_TYPE_STORE; vC = len > 3?(data[3] << 8) | data[2] : 0; op->ptr = anal->binb.get_offset (anal->binb.bin, 'f', vC); @@ -858,7 +858,7 @@ static int dalvik_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *data, int l op->type = R_ANAL_OP_TYPE_CAST; format12x(len, data, &vA, &vB); - // do all the casting here + // do all the casting here if (mask & R_ANAL_OP_MASK_ESIL) { // op->refptr = 0; // many of these might need sign extensions @@ -878,7 +878,7 @@ static int dalvik_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *data, int l case 0x85: esilprintf (op, "32," GETWIDE ",I2D,D2F,v%u,=", vB+1, vB, vA); break; - case 0x86: + case 0x86: esilprintf (op, GETWIDE ",I2D," SETWIDE, vB+1, vB, vA, vA+1); break; case 0x87: @@ -906,7 +906,7 @@ static int dalvik_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *data, int l case 0x8f: esilprintf (op, "v%u,0xffff,&,v%u,=", vB, vA); break; - default: + default: break; } } diff --git a/libr/anal/p/anal_gb.c b/libr/anal/p/anal_gb.c index fa9ede51cc..f8cbde481a 100644 --- a/libr/anal/p/anal_gb.c +++ b/libr/anal/p/anal_gb.c @@ -717,7 +717,7 @@ static int gb_anop(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *data, int len op->type = R_ANAL_OP_TYPE_ILL; op->size = 0; return 0; - } + } if (mask & R_ANAL_OP_MASK_DISASM) { char mn[32]; memset (mn, '\0', sizeof (char) * sizeof (mn)); diff --git a/libr/anal/p/anal_mips_cs.c b/libr/anal/p/anal_mips_cs.c index e170eb4d2e..98b4a6bcb1 100644 --- a/libr/anal/p/anal_mips_cs.c +++ b/libr/anal/p/anal_mips_cs.c @@ -790,7 +790,7 @@ static int analop(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *buf, int len, case MIPS_INS_LBU: case MIPS_INS_LBUX: op->refptr = 1; - /* fallthrough */ + /* fallthrough */ case MIPS_INS_LW: case MIPS_INS_LWC1: case MIPS_INS_LWC2: @@ -800,7 +800,7 @@ static int analop(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *buf, int len, if (!op->refptr) { op->refptr = 4; } - /* fallthrough */ + /* fallthrough */ case MIPS_INS_LD: case MIPS_INS_LDC1: case MIPS_INS_LDC2: @@ -860,7 +860,7 @@ static int analop(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *buf, int len, op->jump = t9_pre; t9_pre = UT64_MAX; op->type = R_ANAL_OP_TYPE_RCALL; - } + } break; case MIPS_INS_JAL: case MIPS_INS_JALS: @@ -918,7 +918,7 @@ static int analop(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *buf, int len, op->type = R_ANAL_OP_TYPE_ADD; if (REGID(0) == MIPS_REG_T9) { t9_pre += IMM(2); - } + } if (REGID(0) == MIPS_REG_SP) { op->stackop = R_ANAL_STACK_INC; op->stackptr = -IMM(2); diff --git a/libr/anal/p/anal_mips_gnu.c b/libr/anal/p/anal_mips_gnu.c index dcfa0bb478..922bf128b8 100644 --- a/libr/anal/p/anal_mips_gnu.c +++ b/libr/anal/p/anal_mips_gnu.c @@ -829,7 +829,7 @@ static int analop_esil(RAnal *a, RAnalOp *op, ut64 addr, gnu_insn*insn) { break; case MIPS_INS_J: r_strbuf_appendf (&op->esil, ES_TRAP_DS () "" ES_J ("%s"), J_REG (jump)); - case MIPS_INS_B: + case MIPS_INS_B: // jump to address with conditional r_strbuf_appendf (&op->esil, ES_TRAP_DS () "" ES_J ("%s"), I_REG (jump)); break; @@ -872,7 +872,7 @@ static int analop_esil(RAnal *a, RAnalOp *op, ut64 addr, gnu_insn*insn) { I_REG (rs), I_REG (jump)); break; case MIPS_INS_BLTZAL: - r_strbuf_appendf (&op->esil, ES_TRAP_DS () "1," ES_IS_NEGATIVE ("%s") ",==,$z,?{," ES_CALL_D ("%s") ",}", + r_strbuf_appendf (&op->esil, ES_TRAP_DS () "1," ES_IS_NEGATIVE ("%s") ",==,$z,?{," ES_CALL_D ("%s") ",}", I_REG (rs), I_REG (jump)); break; case MIPS_INS_BLTZ: @@ -917,7 +917,7 @@ static int analop_esil(RAnal *a, RAnalOp *op, ut64 addr, gnu_insn*insn) { case MIPS_INS_NEGU: break; /** signed -- sets overflow flag */ - case MIPS_INS_ADD: + case MIPS_INS_ADD: ES_ADD_CK32_OVERF(R_REG (rs), R_REG (rt), R_REG (rd)); break; case MIPS_INS_ADDI: @@ -947,7 +947,7 @@ static int analop_esil(RAnal *a, RAnalOp *op, ut64 addr, gnu_insn*insn) { case MIPS_INS_LUI: r_strbuf_appendf (&op->esil, "%s0000,%s,=",I_REG (imm), I_REG (rt)); break; - case MIPS_INS_LB: + case MIPS_INS_LB: op->sign = true; //To load a byte from memory as a signed value /* fallthrough */ case MIPS_INS_LBU: @@ -1372,7 +1372,7 @@ static int mips_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *b, int len, R snprintf ((char *)insn.i_reg.imm, REG_BUF_MAX, "%"PFMT32d, imm); switch (optype) { - case 1: + case 1: switch (rt) { case 0: //bltz insn.id = MIPS_INS_BLTZ; diff --git a/libr/anal/p/anal_riscv.c b/libr/anal/p/anal_riscv.c index ef424f9085..6a294328a0 100644 --- a/libr/anal/p/anal_riscv.c +++ b/libr/anal/p/anal_riscv.c @@ -445,7 +445,7 @@ static int riscv_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *data, int le } else if (!strncmp (name, "csrrc", 5)) { // Ands the inverse of rs1 with CSR, places old value in rd esilprintf (op, "%s,0,+,%s,1,+,0,-,%s,&=,%s,=", ARG (1), ARG (1), ARG (2), ARG (0)); - } + } // stores else if (!strcmp (name, "sd") || !strcmp (name, "sdsp")) { esilprintf (op, "%s,%s,%s,+,=[8]", ARG (0), ARG (2), ARG (1)); diff --git a/libr/anal/p/anal_vax.c b/libr/anal/p/anal_vax.c index 3e6e47d941..568dc05720 100644 --- a/libr/anal/p/anal_vax.c +++ b/libr/anal/p/anal_vax.c @@ -72,7 +72,7 @@ static int vax_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *buf, int len, op->size = 7; op->type = R_ANAL_OP_TYPE_MOV; break; - case 0xd4: // + case 0xd4: // op->size = 3; op->type = R_ANAL_OP_TYPE_NOP; break; diff --git a/libr/anal/p/anal_x86_cs.c b/libr/anal/p/anal_x86_cs.c index 32064de04d..9b8ae3c39e 100644 --- a/libr/anal/p/anal_x86_cs.c +++ b/libr/anal/p/anal_x86_cs.c @@ -1673,12 +1673,12 @@ static void anop_esil(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int len, op->sign = true; if (!arg2 && !arg1) { // TODO: IDIV rbx not implemented. this is just a workaround - // + // // http://www.tptp.cc/mirrors/siyobik.info/instruction/IDIV.html // Divides (signed) the value in the AX, DX:AX, or EDX:EAX registers (dividend) by the source operand (divisor) and stores the result in the AX (AH:AL), DX:AX, or EDX:EAX registers. The source operand can be a general-purpose register or a memory location. The action of this instruction depends on the operand size (dividend/divisor), as shown in the following table: // IDIV RBX == RDX:RAX /= RBX - // + // if (arg0) { int width = INSOP(0).size; const char *r_quot = (width==1)?"al": (width==2)?"ax": (width==4)?"eax":"rax"; @@ -1725,7 +1725,7 @@ static void anop_esil(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int len, if (arg2) { multiplier = arg2; } - esilprintf (op, "%d,%s,~,%d,%s,~,*,DUP,%s,=,%d,%s,~,-,!,!,DUP,cf,:=,of,:=", + esilprintf (op, "%d,%s,~,%d,%s,~,*,DUP,%s,=,%d,%s,~,-,!,!,DUP,cf,:=,of,:=", width*8, multiplier, width*8, arg1, arg0, width*8, arg0); } else { if (arg0) { @@ -1733,12 +1733,12 @@ static void anop_esil(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int len, const char *r_rema = (width==1)?"ah": (width==2)?"dx": (width==4)?"edx":"rdx"; const char *r_nume = (width==1)?"ax": r_quot; - if (width == 8) { // TODO still needs to be fixed to handle correct signed 128 bit value + if (width == 8) { // TODO still needs to be fixed to handle correct signed 128 bit value esilprintf (op, "%s,%s,L*,%s,=,DUP,%s,=,!,!,DUP,cf,:=,of,:=", // flags will be sometimes wrong arg0, r_nume, r_nume, r_rema); } else { esilprintf (op, "%d,%s,~,%d,%s,~,*,DUP,DUP,%s,=,%d,SWAP,>>,%s,=,%d,%s,~,-,!,!,DUP,cf,:=,of,:=", - width*8, arg0, width*8, r_nume, r_nume, width*8, r_rema, width*8, r_nume); + width*8, arg0, width*8, r_nume, r_nume, width*8, r_rema, width*8, r_nume); } } } diff --git a/libr/anal/p/arm_v35.mk b/libr/anal/p/arm_v35.mk index 4ad10d95c6..0547a83f01 100644 --- a/libr/anal/p/arm_v35.mk +++ b/libr/anal/p/arm_v35.mk @@ -16,7 +16,7 @@ TARGET_ARM_V35=$(N).${LIBEXT} ALL_TARGETS+=$(TARGET_ARM_V35) -$(TARGET_ARM_V35): +$(TARGET_ARM_V35): # $(STATIC_OBJ) ${CC} $(V35ARM64_CFLAGS) ${CFLAGS} $(call libname,$(N)) \ -lr_util -lr_search \ diff --git a/libr/anal/type_pdb.c b/libr/anal/type_pdb.c index b0ccff4895..441b59b221 100644 --- a/libr/anal/type_pdb.c +++ b/libr/anal/type_pdb.c @@ -13,8 +13,8 @@ static bool is_parsable_type(const ELeafType type) { /** * @brief Create a type name from offset - * - * @param offset + * + * @param offset * @return char* Name or NULL if error */ static char *create_type_name_from_offset(ut64 offset) { @@ -26,7 +26,7 @@ static char *create_type_name_from_offset(ut64 offset) { /** * @brief Parses class/struct/union member - * + * * @param type_info Current type info (member) * @param types List of all types * @return RAnalStructMember* parsed member, NULL if fail @@ -60,10 +60,10 @@ cleanup: /** * @brief Parse enum case - * + * * @param type_info Current type info (enum case) * @param types List of all types - * @return RAnalEnumCase* parsed enum case, NULL if fail + * @return RAnalEnumCase* parsed enum case, NULL if fail */ static RAnalEnumCase *parse_enumerate(STypeInfo *type_info, RList *types) { r_return_val_if_fail (type_info && types && type_info->leaf_type == eLF_ENUMERATE, NULL); @@ -88,10 +88,10 @@ cleanup: /** * @brief Parses enum into BaseType and saves it into SDB - * - * @param anal + * + * @param anal * @param type Current type - * @param types List of all types + * @param types List of all types */ static void parse_enum(const RAnal *anal, SType *type, RList *types) { r_return_if_fail (anal && type && types); @@ -152,8 +152,8 @@ cleanup: /** * @brief Parses classes, unions and structures into BaseType and saves them into SDB - * - * @param anal + * + * @param anal * @param type Current type * @param types List of all types */ @@ -215,8 +215,8 @@ cleanup: /** * @brief Delegate the type parsing to appropriate function - * - * @param anal + * + * @param anal * @param type Current type * @param types List of all types */ @@ -249,7 +249,7 @@ static void parse_type (const RAnal *anal, SType *type, RList *types) { /** * @brief Saves PDB types from TPI stream into the SDB - * + * * @param anal * @param pdb PDB information */ diff --git a/libr/anal/var.c b/libr/anal/var.c index e87739c5d5..ba7be01748 100644 --- a/libr/anal/var.c +++ b/libr/anal/var.c @@ -1147,7 +1147,7 @@ R_API void r_anal_extract_rarg(RAnal *anal, RAnalOp *op, RAnalFunction *fcn, int if (callee) { callee_rargs = R_MIN (max_count, r_type_func_args_count (TDB, callee)); } - callee_rargs = callee_rargs + callee_rargs = callee_rargs ? callee_rargs : r_anal_var_count (anal, f, R_ANAL_VAR_KIND_REG, 1); callee_rargs_l = r_anal_var_list (anal, f, R_ANAL_VAR_KIND_REG); diff --git a/libr/asm/arch/arc/gnu/arc-ext.h b/libr/asm/arch/arc/gnu/arc-ext.h index c79ca3dda4..150ed9d413 100644 --- a/libr/asm/arch/arc/gnu/arc-ext.h +++ b/libr/asm/arch/arc/gnu/arc-ext.h @@ -4,7 +4,7 @@ Copyright 2008-2012 Synopsys Inc. This file is part of libopcodes. - + This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) diff --git a/libr/asm/arch/arc/gnu/arc-opc.c b/libr/asm/arch/arc/gnu/arc-opc.c index d017a21289..5ee27b84a8 100644 --- a/libr/asm/arch/arc/gnu/arc-opc.c +++ b/libr/asm/arch/arc/gnu/arc-opc.c @@ -4444,7 +4444,7 @@ arc_opcode_lookup_dis (unsigned int insn) } /* START ARC LOCAL */ -int +int arc_test_wb (void) { return addrwb_p; diff --git a/libr/asm/arch/arc/gnu/arc.h b/libr/asm/arch/arc/gnu/arc.h index c9b1c98b3a..19d8d2369b 100644 --- a/libr/asm/arch/arc/gnu/arc.h +++ b/libr/asm/arch/arc/gnu/arc.h @@ -356,7 +356,7 @@ struct arc_operand { string (the operand will be inserted in any case). If the operand value is legal, *ERRMSG will be unchanged. - REG is non-NULL when inserting a register value. + REG is non-NULL when inserting a register value. extend is only meaningful for extended length instructions and the special fields that use them. */ diff --git a/libr/asm/arch/arm/aarch64/aarch64-tbl.h b/libr/asm/arch/arm/aarch64/aarch64-tbl.h index 173b59453a..d60f807f40 100644 --- a/libr/asm/arch/arm/aarch64/aarch64-tbl.h +++ b/libr/asm/arch/arm/aarch64/aarch64-tbl.h @@ -3965,7 +3965,7 @@ struct aarch64_opcode aarch64_opcode_table[] = _SVE_INSN ("ldff1sw", 0xc540a000, 0xffe0e000, sve_misc, 0, OP3 (SVE_ZtxN, SVE_Pg3, SVE_ADDR_RZ), OP_SVE_DZD, F_OD(1), 0), _SVE_INSN ("ldff1sw", 0xc560a000, 0xffe0e000, sve_misc, 0, OP3 (SVE_ZtxN, SVE_Pg3, SVE_ADDR_RZ_LSL2), OP_SVE_DZD, F_OD(1), 0), _SVE_INSN ("ldff1sw", 0xc520a000, 0xffe0e000, sve_misc, 0, OP3 (SVE_ZtxN, SVE_Pg3, SVE_ADDR_ZI_U5x4), OP_SVE_DZD, F_OD(1), 0), - + _SVE_INSN ("ldff1w", 0x85006000, 0xffa0e000, sve_misc, 0, OP3 (SVE_ZtxN, SVE_Pg3, SVE_ADDR_RZ_XTW_22), OP_SVE_SZS, F_OD(1), 0), _SVE_INSN ("ldff1w", 0x85206000, 0xffa0e000, sve_misc, 0, OP3 (SVE_ZtxN, SVE_Pg3, SVE_ADDR_RZ_XTW2_22), OP_SVE_SZS, F_OD(1), 0), _SVE_INSN ("ldff1w", 0xa5406000, 0xffe0e000, sve_misc, 0, OP3 (SVE_ZtxN, SVE_Pg3, SVE_ADDR_RR_LSL2), OP_SVE_SZU, F_OD(1), 0), diff --git a/libr/asm/arch/arm/armass.c b/libr/asm/arch/arm/armass.c index 6767724816..54a1aae961 100644 --- a/libr/asm/arch/arm/armass.c +++ b/libr/asm/arch/arm/armass.c @@ -1698,7 +1698,7 @@ static int thumb_assemble(ArmOpcode *ao, ut64 off, const char *str) { default: return -1; } - } else + } else if (( m = opmask (ao->op, "blx", 0) )) { ut64 argt = thumb_selector (ao->a); switch (argt) { @@ -2596,10 +2596,10 @@ static int thumb_assemble(ArmOpcode *ao, ut64 off, const char *str) { } if (ldrsel == 0) { ao->o = 0x50f80009; - } else + } else if (ldrsel == B_BIT) { ao->o = 0x10f80009; - } else + } else if (ldrsel == H_BIT) { ao->o = 0x30f80009; } else { @@ -2626,10 +2626,10 @@ static int thumb_assemble(ArmOpcode *ao, ut64 off, const char *str) { } if (ldrsel == 0) { ao->o = 0x50f8000d; - } else + } else if (ldrsel == B_BIT) { ao->o = 0x10f8000d; - } else + } else if (ldrsel == H_BIT) { ao->o = 0x30f8000d; } else { @@ -3102,7 +3102,7 @@ static int thumb_assemble(ArmOpcode *ao, ut64 off, const char *str) { default: return -1; } - } else + } else if ((m = opmask (ao->op, "mrc", TWO_BIT))) { ut64 argt = thumb_selector (ao->a); switch (argt) { @@ -3198,7 +3198,7 @@ static int thumb_assemble(ArmOpcode *ao, ut64 off, const char *str) { default: return -1; } - } else + } else if ((m = opmask (ao->op, "msr", 0))) { ut64 argt = thumb_selector (ao->a); switch (argt) { @@ -3360,7 +3360,7 @@ static int thumb_assemble(ArmOpcode *ao, ut64 off, const char *str) { default: return -1; } - } else + } else if ((m = opmask (ao->op, "orr", S_BIT))) { ut64 argt = thumb_selector (ao->a); switch (argt) { @@ -3407,7 +3407,7 @@ static int thumb_assemble(ArmOpcode *ao, ut64 off, const char *str) { default: return -1; } - } else + } else if ((m = opmask (ao->op, "pkh", BT_BIT | TB_BIT))) { ut64 argt = thumb_selector (ao->a); switch (argt) { @@ -4844,10 +4844,10 @@ static int thumb_assemble(ArmOpcode *ao, ut64 off, const char *str) { if (strsel == 0) { ao->o = 0x40f80009; - } else + } else if (strsel == B_BIT) { ao->o = 0x00f80009; - } else + } else if (strsel == H_BIT) { ao->o = 0x20f80009; } else { @@ -4874,10 +4874,10 @@ static int thumb_assemble(ArmOpcode *ao, ut64 off, const char *str) { if (strsel == 0) { ao->o = 0x40f8000d; - } else + } else if (strsel == B_BIT) { ao->o = 0x00f8000d; - } else + } else if (strsel == H_BIT) { ao->o = 0x20f8000d; } else { @@ -4931,10 +4931,10 @@ static int thumb_assemble(ArmOpcode *ao, ut64 off, const char *str) { if (strsel == 0) { ao->o = 0x40f80000; - } else + } else if (strsel == B_BIT) { ao->o = 0x00f80000; - } else + } else if (strsel == H_BIT) { ao->o = 0x20f80000; } else { @@ -5097,7 +5097,7 @@ static int thumb_assemble(ArmOpcode *ao, ut64 off, const char *str) { } break; } - } else + } else if ((m = opmask (ao->op, "sub", S_BIT | W_BIT))) { ut64 argt = thumb_selector (ao->a); switch (argt) { @@ -5539,7 +5539,7 @@ static int thumb_assemble(ArmOpcode *ao, ut64 off, const char *str) { case THUMB_REG_REG_REG: { if (sufsel == EIGHT_BIT) { ao->o = 0x80fa60f0; - } else + } else if (sufsel == SIXTEEN_BIT) { ao->o = 0x90fa60f0; } else { @@ -5599,7 +5599,7 @@ static int thumb_assemble(ArmOpcode *ao, ut64 off, const char *str) { case THUMB_REG_REG_REG: { if (sufsel == EIGHT_BIT) { ao->o = 0xc0fa60f0; - } else + } else if (sufsel == SIXTEEN_BIT) { ao->o = 0xd0fa60f0; } else { @@ -5699,7 +5699,7 @@ static int thumb_assemble(ArmOpcode *ao, ut64 off, const char *str) { case THUMB_REG_REG_REG: { if (sufsel == EIGHT_BIT) { ao->o = 0x80fa50f0; - } else + } else if (sufsel == SIXTEEN_BIT) { ao->o = 0x90fa50f0; } else { @@ -5758,7 +5758,7 @@ static int thumb_assemble(ArmOpcode *ao, ut64 off, const char *str) { case THUMB_REG_REG_REG: { if (sufsel == EIGHT_BIT) { ao->o = 0xc0fa50f0; - } else + } else if (sufsel == SIXTEEN_BIT) { ao->o = 0xd0fa50f0; } else { @@ -5889,7 +5889,7 @@ static int thumb_assemble(ArmOpcode *ao, ut64 off, const char *str) { case THUMB_REG_REG_REG: { if (sufsel == EIGHT_BIT) { ao->o = 0xc0fa40f0; - } else + } else if (sufsel == SIXTEEN_BIT) { ao->o = 0xd0fa40f0; } else { diff --git a/libr/asm/arch/arm/armass64.c b/libr/asm/arch/arm/armass64.c index cc98579950..a7ce6c9e88 100644 --- a/libr/asm/arch/arm/armass64.c +++ b/libr/asm/arch/arm/armass64.c @@ -349,7 +349,7 @@ static ut32 cmp(ArmOp *op) { } else if (op->operands[0].type & ARM_GPR && op->operands[1].type & ARM_CONSTANT) { if (op->operands[0].reg_type & ARM_REG64) { k = 0x1f0000f1; - } else { + } else { k = 0x1f000071; } k |= ( op->operands[1].immediate * 4 ) << 16 ; diff --git a/libr/asm/arch/arm/gnu/floatformat.c b/libr/asm/arch/arm/gnu/floatformat.c index d86364dac9..2f4bbf8d50 100644 --- a/libr/asm/arch/arm/gnu/floatformat.c +++ b/libr/asm/arch/arm/gnu/floatformat.c @@ -449,7 +449,7 @@ get_field (const unsigned char *data, enum floatformat_byteorders order, lo_bit = start % FLOATFORMAT_CHAR_BIT; hi_bit = min (lo_bit + len, FLOATFORMAT_CHAR_BIT); - + do { unsigned int shifted = *(data + cur_byte) >> lo_bit; @@ -466,7 +466,7 @@ get_field (const unsigned char *data, enum floatformat_byteorders order, return result; } - + /* Convert from FMT to a double. FROM is the address of the extended float. Store the double in *TO. */ @@ -591,7 +591,7 @@ put_field (unsigned char *data, enum floatformat_byteorders order, lo_bit = start % FLOATFORMAT_CHAR_BIT; hi_bit = min (lo_bit + len, FLOATFORMAT_CHAR_BIT); - + do { unsigned char *byte_ptr = data + cur_byte; diff --git a/libr/asm/arch/arm/winedbg/be_arm.c b/libr/asm/arch/arm/winedbg/be_arm.c index dca195172a..c890ea39e7 100644 --- a/libr/asm/arch/arm/winedbg/be_arm.c +++ b/libr/asm/arch/arm/winedbg/be_arm.c @@ -871,7 +871,7 @@ int arm_disasm_one_insn(struct winedbg_arm_insn *arminsn) { } else { t2_ptr->func(arminsn, inst); - } + } arminsn->str_hex = r_str_appendf (arminsn->str_hex, "%02x%02x%02x%02x", *((ut8*)(&inst)), *((ut8*)(&inst)+1), *((ut8*)(&inst)+2), *((ut8*)(&inst)+3)); return size; diff --git a/libr/asm/arch/avr/avr_disasm.c b/libr/asm/arch/avr/avr_disasm.c index 6f0c86ea5f..dcd57c30a6 100644 --- a/libr/asm/arch/avr/avr_disasm.c +++ b/libr/asm/arch/avr/avr_disasm.c @@ -16,7 +16,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * avr_disasm.c - AVR instruction disassembly into disassembledInstruction structure. * @@ -155,8 +155,8 @@ static int lookupInstruction(uint16_t opcode, int offset) { /* We want to mask out all of the operands. We don't count up to * instructionSet[insidx].numOperands because some instructions, * such as clr R16, are actually encoded with two operands (so as eor R16,R16), - * and we want to screen out both operands to get the most simplest form of - * the instruction. */ + * and we want to screen out both operands to get the most simplest form of + * the instruction. */ for (i = 0; i < AVR_MAX_NUM_OPERANDS; i++) { if (instructionSet[insidx].operandTypes[i] == OPERAND_REGISTER_GHOST) { /* Grab the first operand */ @@ -167,7 +167,7 @@ static int lookupInstruction(uint16_t opcode, int offset) { operandTemp) ghostRegisterConfirmed = 0; } - } + } opcodeSearch &= ~(instructionSet[insidx].operandMasks[i]); } /* If we encountered a ghost register and were unable confirm that @@ -176,11 +176,11 @@ static int lookupInstruction(uint16_t opcode, int offset) { if (ghostRegisterConfirmed == 0) continue; - if (opcodeSearch == instructionSet[insidx].opcodeMask) + if (opcodeSearch == instructionSet[insidx].opcodeMask) break; } /* It's impossible not to find an instruction, because the last instruction ".DW", - * specifies a word of data at the addresses, instead of an instruction. + * specifies a word of data at the addresses, instead of an instruction. * Its operand 2 mask, 0x0000, will set opcode search to 0x0000, and this will always * match with the opcodeMask of 0x0000. */ return insidx; @@ -211,7 +211,7 @@ static int disassembleOperands(disassembledInstruction *dInstruction) { * by two. */ /* Next, we check for the signed bit (MSB), which would indicate a * negative. If the number is signed, we would reverse the two's - * complement (invert bits, add 1, and then only use the 7 bits that + * complement (invert bits, add 1, and then only use the 7 bits that * matter), otherwise, the number represents a positive distance and * no bit manipulation is necessary. */ dInstruction->operands[i] <<= 1; @@ -238,7 +238,7 @@ static int disassembleOperands(disassembledInstruction *dInstruction) { * by two. */ /* Next, we check for the signed bit (MSB), which would indicate a * negative. If the number is signed, we would reverse the two's - * complement (invert bits, add 1, and then only use the 12 bits that + * complement (invert bits, add 1, and then only use the 12 bits that * matter), otherwise, the number represents a positive distance and * no bit manipulation is necessary. */ dInstruction->operands[i] <<= 1; diff --git a/libr/asm/arch/avr/avr_disasm.h b/libr/asm/arch/avr/avr_disasm.h index 67141c7504..bbcd9c79ec 100644 --- a/libr/asm/arch/avr/avr_disasm.h +++ b/libr/asm/arch/avr/avr_disasm.h @@ -16,9 +16,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * avr_disasm.h - Header file for AVR instruction disassembly into + * avr_disasm.h - Header file for AVR instruction disassembly into * disassembledInstruction structure. * */ @@ -52,7 +52,7 @@ typedef struct _assembledInstruction assembledInstruction; /* The disassembled/decoded instruction. */ struct _disassembledInstruction { uint32_t address; - /* A convenient pointer to the instructionSet, so we can refer + /* A convenient pointer to the instructionSet, so we can refer * the general details of the instruction stored in there. */ instructionInfo *instruction; /* Notice that operands can be signed! diff --git a/libr/asm/arch/avr/avr_instructionset.c b/libr/asm/arch/avr/avr_instructionset.c index 29b4f1bc3e..fe917a81f0 100644 --- a/libr/asm/arch/avr/avr_instructionset.c +++ b/libr/asm/arch/avr/avr_instructionset.c @@ -16,7 +16,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * avrinstructionset.c - AVR instruction set data structure stored in an * array of instruction info structures, as defined in avrdisasm.h. @@ -29,7 +29,7 @@ /* I decided to have the operand masks and types here in the * main instruction set data structure of the disassembler for clean * opcode recognition and operand extraction. It's much more straight - * forward to work with numbers (duh) then manipulating ugly operand + * forward to work with numbers (duh) then manipulating ugly operand * strings such as "000011rdddddrrrr" for the add instruction. */ /* This was my first disassembler, and my program ended evolving with this * data structure. Turns out it makes code quite clear, and it generalizes the @@ -37,9 +37,9 @@ * instead of hard coding the disassembly for different types of operands. */ /* But this disassembler model can be applied to virtually any 16-bit * or less opcode architecture, making it very flexible in nature--I don't - * have to rewrite all of the operand disassembly code for interpreting - * different r, d, K, k, s, etc. characters in the opcode, which all stand - * for a different operand type, because they are clearly written out + * have to rewrite all of the operand disassembly code for interpreting + * different r, d, K, k, s, etc. characters in the opcode, which all stand + * for a different operand type, because they are clearly written out * in the instruction set data structure. */ @@ -97,7 +97,7 @@ instructionInfo instructionSet[AVR_TOTAL_INSTRUCTIONS] = { {"brvs", 0xf003, 1, {0x03f8, 0x0000}, {OPERAND_BRANCH_ADDRESS, OPERAND_NONE}}, {"bset", 0x9408, 1, {0x0070, 0x0000}, {OPERAND_BIT, OPERAND_NONE}}, {"call", 0x940e, 1, {0x01f1, 0x0000}, {OPERAND_LONG_ABSOLUTE_ADDRESS, OPERAND_NONE}}, - {"clr", 0x2400, 1, {0x01f0, 0x020f}, {OPERAND_REGISTER, OPERAND_REGISTER_GHOST}}, + {"clr", 0x2400, 1, {0x01f0, 0x020f}, {OPERAND_REGISTER, OPERAND_REGISTER_GHOST}}, {"com", 0x9400, 1, {0x01f0, 0x0000}, {OPERAND_REGISTER, OPERAND_NONE}}, {"dec", 0x940a, 1, {0x01f0, 0x0000}, {OPERAND_REGISTER, OPERAND_NONE}}, {"inc", 0x9403, 1, {0x01f0, 0x0000}, {OPERAND_REGISTER, OPERAND_NONE}}, diff --git a/libr/asm/arch/avr/errorcodes.h b/libr/asm/arch/avr/errorcodes.h index f82900bd7e..f641a10674 100644 --- a/libr/asm/arch/avr/errorcodes.h +++ b/libr/asm/arch/avr/errorcodes.h @@ -16,7 +16,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * errorcodesdisasm.h - All error codes that can take place during disassembler * operation. diff --git a/libr/asm/arch/avr/format.c b/libr/asm/arch/avr/format.c index 44ce7cc8b8..da306b7d16 100644 --- a/libr/asm/arch/avr/format.c +++ b/libr/asm/arch/avr/format.c @@ -72,7 +72,7 @@ int printDisassembledInstruction(avrDisassembleContext *context, char *out, cons * pointer to a C-string strOperand, which must be free'd after it has been used. * I decided to format the disassembled operands individually into strings for maximum flexibility, * and so that the printing of the formatted operand is not hard coded into the format operand code. - * If an addressLabelPrefix is specified in formattingOptions (option is set and string is not NULL), + * If an addressLabelPrefix is specified in formattingOptions (option is set and string is not NULL), * it will print the relative branch/jump/call with this prefix and the destination address as the label. */ static int formatDisassembledOperand(avrDisassembleContext *context, char *strOperand, int operandNum, const disassembledInstruction dInstruction, formattingOptions fOptions) { char binary[9]; diff --git a/libr/asm/arch/avr/format.h b/libr/asm/arch/avr/format.h index 635638137f..47959ecf03 100644 --- a/libr/asm/arch/avr/format.h +++ b/libr/asm/arch/avr/format.h @@ -16,13 +16,13 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * format_disasm.h - Header file to formatting of disassembled instructions, with * regard to the several formatting features this disasssembler supports. * */ - + #include "avr_disasm.h" #include "errorcodes.h" diff --git a/libr/asm/arch/dcpu16/asm.c b/libr/asm/arch/dcpu16/asm.c index 5c1f220aa2..edafed20d9 100644 --- a/libr/asm/arch/dcpu16/asm.c +++ b/libr/asm/arch/dcpu16/asm.c @@ -197,9 +197,9 @@ static ut8 decode_parameter(char* param, int* extra_word_needed, ut16* extra_wor /* Must be a label, store a labelref */ *extra_word_needed = 1; - /* Allocate blank extra word, this will be where the + /* Allocate blank extra word, this will be where the pointer to the label will be stored at link stage */ - *extra_word_value = 0; + *extra_word_value = 0; return 0x1f; } diff --git a/libr/asm/arch/dcpu16/main.c b/libr/asm/arch/dcpu16/main.c index aa4de46d9c..b1df717862 100644 --- a/libr/asm/arch/dcpu16/main.c +++ b/libr/asm/arch/dcpu16/main.c @@ -7,10 +7,10 @@ int main(int argc, char **argv) { if (argc>1) { char out[32]; ut8 buf[64] = { - 0x01, 0x7c, 0x30, 0x00, 0xe1, 0x7d, 0x00, 0x10, 0x20, 0x00, 0x03, - 0x78, 0x00, 0x10, 0x0d, 0xc0, 0xc1, 0x7d, 0x1a, 0x00, 0x61, 0xa8, - 0x01, 0x7c, 0x00, 0x20, 0x61, 0x21, 0x00, 0x20, 0x63, 0x84, 0x6d, - 0x80, 0xc1, 0x7d, 0x0d, 0x00, 0x31, 0x90, 0x10, 0x7c, 0x18, 0x00, + 0x01, 0x7c, 0x30, 0x00, 0xe1, 0x7d, 0x00, 0x10, 0x20, 0x00, 0x03, + 0x78, 0x00, 0x10, 0x0d, 0xc0, 0xc1, 0x7d, 0x1a, 0x00, 0x61, 0xa8, + 0x01, 0x7c, 0x00, 0x20, 0x61, 0x21, 0x00, 0x20, 0x63, 0x84, 0x6d, + 0x80, 0xc1, 0x7d, 0x0d, 0x00, 0x31, 0x90, 0x10, 0x7c, 0x18, 0x00, 0xc1, 0x7d, 0x1a, 0x00, 0x37, 0x90, 0xc1, 0x61, 0xc1, 0x7d, 0x1a, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, }; int len = sizeof (buf)-1; diff --git a/libr/asm/arch/gb/gbasm.c b/libr/asm/arch/gb/gbasm.c index 603d77f1ae..98894e4c22 100644 --- a/libr/asm/arch/gb/gbasm.c +++ b/libr/asm/arch/gb/gbasm.c @@ -557,7 +557,7 @@ static int gbAsm(RAsm *a, RAsmOp *op, const char *buf) { } } break; - case 0x63616c6c: //call + case 0x63616c6c: //call if (strlen(buf_asm) < 6) { return op->size = 0; } diff --git a/libr/asm/arch/hexagon/hexagon_disas.c b/libr/asm/arch/hexagon/hexagon_disas.c index 0533c752c6..019c2e9552 100644 --- a/libr/asm/arch/hexagon/hexagon_disas.c +++ b/libr/asm/arch/hexagon/hexagon_disas.c @@ -23575,7 +23575,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[3].op.reg = (((hi_u32) & 0x1f00) >> 8); // Rt hi->ops[4].type = HEX_OP_TYPE_IMM; hi->ops[4].op.imm = (((hi_u32 & 0x2000) >> 12) | ((hi_u32 & 0x80) >> 7)); - hi->predicate = HEX_PRED_FALSE; // if !Pv + hi->predicate = HEX_PRED_FALSE; // if !Pv sprintf(hi->mnem, "if !P%d R%d:R%d = memd (R%d + R%d << 0x%x)", hi->ops[0].op.pred, hi->ops[1].op.reg + 1, hi->ops[1].op.reg, hi->ops[2].op.reg, hi->ops[3].op.reg, hi->ops[4].op.imm); break; } @@ -23665,7 +23665,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[3].op.reg = (((hi_u32) & 0x1f00) >> 8); // Rt hi->ops[4].type = HEX_OP_TYPE_IMM; hi->ops[4].op.imm = (((hi_u32 & 0x2000) >> 12) | ((hi_u32 & 0x80) >> 7)); - hi->predicate = HEX_PRED_FALSE; // if !Pv + hi->predicate = HEX_PRED_FALSE; // if !Pv sprintf(hi->mnem, "if !P%d R%d = memb (R%d + R%d << 0x%x)", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.reg, hi->ops[3].op.reg, hi->ops[4].op.imm); break; } @@ -23753,7 +23753,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[3].op.reg = (((hi_u32) & 0x1f00) >> 8); // Rt hi->ops[4].type = HEX_OP_TYPE_IMM; hi->ops[4].op.imm = (((hi_u32 & 0x2000) >> 12) | ((hi_u32 & 0x80) >> 7)); - hi->predicate = HEX_PRED_FALSE; // if !Pv + hi->predicate = HEX_PRED_FALSE; // if !Pv sprintf(hi->mnem, "if !P%d R%d = memh (R%d + R%d << 0x%x)", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.reg, hi->ops[3].op.reg, hi->ops[4].op.imm); break; } @@ -23841,7 +23841,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[3].op.reg = (((hi_u32) & 0x1f00) >> 8); // Rt hi->ops[4].type = HEX_OP_TYPE_IMM; hi->ops[4].op.imm = (((hi_u32 & 0x2000) >> 12) | ((hi_u32 & 0x80) >> 7)); - hi->predicate = HEX_PRED_FALSE; // if !Pv + hi->predicate = HEX_PRED_FALSE; // if !Pv sprintf(hi->mnem, "if !P%d R%d = memub (R%d + R%d << 0x%x)", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.reg, hi->ops[3].op.reg, hi->ops[4].op.imm); break; } @@ -23929,7 +23929,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[3].op.reg = (((hi_u32) & 0x1f00) >> 8); // Rt hi->ops[4].type = HEX_OP_TYPE_IMM; hi->ops[4].op.imm = (((hi_u32 & 0x2000) >> 12) | ((hi_u32 & 0x80) >> 7)); - hi->predicate = HEX_PRED_FALSE; // if !Pv + hi->predicate = HEX_PRED_FALSE; // if !Pv sprintf(hi->mnem, "if !P%d R%d = memuh (R%d + R%d << 0x%x)", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.reg, hi->ops[3].op.reg, hi->ops[4].op.imm); break; } @@ -24017,7 +24017,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[3].op.reg = (((hi_u32) & 0x1f00) >> 8); // Rt hi->ops[4].type = HEX_OP_TYPE_IMM; hi->ops[4].op.imm = (((hi_u32 & 0x2000) >> 12) | ((hi_u32 & 0x80) >> 7)); - hi->predicate = HEX_PRED_FALSE; // if !Pv + hi->predicate = HEX_PRED_FALSE; // if !Pv sprintf(hi->mnem, "if !P%d R%d = memw (R%d + R%d << 0x%x)", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.reg, hi->ops[3].op.reg, hi->ops[4].op.imm); break; } @@ -24441,7 +24441,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[3].op.imm = (((hi_u32 & 0x2000) >> 12) | ((hi_u32 & 0x80) >> 7)); hi->ops[4].type = HEX_OP_TYPE_REG; hi->ops[4].op.reg = (((hi_u32) & 0x7) >> 0); // Nt.new - hi->predicate = HEX_PRED_FALSE; // if !Pv + hi->predicate = HEX_PRED_FALSE; // if !Pv sprintf(hi->mnem, "if !P%d memb (R%d + R%d << 0x%x) = R%d", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.reg, hi->ops[3].op.imm, hi->ops[4].op.reg); break; } @@ -24529,7 +24529,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[3].op.imm = (((hi_u32 & 0x2000) >> 12) | ((hi_u32 & 0x80) >> 7)); hi->ops[4].type = HEX_OP_TYPE_REG; hi->ops[4].op.reg = (((hi_u32) & 0x7) >> 0); // Nt.new - hi->predicate = HEX_PRED_FALSE; // if !Pv + hi->predicate = HEX_PRED_FALSE; // if !Pv sprintf(hi->mnem, "if !P%d memh (R%d + R%d << 0x%x) = R%d", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.reg, hi->ops[3].op.imm, hi->ops[4].op.reg); break; } @@ -24617,7 +24617,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[3].op.imm = (((hi_u32 & 0x2000) >> 12) | ((hi_u32 & 0x80) >> 7)); hi->ops[4].type = HEX_OP_TYPE_REG; hi->ops[4].op.reg = (((hi_u32) & 0x7) >> 0); // Nt.new - hi->predicate = HEX_PRED_FALSE; // if !Pv + hi->predicate = HEX_PRED_FALSE; // if !Pv sprintf(hi->mnem, "if !P%d memw (R%d + R%d << 0x%x) = R%d", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.reg, hi->ops[3].op.imm, hi->ops[4].op.reg); break; } @@ -24708,7 +24708,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[4].type = HEX_OP_TYPE_REG; hi->ops[4].attr |= HEX_OP_REG_PAIR; hi->ops[4].op.reg = (((hi_u32) & 0x1f) >> 0); - hi->predicate = HEX_PRED_FALSE; // if !Pv + hi->predicate = HEX_PRED_FALSE; // if !Pv sprintf(hi->mnem, "if !P%d memd (R%d + R%d << 0x%x) = R%d:R%d", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.reg, hi->ops[3].op.imm, hi->ops[4].op.reg + 1, hi->ops[4].op.reg); break; } @@ -24816,7 +24816,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[3].op.imm = (((hi_u32 & 0x2000) >> 12) | ((hi_u32 & 0x80) >> 7)); hi->ops[4].type = HEX_OP_TYPE_REG; hi->ops[4].op.reg = (((hi_u32) & 0x1f) >> 0); // Rt - hi->predicate = HEX_PRED_FALSE; // if !Pv + hi->predicate = HEX_PRED_FALSE; // if !Pv sprintf(hi->mnem, "if !P%d memb (R%d + R%d << 0x%x) = R%d", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.reg, hi->ops[3].op.imm, hi->ops[4].op.reg); break; } @@ -24890,7 +24890,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { if (hi->ops[3].op.imm & (1 << 5)) { hi->ops[3].op.imm |= (0xFFFFFFFF << 5); } - hi->predicate = HEX_PRED_FALSE; // if !Pv + hi->predicate = HEX_PRED_FALSE; // if !Pv sprintf(hi->mnem, "if !P%d memb (R%d + 0x%x) = %d", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.imm, (st32) hi->ops[3].op.imm); break; } @@ -25032,7 +25032,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[3].op.imm = (((hi_u32 & 0x2000) >> 12) | ((hi_u32 & 0x80) >> 7)); hi->ops[4].type = HEX_OP_TYPE_REG; hi->ops[4].op.reg = (((hi_u32) & 0x1f) >> 0); // Rt - hi->predicate = HEX_PRED_FALSE; // if !Pv + hi->predicate = HEX_PRED_FALSE; // if !Pv sprintf(hi->mnem, "if !P%d memh (R%d + R%d << 0x%x) = R%d", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.reg, hi->ops[3].op.imm, hi->ops[4].op.reg); break; } @@ -25050,7 +25050,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[3].op.imm = (((hi_u32 & 0x2000) >> 12) | ((hi_u32 & 0x80) >> 7)); hi->ops[4].type = HEX_OP_TYPE_REG; hi->ops[4].op.reg = (((hi_u32) & 0x1f) >> 0); // Rt - hi->predicate = HEX_PRED_FALSE; // if !Pv + hi->predicate = HEX_PRED_FALSE; // if !Pv sprintf(hi->mnem, "if !P%d memh (R%d + R%d << 0x%x) = R%d.H", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.reg, hi->ops[3].op.imm, hi->ops[4].op.reg); break; } @@ -25160,7 +25160,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { if (hi->ops[3].op.imm & (1 << 5)) { hi->ops[3].op.imm |= (0xFFFFFFFF << 5); } - hi->predicate = HEX_PRED_FALSE; // if !Pv + hi->predicate = HEX_PRED_FALSE; // if !Pv sprintf(hi->mnem, "if !P%d memh (R%d + 0x%x) = %d", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.imm, (st32) hi->ops[3].op.imm); break; } @@ -25268,7 +25268,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[3].op.imm = (((hi_u32 & 0x2000) >> 12) | ((hi_u32 & 0x80) >> 7)); hi->ops[4].type = HEX_OP_TYPE_REG; hi->ops[4].op.reg = (((hi_u32) & 0x1f) >> 0); // Rt - hi->predicate = HEX_PRED_FALSE; // if !Pv + hi->predicate = HEX_PRED_FALSE; // if !Pv sprintf(hi->mnem, "if !P%d memw (R%d + R%d << 0x%x) = R%d", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.reg, hi->ops[3].op.imm, hi->ops[4].op.reg); break; } @@ -25342,7 +25342,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { if (hi->ops[3].op.imm & (1 << 5)) { hi->ops[3].op.imm |= (0xFFFFFFFF << 5); } - hi->predicate = HEX_PRED_FALSE; // if !Pv + hi->predicate = HEX_PRED_FALSE; // if !Pv sprintf(hi->mnem, "if !P%d memw (R%d + 0x%x) = %d", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.imm, (st32) hi->ops[3].op.imm); break; } @@ -25449,7 +25449,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[2].op.reg = (((hi_u32) & 0x1f0000) >> 16); // Rs hi->ops[3].type = HEX_OP_TYPE_IMM; hi->ops[3].op.imm = (((hi_u32) & 0x7e0) >> 5) << 3; // scaled - hi->predicate = HEX_PRED_FALSE; // if !Pt + hi->predicate = HEX_PRED_FALSE; // if !Pt hex_op_extend_off(&hi->ops[3], 3); sprintf(hi->mnem, "if !P%d R%d:R%d = memd (R%d + 0x%x)", hi->ops[0].op.pred, hi->ops[1].op.reg + 1, hi->ops[1].op.reg, hi->ops[2].op.reg, hi->ops[3].op.imm); break; @@ -25530,7 +25530,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[2].op.reg = (((hi_u32) & 0x1f0000) >> 16); // Rs hi->ops[3].type = HEX_OP_TYPE_IMM; hi->ops[3].op.imm = (((hi_u32) & 0x7e0) >> 5); - hi->predicate = HEX_PRED_FALSE; // if !Pt + hi->predicate = HEX_PRED_FALSE; // if !Pt hex_op_extend(&hi->ops[3]); sprintf(hi->mnem, "if !P%d R%d = memb (R%d + 0x%x)", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.reg, hi->ops[3].op.imm); break; @@ -25610,7 +25610,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[2].op.reg = (((hi_u32) & 0x1f0000) >> 16); // Rs hi->ops[3].type = HEX_OP_TYPE_IMM; hi->ops[3].op.imm = (((hi_u32) & 0x7e0) >> 5) << 1; // scaled - hi->predicate = HEX_PRED_FALSE; // if !Pt + hi->predicate = HEX_PRED_FALSE; // if !Pt hex_op_extend_off(&hi->ops[3], 1); sprintf(hi->mnem, "if !P%d R%d = memh (R%d + 0x%x)", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.reg, hi->ops[3].op.imm); break; @@ -25690,7 +25690,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[2].op.reg = (((hi_u32) & 0x1f0000) >> 16); // Rs hi->ops[3].type = HEX_OP_TYPE_IMM; hi->ops[3].op.imm = (((hi_u32) & 0x7e0) >> 5); - hi->predicate = HEX_PRED_FALSE; // if !Pt + hi->predicate = HEX_PRED_FALSE; // if !Pt hex_op_extend(&hi->ops[3]); sprintf(hi->mnem, "if !P%d R%d = memub (R%d + 0x%x)", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.reg, hi->ops[3].op.imm); break; @@ -25770,7 +25770,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[2].op.reg = (((hi_u32) & 0x1f0000) >> 16); // Rs hi->ops[3].type = HEX_OP_TYPE_IMM; hi->ops[3].op.imm = (((hi_u32) & 0x7e0) >> 5) << 1; // scaled - hi->predicate = HEX_PRED_FALSE; // if !Pt + hi->predicate = HEX_PRED_FALSE; // if !Pt hex_op_extend_off(&hi->ops[3], 1); sprintf(hi->mnem, "if !P%d R%d = memuh (R%d + 0x%x)", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.reg, hi->ops[3].op.imm); break; @@ -25851,7 +25851,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[2].op.reg = (((hi_u32) & 0x1f0000) >> 16); // Rs hi->ops[3].type = HEX_OP_TYPE_IMM; hi->ops[3].op.imm = (((hi_u32) & 0x7e0) >> 5) << 2; // scaled - hi->predicate = HEX_PRED_FALSE; // if !Pt + hi->predicate = HEX_PRED_FALSE; // if !Pt hex_op_extend_off(&hi->ops[3], 2); sprintf(hi->mnem, "if !P%d R%d = memw (R%d + 0x%x)", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.reg, hi->ops[3].op.imm); break; @@ -25930,7 +25930,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[2].op.imm = (((hi_u32 & 0x2000) >> 8) | ((hi_u32 & 0xf8) >> 3)); hi->ops[3].type = HEX_OP_TYPE_REG; hi->ops[3].op.reg = (((hi_u32) & 0x700) >> 8); // Nt.new - hi->predicate = HEX_PRED_FALSE; // if !Pv + hi->predicate = HEX_PRED_FALSE; // if !Pv sprintf(hi->mnem, "if !P%d memb (R%d + 0x%x) = R%d", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.imm, hi->ops[3].op.reg); break; } @@ -26006,7 +26006,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[2].op.imm = (((hi_u32 & 0x2000) >> 8) | ((hi_u32 & 0xf8) >> 3)) << 1; // scaled hi->ops[3].type = HEX_OP_TYPE_REG; hi->ops[3].op.reg = (((hi_u32) & 0x700) >> 8); // Nt.new - hi->predicate = HEX_PRED_FALSE; // if !Pv + hi->predicate = HEX_PRED_FALSE; // if !Pv sprintf(hi->mnem, "if !P%d memh (R%d + 0x%x) = R%d", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.imm, hi->ops[3].op.reg); break; } @@ -26082,7 +26082,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[2].op.imm = (((hi_u32 & 0x2000) >> 8) | ((hi_u32 & 0xf8) >> 3)) << 2; // scaled hi->ops[3].type = HEX_OP_TYPE_REG; hi->ops[3].op.reg = (((hi_u32) & 0x700) >> 8); // Nt.new - hi->predicate = HEX_PRED_FALSE; // if !Pv + hi->predicate = HEX_PRED_FALSE; // if !Pv sprintf(hi->mnem, "if !P%d memw (R%d + 0x%x) = R%d", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.imm, hi->ops[3].op.reg); break; } @@ -26164,7 +26164,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[3].type = HEX_OP_TYPE_REG; hi->ops[3].attr |= HEX_OP_REG_PAIR; hi->ops[3].op.reg = (((hi_u32) & 0x1f00) >> 8); - hi->predicate = HEX_PRED_FALSE; // if !Pv + hi->predicate = HEX_PRED_FALSE; // if !Pv hex_op_extend_off(&hi->ops[2], 3); sprintf(hi->mnem, "if !P%d memd (R%d + 0x%x) = R%d:R%d", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.imm, hi->ops[3].op.reg + 1, hi->ops[3].op.reg); break; @@ -26246,7 +26246,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[2].op.imm = (((hi_u32 & 0x2000) >> 8) | ((hi_u32 & 0xf8) >> 3)); hi->ops[3].type = HEX_OP_TYPE_REG; hi->ops[3].op.reg = (((hi_u32) & 0x1f00) >> 8); // Rt - hi->predicate = HEX_PRED_FALSE; // if !Pv + hi->predicate = HEX_PRED_FALSE; // if !Pv hex_op_extend(&hi->ops[2]); sprintf(hi->mnem, "if !P%d memb (R%d + 0x%x) = R%d", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.imm, hi->ops[3].op.reg); break; @@ -26370,7 +26370,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[2].op.imm = (((hi_u32 & 0x2000) >> 8) | ((hi_u32 & 0xf8) >> 3)) << 1; // scaled hi->ops[3].type = HEX_OP_TYPE_REG; hi->ops[3].op.reg = (((hi_u32) & 0x1f00) >> 8); // Rt - hi->predicate = HEX_PRED_FALSE; // if !Pv + hi->predicate = HEX_PRED_FALSE; // if !Pv hex_op_extend_off(&hi->ops[2], 1); sprintf(hi->mnem, "if !P%d memh (R%d + 0x%x) = R%d", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.imm, hi->ops[3].op.reg); break; @@ -26387,7 +26387,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[2].op.imm = (((hi_u32 & 0x2000) >> 8) | ((hi_u32 & 0xf8) >> 3)) << 1; // scaled hi->ops[3].type = HEX_OP_TYPE_REG; hi->ops[3].op.reg = (((hi_u32) & 0x1f00) >> 8); // Rt - hi->predicate = HEX_PRED_FALSE; // if !Pv + hi->predicate = HEX_PRED_FALSE; // if !Pv sprintf(hi->mnem, "if !P%d memh (R%d + 0x%x) = R%d.H", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.imm, hi->ops[3].op.reg); break; } @@ -26482,7 +26482,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[2].op.imm = (((hi_u32 & 0x2000) >> 8) | ((hi_u32 & 0xf8) >> 3)) << 2; // scaled hi->ops[3].type = HEX_OP_TYPE_REG; hi->ops[3].op.reg = (((hi_u32) & 0x1f00) >> 8); // Rt - hi->predicate = HEX_PRED_FALSE; // if !Pv + hi->predicate = HEX_PRED_FALSE; // if !Pv hex_op_extend_off(&hi->ops[2], 2); sprintf(hi->mnem, "if !P%d memw (R%d + 0x%x) = R%d", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.imm, hi->ops[3].op.reg); break; @@ -26537,7 +26537,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[0].op.pred = (((hi_u32) & 0x300) >> 8); hi->ops[1].type = HEX_OP_TYPE_REG; hi->ops[1].op.reg = (((hi_u32) & 0x1f0000) >> 16); // Rs - hi->predicate = HEX_PRED_FALSE; // if !Pu + hi->predicate = HEX_PRED_FALSE; // if !Pu sprintf(hi->mnem, "if !P%d callr R%d", hi->ops[0].op.pred, hi->ops[1].op.reg); break; } @@ -26617,7 +26617,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[0].op.pred = (((hi_u32) & 0x300) >> 8); hi->ops[1].type = HEX_OP_TYPE_REG; hi->ops[1].op.reg = (((hi_u32) & 0x1f0000) >> 16); // Rs - hi->predicate = HEX_PRED_FALSE; // if !Pu + hi->predicate = HEX_PRED_FALSE; // if !Pu sprintf(hi->mnem, "if !P%d jumpr:nt R%d", hi->ops[0].op.pred, hi->ops[1].op.reg); break; } @@ -26641,7 +26641,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[0].op.pred = (((hi_u32) & 0x300) >> 8); hi->ops[1].type = HEX_OP_TYPE_REG; hi->ops[1].op.reg = (((hi_u32) & 0x1f0000) >> 16); // Rs - hi->predicate = HEX_PRED_FALSE; // if !Pu + hi->predicate = HEX_PRED_FALSE; // if !Pu sprintf(hi->mnem, "if !P%d jumpr:t R%d", hi->ops[0].op.pred, hi->ops[1].op.reg); break; } @@ -26698,7 +26698,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { if (hi->ops[1].op.imm & (1 << 16)) { hi->ops[1].op.imm |= (0xFFFFFFFF << 16); } - hi->predicate = HEX_PRED_FALSE; // if !Pu + hi->predicate = HEX_PRED_FALSE; // if !Pu hex_op_extend_off(&hi->ops[1], 2); sprintf(hi->mnem, "if !P%d call 0x%x", hi->ops[0].op.pred, addr + (st32) hi->ops[1].op.imm); break; @@ -26758,7 +26758,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { if (hi->ops[1].op.imm & (1 << 16)) { hi->ops[1].op.imm |= (0xFFFFFFFF << 16); } - hi->predicate = HEX_PRED_FALSE; // if !Pu + hi->predicate = HEX_PRED_FALSE; // if !Pu sprintf(hi->mnem, "if !P%d jump:nt 0x%x", hi->ops[0].op.pred, addr + (st32) hi->ops[1].op.imm); break; } @@ -26773,7 +26773,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { if (hi->ops[1].op.imm & (1 << 16)) { hi->ops[1].op.imm |= (0xFFFFFFFF << 16); } - hi->predicate = HEX_PRED_FALSE; // if !Pu + hi->predicate = HEX_PRED_FALSE; // if !Pu sprintf(hi->mnem, "if !P%d jump:t 0x%x", hi->ops[0].op.pred, addr + (st32) hi->ops[1].op.imm); break; } @@ -28326,7 +28326,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { if (hi->ops[3].op.imm & (1 << 7)) { hi->ops[3].op.imm |= (0xFFFFFFFF << 7); } - hi->predicate = HEX_PRED_FALSE; // if !Pu + hi->predicate = HEX_PRED_FALSE; // if !Pu hex_op_extend(&hi->ops[3]); sprintf(hi->mnem, "if !P%d R%d = add (R%d, %d)", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.reg, (st32) hi->ops[3].op.imm); break; @@ -28389,7 +28389,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[1].op.reg = (((hi_u32) & 0x1f) >> 0); // Rd hi->ops[2].type = HEX_OP_TYPE_REG; hi->ops[2].op.reg = (((hi_u32) & 0x1f0000) >> 16); // Rs - hi->predicate = HEX_PRED_FALSE; // if !Pu + hi->predicate = HEX_PRED_FALSE; // if !Pu sprintf(hi->mnem, "if !P%d R%d = aslh (R%d)", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.reg); break; } @@ -28445,7 +28445,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[1].op.reg = (((hi_u32) & 0x1f) >> 0); // Rd hi->ops[2].type = HEX_OP_TYPE_REG; hi->ops[2].op.reg = (((hi_u32) & 0x1f0000) >> 16); // Rs - hi->predicate = HEX_PRED_FALSE; // if !Pu + hi->predicate = HEX_PRED_FALSE; // if !Pu sprintf(hi->mnem, "if !P%d R%d = asrh (R%d)", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.reg); break; } @@ -28501,7 +28501,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[1].op.reg = (((hi_u32) & 0x1f) >> 0); // Rd hi->ops[2].type = HEX_OP_TYPE_REG; hi->ops[2].op.reg = (((hi_u32) & 0x1f0000) >> 16); // Rs - hi->predicate = HEX_PRED_FALSE; // if !Pu + hi->predicate = HEX_PRED_FALSE; // if !Pu sprintf(hi->mnem, "if !P%d R%d = sxtb (R%d)", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.reg); break; } @@ -28557,7 +28557,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[1].op.reg = (((hi_u32) & 0x1f) >> 0); // Rd hi->ops[2].type = HEX_OP_TYPE_REG; hi->ops[2].op.reg = (((hi_u32) & 0x1f0000) >> 16); // Rs - hi->predicate = HEX_PRED_FALSE; // if !Pu + hi->predicate = HEX_PRED_FALSE; // if !Pu sprintf(hi->mnem, "if !P%d R%d = sxth (R%d)", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.reg); break; } @@ -28624,7 +28624,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { if (hi->ops[2].op.imm & (1 << 11)) { hi->ops[2].op.imm |= (0xFFFFFFFF << 11); } - hi->predicate = HEX_PRED_FALSE; // if !Pu + hi->predicate = HEX_PRED_FALSE; // if !Pu hex_op_extend(&hi->ops[2]); sprintf(hi->mnem, "if !P%d R%d = %d", hi->ops[0].op.pred, hi->ops[1].op.reg, (st32) hi->ops[2].op.imm); break; @@ -28685,7 +28685,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[1].op.reg = (((hi_u32) & 0x1f) >> 0); // Rd hi->ops[2].type = HEX_OP_TYPE_REG; hi->ops[2].op.reg = (((hi_u32) & 0x1f0000) >> 16); // Rs - hi->predicate = HEX_PRED_FALSE; // if !Pu + hi->predicate = HEX_PRED_FALSE; // if !Pu sprintf(hi->mnem, "if !P%d R%d = zxtb (R%d)", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.reg); break; } @@ -28741,7 +28741,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[1].op.reg = (((hi_u32) & 0x1f) >> 0); // Rd hi->ops[2].type = HEX_OP_TYPE_REG; hi->ops[2].op.reg = (((hi_u32) & 0x1f0000) >> 16); // Rs - hi->predicate = HEX_PRED_FALSE; // if !Pu + hi->predicate = HEX_PRED_FALSE; // if !Pu sprintf(hi->mnem, "if !P%d R%d = zxth (R%d)", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.reg); break; } @@ -31526,7 +31526,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { if (hi->ops[3].op.imm & (1 << 6)) { hi->ops[3].op.imm |= (0xFFFFFFFF << 6); } - hi->predicate = HEX_PRED_FALSE; // if !Pt + hi->predicate = HEX_PRED_FALSE; // if !Pt sprintf(hi->mnem, "if !P%d R%d:R%d = memd (R%d ++ %d)", hi->ops[0].op.pred, hi->ops[1].op.reg + 1, hi->ops[1].op.reg, hi->ops[2].op.reg, (st32) hi->ops[3].op.imm); break; } @@ -31597,7 +31597,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[1].op.reg = (((hi_u32) & 0x1f) >> 0); hi->ops[2].type = HEX_OP_TYPE_IMM; hi->ops[2].op.imm = (((hi_u32 & 0x1f0000) >> 15) | ((hi_u32 & 0x100) >> 8)); - hi->predicate = HEX_PRED_FALSE; // if !Pt + hi->predicate = HEX_PRED_FALSE; // if !Pt hex_op_extend(&hi->ops[2]); sprintf(hi->mnem, "if !P%d R%d:R%d = memd (0x%x)", hi->ops[0].op.pred, hi->ops[1].op.reg + 1, hi->ops[1].op.reg, hi->ops[2].op.imm); break; @@ -31796,7 +31796,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { if (hi->ops[3].op.imm & (1 << 3)) { hi->ops[3].op.imm |= (0xFFFFFFFF << 3); } - hi->predicate = HEX_PRED_FALSE; // if !Pt + hi->predicate = HEX_PRED_FALSE; // if !Pt sprintf(hi->mnem, "if !P%d R%d = memb (R%d ++ %d)", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.reg, (st32) hi->ops[3].op.imm); break; } @@ -31863,7 +31863,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[1].op.reg = (((hi_u32) & 0x1f) >> 0); // Rd hi->ops[2].type = HEX_OP_TYPE_IMM; hi->ops[2].op.imm = (((hi_u32 & 0x1f0000) >> 15) | ((hi_u32 & 0x100) >> 8)); - hi->predicate = HEX_PRED_FALSE; // if !Pt + hi->predicate = HEX_PRED_FALSE; // if !Pt hex_op_extend(&hi->ops[2]); sprintf(hi->mnem, "if !P%d R%d = memb (0x%x)", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.imm); break; @@ -32326,7 +32326,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { if (hi->ops[3].op.imm & (1 << 4)) { hi->ops[3].op.imm |= (0xFFFFFFFF << 4); } - hi->predicate = HEX_PRED_FALSE; // if !Pt + hi->predicate = HEX_PRED_FALSE; // if !Pt sprintf(hi->mnem, "if !P%d R%d = memh (R%d ++ %d)", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.reg, (st32) hi->ops[3].op.imm); break; } @@ -32393,7 +32393,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[1].op.reg = (((hi_u32) & 0x1f) >> 0); // Rd hi->ops[2].type = HEX_OP_TYPE_IMM; hi->ops[2].op.imm = (((hi_u32 & 0x1f0000) >> 15) | ((hi_u32 & 0x100) >> 8)); - hi->predicate = HEX_PRED_FALSE; // if !Pt + hi->predicate = HEX_PRED_FALSE; // if !Pt hex_op_extend(&hi->ops[2]); sprintf(hi->mnem, "if !P%d R%d = memh (0x%x)", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.imm); break; @@ -32590,7 +32590,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { if (hi->ops[3].op.imm & (1 << 3)) { hi->ops[3].op.imm |= (0xFFFFFFFF << 3); } - hi->predicate = HEX_PRED_FALSE; // if !Pt + hi->predicate = HEX_PRED_FALSE; // if !Pt sprintf(hi->mnem, "if !P%d R%d = memub (R%d ++ %d)", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.reg, (st32) hi->ops[3].op.imm); break; } @@ -32657,7 +32657,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[1].op.reg = (((hi_u32) & 0x1f) >> 0); // Rd hi->ops[2].type = HEX_OP_TYPE_IMM; hi->ops[2].op.imm = (((hi_u32 & 0x1f0000) >> 15) | ((hi_u32 & 0x100) >> 8)); - hi->predicate = HEX_PRED_FALSE; // if !Pt + hi->predicate = HEX_PRED_FALSE; // if !Pt hex_op_extend(&hi->ops[2]); sprintf(hi->mnem, "if !P%d R%d = memub (0x%x)", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.imm); break; @@ -32854,7 +32854,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { if (hi->ops[3].op.imm & (1 << 4)) { hi->ops[3].op.imm |= (0xFFFFFFFF << 4); } - hi->predicate = HEX_PRED_FALSE; // if !Pt + hi->predicate = HEX_PRED_FALSE; // if !Pt sprintf(hi->mnem, "if !P%d R%d = memuh (R%d ++ %d)", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.reg, (st32) hi->ops[3].op.imm); break; } @@ -32921,7 +32921,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[1].op.reg = (((hi_u32) & 0x1f) >> 0); // Rd hi->ops[2].type = HEX_OP_TYPE_IMM; hi->ops[2].op.imm = (((hi_u32 & 0x1f0000) >> 15) | ((hi_u32 & 0x100) >> 8)); - hi->predicate = HEX_PRED_FALSE; // if !Pt + hi->predicate = HEX_PRED_FALSE; // if !Pt hex_op_extend(&hi->ops[2]); sprintf(hi->mnem, "if !P%d R%d = memuh (0x%x)", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.imm); break; @@ -33118,7 +33118,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { if (hi->ops[3].op.imm & (1 << 5)) { hi->ops[3].op.imm |= (0xFFFFFFFF << 5); } - hi->predicate = HEX_PRED_FALSE; // if !Pt + hi->predicate = HEX_PRED_FALSE; // if !Pt sprintf(hi->mnem, "if !P%d R%d = memw (R%d ++ %d)", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.reg, (st32) hi->ops[3].op.imm); break; } @@ -33185,7 +33185,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[1].op.reg = (((hi_u32) & 0x1f) >> 0); // Rd hi->ops[2].type = HEX_OP_TYPE_IMM; hi->ops[2].op.imm = (((hi_u32 & 0x1f0000) >> 15) | ((hi_u32 & 0x100) >> 8)); - hi->predicate = HEX_PRED_FALSE; // if !Pt + hi->predicate = HEX_PRED_FALSE; // if !Pt hex_op_extend(&hi->ops[2]); sprintf(hi->mnem, "if !P%d R%d = memw (0x%x)", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.imm); break; @@ -34027,7 +34027,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { } hi->ops[3].type = HEX_OP_TYPE_REG; hi->ops[3].op.reg = (((hi_u32) & 0x700) >> 8); // Nt.new - hi->predicate = HEX_PRED_FALSE; // if !Pv + hi->predicate = HEX_PRED_FALSE; // if !Pv sprintf(hi->mnem, "if !P%d memb (R%d ++ %d) = R%d", hi->ops[0].op.pred, hi->ops[1].op.reg, (st32) hi->ops[2].op.imm, hi->ops[3].op.reg); break; } @@ -34093,7 +34093,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[1].op.imm = (((hi_u32 & 0x30000) >> 12) | ((hi_u32 & 0x78) >> 3)); hi->ops[2].type = HEX_OP_TYPE_REG; hi->ops[2].op.reg = (((hi_u32) & 0x700) >> 8); // Nt.new - hi->predicate = HEX_PRED_FALSE; // if !Pv + hi->predicate = HEX_PRED_FALSE; // if !Pv sprintf(hi->mnem, "if !P%d memb (0x%x) = R%d", hi->ops[0].op.pred, hi->ops[1].op.imm, hi->ops[2].op.reg); break; } @@ -34286,7 +34286,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { } hi->ops[3].type = HEX_OP_TYPE_REG; hi->ops[3].op.reg = (((hi_u32) & 0x700) >> 8); // Nt.new - hi->predicate = HEX_PRED_FALSE; // if !Pv + hi->predicate = HEX_PRED_FALSE; // if !Pv sprintf(hi->mnem, "if !P%d memh (R%d ++ %d) = R%d", hi->ops[0].op.pred, hi->ops[1].op.reg, (st32) hi->ops[2].op.imm, hi->ops[3].op.reg); break; } @@ -34352,7 +34352,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[1].op.imm = (((hi_u32 & 0x30000) >> 12) | ((hi_u32 & 0x78) >> 3)); hi->ops[2].type = HEX_OP_TYPE_REG; hi->ops[2].op.reg = (((hi_u32) & 0x700) >> 8); // Nt.new - hi->predicate = HEX_PRED_FALSE; // if !Pv + hi->predicate = HEX_PRED_FALSE; // if !Pv sprintf(hi->mnem, "if !P%d memh (0x%x) = R%d", hi->ops[0].op.pred, hi->ops[1].op.imm, hi->ops[2].op.reg); break; } @@ -34545,7 +34545,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { } hi->ops[3].type = HEX_OP_TYPE_REG; hi->ops[3].op.reg = (((hi_u32) & 0x700) >> 8); // Nt.new - hi->predicate = HEX_PRED_FALSE; // if !Pv + hi->predicate = HEX_PRED_FALSE; // if !Pv sprintf(hi->mnem, "if !P%d memw (R%d ++ %d) = R%d", hi->ops[0].op.pred, hi->ops[1].op.reg, (st32) hi->ops[2].op.imm, hi->ops[3].op.reg); break; } @@ -34612,7 +34612,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[1].op.imm = (((hi_u32 & 0x30000) >> 12) | ((hi_u32 & 0x78) >> 3)); hi->ops[2].type = HEX_OP_TYPE_REG; hi->ops[2].op.reg = (((hi_u32) & 0x700) >> 8); // Nt.new - hi->predicate = HEX_PRED_FALSE; // if !Pv + hi->predicate = HEX_PRED_FALSE; // if !Pv hex_op_extend(&hi->ops[1]); sprintf(hi->mnem, "if !P%d memw (0x%x) = R%d", hi->ops[0].op.pred, hi->ops[1].op.imm, hi->ops[2].op.reg); break; @@ -34819,7 +34819,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[3].type = HEX_OP_TYPE_REG; hi->ops[3].attr |= HEX_OP_REG_PAIR; hi->ops[3].op.reg = (((hi_u32) & 0x1f00) >> 8); - hi->predicate = HEX_PRED_FALSE; // if !Pv + hi->predicate = HEX_PRED_FALSE; // if !Pv sprintf(hi->mnem, "if !P%d memd (R%d ++ %d) = R%d:R%d", hi->ops[0].op.pred, hi->ops[1].op.reg, (st32) hi->ops[2].op.imm, hi->ops[3].op.reg + 1, hi->ops[3].op.reg); break; } @@ -34889,7 +34889,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[2].type = HEX_OP_TYPE_REG; hi->ops[2].attr |= HEX_OP_REG_PAIR; hi->ops[2].op.reg = (((hi_u32) & 0x1f00) >> 8); - hi->predicate = HEX_PRED_FALSE; // if !Pv + hi->predicate = HEX_PRED_FALSE; // if !Pv sprintf(hi->mnem, "if !P%d memd (0x%x) = R%d:R%d", hi->ops[0].op.pred, hi->ops[1].op.imm, hi->ops[2].op.reg + 1, hi->ops[2].op.reg); break; } @@ -35085,7 +35085,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { } hi->ops[3].type = HEX_OP_TYPE_REG; hi->ops[3].op.reg = (((hi_u32) & 0x1f00) >> 8); // Rt - hi->predicate = HEX_PRED_FALSE; // if !Pv + hi->predicate = HEX_PRED_FALSE; // if !Pv sprintf(hi->mnem, "if !P%d memb (R%d ++ %d) = R%d", hi->ops[0].op.pred, hi->ops[1].op.reg, (st32) hi->ops[2].op.imm, hi->ops[3].op.reg); break; } @@ -35151,7 +35151,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[1].op.imm = (((hi_u32 & 0x30000) >> 12) | ((hi_u32 & 0x78) >> 3)); hi->ops[2].type = HEX_OP_TYPE_REG; hi->ops[2].op.reg = (((hi_u32) & 0x1f00) >> 8); // Rt - hi->predicate = HEX_PRED_FALSE; // if !Pv + hi->predicate = HEX_PRED_FALSE; // if !Pv sprintf(hi->mnem, "if !P%d memb (0x%x) = R%d", hi->ops[0].op.pred, hi->ops[1].op.imm, hi->ops[2].op.reg); break; } @@ -35470,7 +35470,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { } hi->ops[3].type = HEX_OP_TYPE_REG; hi->ops[3].op.reg = (((hi_u32) & 0x1f00) >> 8); // Rt - hi->predicate = HEX_PRED_FALSE; // if !Pv + hi->predicate = HEX_PRED_FALSE; // if !Pv sprintf(hi->mnem, "if !P%d memh (R%d ++ %d) = R%d", hi->ops[0].op.pred, hi->ops[1].op.reg, (st32) hi->ops[2].op.imm, hi->ops[3].op.reg); break; } @@ -35546,7 +35546,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { } hi->ops[3].type = HEX_OP_TYPE_REG; hi->ops[3].op.reg = (((hi_u32) & 0x1f00) >> 8); // Rt - hi->predicate = HEX_PRED_FALSE; // if !Pv + hi->predicate = HEX_PRED_FALSE; // if !Pv sprintf(hi->mnem, "if !P%d memh (R%d ++ %d) = R%d.H", hi->ops[0].op.pred, hi->ops[1].op.reg, (st32) hi->ops[2].op.imm, hi->ops[3].op.reg); break; } @@ -35612,7 +35612,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[1].op.imm = (((hi_u32 & 0x30000) >> 12) | ((hi_u32 & 0x78) >> 3)); hi->ops[2].type = HEX_OP_TYPE_REG; hi->ops[2].op.reg = (((hi_u32) & 0x1f00) >> 8); // Rt - hi->predicate = HEX_PRED_FALSE; // if !Pv + hi->predicate = HEX_PRED_FALSE; // if !Pv sprintf(hi->mnem, "if !P%d memh (0x%x) = R%d", hi->ops[0].op.pred, hi->ops[1].op.imm, hi->ops[2].op.reg); break; } @@ -35668,7 +35668,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[1].op.imm = (((hi_u32 & 0x30000) >> 12) | ((hi_u32 & 0x78) >> 3)); hi->ops[2].type = HEX_OP_TYPE_REG; hi->ops[2].op.reg = (((hi_u32) & 0x1f00) >> 8); // Rt - hi->predicate = HEX_PRED_FALSE; // if !Pv + hi->predicate = HEX_PRED_FALSE; // if !Pv sprintf(hi->mnem, "if !P%d memh (0x%x) = R%d.H", hi->ops[0].op.pred, hi->ops[1].op.imm, hi->ops[2].op.reg); break; } @@ -35862,7 +35862,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { } hi->ops[3].type = HEX_OP_TYPE_REG; hi->ops[3].op.reg = (((hi_u32) & 0x1f00) >> 8); // Rt - hi->predicate = HEX_PRED_FALSE; // if !Pv + hi->predicate = HEX_PRED_FALSE; // if !Pv sprintf(hi->mnem, "if !P%d memw (R%d ++ %d) = R%d", hi->ops[0].op.pred, hi->ops[1].op.reg, (st32) hi->ops[2].op.imm, hi->ops[3].op.reg); break; } @@ -35929,7 +35929,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[1].op.imm = (((hi_u32 & 0x30000) >> 12) | ((hi_u32 & 0x78) >> 3)); hi->ops[2].type = HEX_OP_TYPE_REG; hi->ops[2].op.reg = (((hi_u32) & 0x1f00) >> 8); // Rt - hi->predicate = HEX_PRED_FALSE; // if !Pv + hi->predicate = HEX_PRED_FALSE; // if !Pv hex_op_extend(&hi->ops[1]); sprintf(hi->mnem, "if !P%d memw (0x%x) = R%d", hi->ops[0].op.pred, hi->ops[1].op.imm, hi->ops[2].op.reg); break; @@ -44910,7 +44910,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[2].op.reg = (((hi_u32) & 0x1f0000) >> 16); // Rs hi->ops[3].type = HEX_OP_TYPE_REG; hi->ops[3].op.reg = (((hi_u32) & 0x1f00) >> 8); // Rt - hi->predicate = HEX_PRED_FALSE; // if !Pu + hi->predicate = HEX_PRED_FALSE; // if !Pu sprintf(hi->mnem, "if !P%d R%d = add (R%d, R%d)", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.reg, hi->ops[3].op.reg); break; } @@ -44976,7 +44976,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[2].op.reg = (((hi_u32) & 0x1f0000) >> 16); // Rs hi->ops[3].type = HEX_OP_TYPE_REG; hi->ops[3].op.reg = (((hi_u32) & 0x1f00) >> 8); // Rt - hi->predicate = HEX_PRED_FALSE; // if !Pu + hi->predicate = HEX_PRED_FALSE; // if !Pu sprintf(hi->mnem, "if !P%d R%d:R%d = combine (R%d, R%d)", hi->ops[0].op.pred, hi->ops[1].op.reg + 1, hi->ops[1].op.reg, hi->ops[2].op.reg, hi->ops[3].op.reg); break; } @@ -45042,7 +45042,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[2].op.reg = (((hi_u32) & 0x1f0000) >> 16); // Rs hi->ops[3].type = HEX_OP_TYPE_REG; hi->ops[3].op.reg = (((hi_u32) & 0x1f00) >> 8); // Rt - hi->predicate = HEX_PRED_FALSE; // if !Pu + hi->predicate = HEX_PRED_FALSE; // if !Pu sprintf(hi->mnem, "if !P%d R%d = and (R%d, R%d)", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.reg, hi->ops[3].op.reg); break; } @@ -45106,7 +45106,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[2].op.reg = (((hi_u32) & 0x1f0000) >> 16); // Rs hi->ops[3].type = HEX_OP_TYPE_REG; hi->ops[3].op.reg = (((hi_u32) & 0x1f00) >> 8); // Rt - hi->predicate = HEX_PRED_FALSE; // if !Pu + hi->predicate = HEX_PRED_FALSE; // if !Pu sprintf(hi->mnem, "if !P%d R%d = or (R%d, R%d)", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.reg, hi->ops[3].op.reg); break; } @@ -45170,7 +45170,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[2].op.reg = (((hi_u32) & 0x1f0000) >> 16); // Rs hi->ops[3].type = HEX_OP_TYPE_REG; hi->ops[3].op.reg = (((hi_u32) & 0x1f00) >> 8); // Rt - hi->predicate = HEX_PRED_FALSE; // if !Pu + hi->predicate = HEX_PRED_FALSE; // if !Pu sprintf(hi->mnem, "if !P%d R%d = xor (R%d, R%d)", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.reg, hi->ops[3].op.reg); break; } @@ -45234,7 +45234,7 @@ int hexagon_disasm_instruction(ut32 hi_u32, HexInsn *hi, ut32 addr) { hi->ops[2].op.reg = (((hi_u32) & 0x1f00) >> 8); // Rt hi->ops[3].type = HEX_OP_TYPE_REG; hi->ops[3].op.reg = (((hi_u32) & 0x1f0000) >> 16); // Rs - hi->predicate = HEX_PRED_FALSE; // if !Pu + hi->predicate = HEX_PRED_FALSE; // if !Pu sprintf(hi->mnem, "if !P%d R%d = sub (R%d, R%d)", hi->ops[0].op.pred, hi->ops[1].op.reg, hi->ops[2].op.reg, hi->ops[3].op.reg); break; } diff --git a/libr/asm/arch/i8080/i8080dis.c b/libr/asm/arch/i8080/i8080dis.c index 3cbaf605c4..8328f79e0b 100644 --- a/libr/asm/arch/i8080/i8080dis.c +++ b/libr/asm/arch/i8080/i8080dis.c @@ -13,7 +13,7 @@ // publish, distribute, sublicense, and/or sell copies of the Software, // and to permit persons to whom the Software is furnished to do so, // subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // @@ -127,7 +127,7 @@ static int i8080_disasm(unsigned char const* const code, char* text, int text_sz struct opcode_t const *op; for (op = &opcodes[0]; op->size; ++op) { int const grp = cmd & - ~((op->arg1.mask << op->arg1.shift) | + ~((op->arg1.mask << op->arg1.shift) | (op->arg2.mask << op->arg2.shift)); int const branch = (grp == 0xc0 || grp == 0xc2 || grp == 0xc4); if (grp == op->cmd) { diff --git a/libr/asm/arch/i8080/i8080dis.h b/libr/asm/arch/i8080/i8080dis.h index 57ee97cc55..043daed889 100644 --- a/libr/asm/arch/i8080/i8080dis.h +++ b/libr/asm/arch/i8080/i8080dis.h @@ -13,7 +13,7 @@ // publish, distribute, sublicense, and/or sell copies of the Software, // and to permit persons to whom the Software is furnished to do so, // subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // diff --git a/libr/asm/arch/include/elf/mips.h b/libr/asm/arch/include/elf/mips.h index b3ca1332c7..a95321b620 100644 --- a/libr/asm/arch/include/elf/mips.h +++ b/libr/asm/arch/include/elf/mips.h @@ -1,5 +1,5 @@ /* - Based on commits 250d07de5cf6efc81ed934c25292beb63c7e3129 from master branch + Based on commits 250d07de5cf6efc81ed934c25292beb63c7e3129 from master branch of binutils-gdb. */ /* MIPS ELF support for BFD. diff --git a/libr/asm/arch/include/elf/xtensa.h b/libr/asm/arch/include/elf/xtensa.h index eb05deaa22..0ad6262b3e 100644 --- a/libr/asm/arch/include/elf/xtensa.h +++ b/libr/asm/arch/include/elf/xtensa.h @@ -37,7 +37,7 @@ START_RELOC_NUMBERS (elf_xtensa_reloc_type) RELOC_NUMBER (R_XTENSA_PLT, 6) RELOC_NUMBER (R_XTENSA_OP0, 8) RELOC_NUMBER (R_XTENSA_OP1, 9) - RELOC_NUMBER (R_XTENSA_OP2, 10) + RELOC_NUMBER (R_XTENSA_OP2, 10) RELOC_NUMBER (R_XTENSA_ASM_EXPAND, 11) RELOC_NUMBER (R_XTENSA_ASM_SIMPLIFY, 12) RELOC_NUMBER (R_XTENSA_32_PCREL, 14) @@ -137,7 +137,7 @@ typedef struct property_table_entry_t block is specified in the current block and the size of the current block does not include any fill required to align to the next block. */ - + #define XTENSA_PROP_LITERAL 0x00000001 #define XTENSA_PROP_INSN 0x00000002 #define XTENSA_PROP_DATA 0x00000004 @@ -148,7 +148,7 @@ typedef struct property_table_entry_t /* Instruction-only properties about code. */ #define XTENSA_PROP_INSN_NO_DENSITY 0x00000040 #define XTENSA_PROP_INSN_NO_REORDER 0x00000080 -/* Historically, NO_TRANSFORM was a property of instructions, +/* Historically, NO_TRANSFORM was a property of instructions, but it should apply to literals under certain circumstances. */ #define XTENSA_PROP_NO_TRANSFORM 0x00000100 diff --git a/libr/asm/arch/include/libiberty.h b/libr/asm/arch/include/libiberty.h index 17d63a0bff..af3d1260d7 100644 --- a/libr/asm/arch/include/libiberty.h +++ b/libr/asm/arch/include/libiberty.h @@ -1,7 +1,7 @@ /* Function declarations for libiberty. Copyright 2001, 2002, 2005 Free Software Foundation, Inc. - + Note - certain prototypes declared in this header file are for functions whoes implementation copyright does not belong to the FSF. Those prototypes are present in this file for reference @@ -23,7 +23,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. - + Written by Cygnus Support, 1994. The libiberty library provides a number of functions which are @@ -184,7 +184,7 @@ extern char * getpwd (void); #ifdef __MINGW32__ /* Forward declaration to avoid #include . */ struct timeval; -extern int gettimeofday (struct timeval *, void *); +extern int gettimeofday (struct timeval *, void *); #endif /* Get the amount of time the process has run, in microseconds. */ diff --git a/libr/asm/arch/include/mybfd.h b/libr/asm/arch/include/mybfd.h index 2175e7e4da..9acfdfb0f4 100644 --- a/libr/asm/arch/include/mybfd.h +++ b/libr/asm/arch/include/mybfd.h @@ -1,5 +1,5 @@ /* - Based on commits 250d07de5cf6efc81ed934c25292beb63c7e3129 from master branch + Based on commits 250d07de5cf6efc81ed934c25292beb63c7e3129 from master branch of binutils-gdb. This file contains some manual modifications as additon of original generated file. */ diff --git a/libr/asm/arch/include/opcode/cris.h b/libr/asm/arch/include/opcode/cris.h index 00ddde010f..76fbc2f3ca 100644 --- a/libr/asm/arch/include/opcode/cris.h +++ b/libr/asm/arch/include/opcode/cris.h @@ -340,7 +340,7 @@ extern const struct cris_opcode cris_opcodes[]; #define CRIS_DIS_FLAG_MEM_TARGET2_MULT2 (1 << 3) /* Yet another add-on: the register in "target2" must be multiplied - by 4 (mutually exclusive with .._MULT2). */ + by 4 (mutually exclusive with .._MULT2). */ #define CRIS_DIS_FLAG_MEM_TARGET2_MULT4 (1 << 4) /* The register in "target2" is an indirect memory reference (of the diff --git a/libr/asm/arch/include/opcode/hppa.h b/libr/asm/arch/include/opcode/hppa.h index 2372a85a5d..9b51dec98d 100644 --- a/libr/asm/arch/include/opcode/hppa.h +++ b/libr/asm/arch/include/opcode/hppa.h @@ -33,7 +33,7 @@ * controled by the nullification bit, and conditional, which depends * on the direction of the branch and its success or failure. * - * NONE is unfortunately #defined in the hiux system include files. + * NONE is unfortunately #defined in the hiux system include files. * #undef it away. */ #undef NONE @@ -257,7 +257,7 @@ Floating point registers all have 'f' as a prefix: fC operand 3 register with L/R halves at 16:18,21:23 fe Like fT, but encoding is different. fE Same as fe, except prints a space before register during disasm. - fx target register at 15 (only for PA 2.0 long format FLDD/FSTD). + fx target register at 15 (only for PA 2.0 long format FLDD/FSTD). Float registers for fmpyadd and fmpysub: @@ -592,11 +592,11 @@ static const struct pa_opcode pa_opcodes[] = { "addbf", 0xa8000000, 0xfc000000, "?dnx,b,w", pa10, 0}, { "addibt", 0xa4000000, 0xfc000000, "?dn5,b,w", pa10, 0}, { "addibf", 0xac000000, 0xfc000000, "?dn5,b,w", pa10, 0}, -{ "bb", 0xc0006000, 0xffe06000, "?Bnx,!,w", pa20, FLAG_STRICT}, -{ "bb", 0xc0004000, 0xffe06000, "?bnx,!,w", pa10, FLAG_STRICT}, -{ "bb", 0xc4004000, 0xfc004000, "?Bnx,B,w", pa20, FLAG_STRICT}, -{ "bb", 0xc4004000, 0xfc006000, "?bnx,Q,w", pa10, FLAG_STRICT}, -{ "bb", 0xc4004000, 0xfc006000, "?bnx,Q,w", pa10, 0}, +{ "bb", 0xc0006000, 0xffe06000, "?Bnx,!,w", pa20, FLAG_STRICT}, +{ "bb", 0xc0004000, 0xffe06000, "?bnx,!,w", pa10, FLAG_STRICT}, +{ "bb", 0xc4004000, 0xfc004000, "?Bnx,B,w", pa20, FLAG_STRICT}, +{ "bb", 0xc4004000, 0xfc006000, "?bnx,Q,w", pa10, FLAG_STRICT}, +{ "bb", 0xc4004000, 0xfc006000, "?bnx,Q,w", pa10, 0}, { "bvb", 0xc0004000, 0xffe04000, "?bnx,w", pa10, 0}, { "clrbts", 0xe8004005, 0xffffffff, "", pa20, FLAG_STRICT}, { "popbts", 0xe8004005, 0xfffff007, "$", pa20, FLAG_STRICT}, @@ -810,7 +810,7 @@ static const struct pa_opcode pa_opcodes[] = { "gfr", 0x04001a80, 0xfc003fdf, "cZx(s,b)", pa11, 0}, /* Floating Point Coprocessor Instructions. */ - + { "fldw", 0x24000000, 0xfc00df80, "cXx(b),fT", pa10, FLAG_STRICT}, { "fldw", 0x24000000, 0xfc001f80, "cXx(s,b),fT", pa10, FLAG_STRICT}, { "fldw", 0x24000000, 0xfc00d380, "cxccx(b),fT", pa11, FLAG_STRICT}, diff --git a/libr/asm/arch/include/opcode/lanai.h b/libr/asm/arch/include/opcode/lanai.h index db17ef85f3..092a596f82 100644 --- a/libr/asm/arch/include/opcode/lanai.h +++ b/libr/asm/arch/include/opcode/lanai.h @@ -34,7 +34,7 @@ * Arcadia, CA 91024 * *************************************************************************/ /* initial version released 5/95 */ - /* This file is based upon sparc.h from the Gnu binutils-2.5.2 + /* This file is based upon sparc.h from the Gnu binutils-2.5.2 release, which had the following copyright notice: */ /* Definitions for opcode table for the sparc. @@ -56,7 +56,7 @@ You should have received a copy of the GNU General Public License along with GAS or GDB; see the file COPYING. If not, write to - the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, + the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ /* The Lanai opcode table (and other related data) is defined in @@ -144,7 +144,7 @@ Kinds of operands: d Rd register. 4 Op1 (for RRR) - 5 Op2 (for RRR) + 5 Op2 (for RRR) 6 Op2 (for RRM) J 0x????0000 diff --git a/libr/asm/arch/include/opcode/mips.h b/libr/asm/arch/include/opcode/mips.h index 26dd6cc420..0eeec050e2 100644 --- a/libr/asm/arch/include/opcode/mips.h +++ b/libr/asm/arch/include/opcode/mips.h @@ -1,5 +1,5 @@ /* - Based on commits 250d07de5cf6efc81ed934c25292beb63c7e3129 from master branch + Based on commits 250d07de5cf6efc81ed934c25292beb63c7e3129 from master branch of binutils-gdb. */ /* mips.h. Mips opcode list for GDB, the GNU debugger. @@ -1159,7 +1159,7 @@ mips_opcode_32bit_p (const struct mips_opcode *mo) #define INSN_ISA32R3 8 #define INSN_ISA32R5 9 #define INSN_ISA32R6 10 -#define INSN_ISA64 11 +#define INSN_ISA64 11 #define INSN_ISA64R2 12 #define INSN_ISA64R3 13 #define INSN_ISA64R5 14 diff --git a/libr/asm/arch/include/opcode/nios2.h b/libr/asm/arch/include/opcode/nios2.h index e9694444d7..7a3248e6c0 100644 --- a/libr/asm/arch/include/opcode/nios2.h +++ b/libr/asm/arch/include/opcode/nios2.h @@ -44,7 +44,7 @@ enum overflow_type no_overflow }; -/* This structure holds information for a particular instruction. +/* This structure holds information for a particular instruction. The args field is a string describing the operands. The following letters can appear in the args: @@ -78,24 +78,24 @@ enum overflow_type struct nios2_opcode { const char *name; /* The name of the instruction. */ - const char *args; /* A string describing the arguments for this + const char *args; /* A string describing the arguments for this instruction. */ - const char *args_test; /* Like args, but with an extra argument for + const char *args_test; /* Like args, but with an extra argument for the expected opcode. */ - unsigned long num_args; /* The number of arguments the instruction + unsigned long num_args; /* The number of arguments the instruction takes. */ unsigned long match; /* The basic opcode for the instruction. */ - unsigned long mask; /* Mask for the opcode field of the + unsigned long mask; /* Mask for the opcode field of the instruction. */ - unsigned long pinfo; /* Is this a real instruction or instruction + unsigned long pinfo; /* Is this a real instruction or instruction macro? */ - enum overflow_type overflow_msg; /* Used to generate informative + enum overflow_type overflow_msg; /* Used to generate informative message when fixup overflows. */ }; -/* This value is used in the nios2_opcode.pinfo field to indicate that the - instruction is a macro or pseudo-op. This requires special treatment by - the assembler, and is used by the disassembler to determine whether to +/* This value is used in the nios2_opcode.pinfo field to indicate that the + instruction is a macro or pseudo-op. This requires special treatment by + the assembler, and is used by the disassembler to determine whether to check for a nop. */ #define NIOS2_INSN_MACRO 0x80000000 #define NIOS2_INSN_MACRO_MOV 0x80000001 diff --git a/libr/asm/arch/include/opintl.h b/libr/asm/arch/include/opintl.h index 5a08b31c1f..50f11798e8 100644 --- a/libr/asm/arch/include/opintl.h +++ b/libr/asm/arch/include/opintl.h @@ -23,7 +23,7 @@ #ifdef ENABLE_NLS # include /* Note the use of dgetext() and PACKAGE here, rather than gettext(). - + This is because the code in this directory is used to build a library which will be linked with code in other directories to form programs. We want to maintain a separate translation file for this directory however, rather diff --git a/libr/asm/arch/include/symcat.h b/libr/asm/arch/include/symcat.h index 03a1292104..7cd0aef469 100644 --- a/libr/asm/arch/include/symcat.h +++ b/libr/asm/arch/include/symcat.h @@ -11,7 +11,7 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ @@ -44,6 +44,6 @@ bar", "XSTRING(foo)", to yield "bar". Be aware that this only works for __STDC__, not for traditional C which will still resolve to "foo". */ -#define XSTRING(s) STRINGX(s) +#define XSTRING(s) STRINGX(s) #endif /* SYM_CAT_H */ diff --git a/libr/asm/arch/include/wine-arm.h b/libr/asm/arch/include/wine-arm.h index d2b4f0f975..bce431e6cc 100644 --- a/libr/asm/arch/include/wine-arm.h +++ b/libr/asm/arch/include/wine-arm.h @@ -120,7 +120,7 @@ #define ARM_DTX_LOAD (0x01<<20) #define ARM_DTX_STORE 0x00 -// mascara registre desti +// mascara registre desti #define ARM_DTX_RD_MASK ( 0x0F << 12 ) diff --git a/libr/asm/arch/include/xtensa-isa.h b/libr/asm/arch/include/xtensa-isa.h index aaca29e076..b8371f3055 100644 --- a/libr/asm/arch/include/xtensa-isa.h +++ b/libr/asm/arch/include/xtensa-isa.h @@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef XTENSA_LIBISA_H @@ -184,7 +184,7 @@ typedef xtensa_insnbuf_word *xtensa_insnbuf; /* Get the size in "insnbuf_words" of the xtensa_insnbuf array. */ extern int -xtensa_insnbuf_size (xtensa_isa isa); +xtensa_insnbuf_size (xtensa_isa isa); /* Allocate an xtensa_insnbuf of the right size. */ @@ -240,7 +240,7 @@ xtensa_isa_free (xtensa_isa isa); /* Get the maximum instruction size in bytes. */ extern int -xtensa_isa_maxlength (xtensa_isa isa); +xtensa_isa_maxlength (xtensa_isa isa); /* Decode the length in bytes of an instruction in raw memory (not an @@ -260,7 +260,7 @@ xtensa_isa_length_from_chars (xtensa_isa isa, const unsigned char *cp); stages before stage 0. Returns XTENSA_UNDEFINED on error. */ extern int -xtensa_isa_num_pipe_stages (xtensa_isa isa); +xtensa_isa_num_pipe_stages (xtensa_isa isa); /* Get the number of various entities that are defined for this processor. */ @@ -537,7 +537,7 @@ xtensa_operand_regfile (xtensa_isa isa, xtensa_opcode opc, int opnd); extern int xtensa_operand_num_regs (xtensa_isa isa, xtensa_opcode opc, int opnd); - + /* Some register operands do not completely identify the register being accessed. For example, the operand value may be added to an internal @@ -554,7 +554,7 @@ xtensa_operand_is_known_reg (xtensa_isa isa, xtensa_opcode opc, int opnd); /* Check if an immediate operand is PC-relative. Returns 0 for register operands and non-PC-relative immediates, 1 for PC-relative immediates, and XTENSA_UNDEFINED on error. */ - + extern int xtensa_operand_is_PCrelative (xtensa_isa isa, xtensa_opcode opc, int opnd); diff --git a/libr/asm/arch/lanai/gnu/lanai-dis.c b/libr/asm/arch/lanai/gnu/lanai-dis.c index 8345ef9529..36075872ab 100644 --- a/libr/asm/arch/lanai/gnu/lanai-dis.c +++ b/libr/asm/arch/lanai/gnu/lanai-dis.c @@ -34,7 +34,7 @@ * Arcadia, CA 91024 * *************************************************************************/ /* initial version released 5/95 */ - /* This file is based upon <> from the Gnu binutils-2.5.2 + /* This file is based upon <> from the Gnu binutils-2.5.2 release, which had the following copyright notice: */ /* Print SPARC instructions. @@ -69,7 +69,7 @@ static char *reg_names[] = "r24","r25","r26","r27","r28","r29","r30","r31", }; -static char *op_names[] = +static char *op_names[] = { "add", "addc", "sub", "subb", "and", "or", "xor", "sh" }; /* Nonzero if INSN is the opcode for a delayed branch. */ @@ -147,7 +147,7 @@ print_insn_lanai (memaddr, info) the effect of adding or or'ing the imm13 field to rs1. */ int imm_added_to_rs1 = 0; - /* Do we have an `add' or `or' immediate instruction where rs1 is + /* Do we have an `add' or `or' immediate instruction where rs1 is the same as rd? */ if (((!(opcode->match & 0x80000000) /* RI insn */ @@ -356,13 +356,13 @@ print_insn_lanai (memaddr, info) && X_RD (prev_insn) ) { (*info->fprintf_func) (stream, "\t! "); - info->target + info->target = X_C16( insn) << (L3_RI_H& insn ? 16 : 0); if((prev_insn & 0xf07c0000) == 0x50000000 ){ - info->target + info->target |= X_C16(prev_insn) << (L3_RI_H&prev_insn ? 16 : 0); }else{ - info->target + info->target += X_C16(prev_insn) << (L3_RI_H&prev_insn ? 16 : 0); } (*info->print_address_func) (info->target, info); @@ -479,7 +479,7 @@ compare_opcodes (a, b) op0->name, op1->name); } } - + /* Fewer arguments are preferred. */ { int length_diff = strlen (op0->args) - strlen (op1->args); diff --git a/libr/asm/arch/lanai/gnu/lanai-opc.c b/libr/asm/arch/lanai/gnu/lanai-opc.c index ba7a3bab49..d54e738792 100644 --- a/libr/asm/arch/lanai/gnu/lanai-opc.c +++ b/libr/asm/arch/lanai/gnu/lanai-opc.c @@ -34,7 +34,7 @@ * Arcadia, CA 91024 * *************************************************************************/ /* initial version released 5/95 */ - /* This file is based upon <> from the Gnu binutils-2.5.2 + /* This file is based upon <> from the Gnu binutils-2.5.2 release, which had the following copyright notice: */ /* Table of opcodes for the sparc. @@ -54,7 +54,7 @@ You should have received a copy of the GNU General Public License along with this software; see the file COPYING. If not, write to - the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, + the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ /* FIXME-someday: perhaps the ,a's and such should be embedded in the @@ -76,7 +76,7 @@ const char *architecture_pname[] = { /* A pair is the set of all bits that must be high or low as determined solely by the opcode. This macro takes a mask and the set of - all bits that must be high and generates the pair. I do this + all bits that must be high and generates the pair. I do this so the macro definitions below are simpler. */ #define GENERIC_PAIR(mask,high) \ @@ -353,7 +353,7 @@ struct lanai_opcode lanai_opcodes[] = { { "ld", RM_PAIR(0,1,0) ,"o[1],d", F_RM,0}, { "ld", RM_PAIR(0,1,1) ,"o[*1],d", F_RM,0}, { "ld", RM_PAIR(0,0,1) ,"o[1*],d", F_RM,0}, - + { "uld", 0x80030004,0x7000fffb ,"[++1],d", F_ALIAS,0}, { "uld", 0x80010004,0x7002fffb ,"[1++],d", F_ALIAS,0}, { "uld", 0x8003fffc,0x70000003 ,"[--1],d", F_ALIAS,0}, @@ -370,7 +370,7 @@ struct lanai_opcode lanai_opcodes[] = { { "uld", RM_PAIR(0,1,0) ,"o[1],d", F_ALIAS,0}, { "uld", RM_PAIR(0,1,1) ,"o[*1],d", F_ALIAS,0}, { "uld", RM_PAIR(0,0,1) ,"o[1*],d", F_ALIAS,0}, - + { "ld.h", 0xf0030c02,0x0000f3fd ,"[++1],d", F_HALF|F_SPLS,0}, { "ld.h", 0xf0030402,0x0000fbfd ,"[1++],d", F_HALF|F_SPLS,0}, { "ld.h", 0xf0030ffe,0x0000f001 ,"[--1],d", F_HALF|F_SPLS,0}, @@ -386,7 +386,7 @@ struct lanai_opcode lanai_opcodes[] = { { "ld.h", SPLS_PAIR(0,L3_SIGNED_HALFWORD,1,0) ,"i[1],d", F_HALF|F_SPLS,0}, { "ld.h", SPLS_PAIR(0,L3_SIGNED_HALFWORD,1,1) ,"i[*1],d", F_HALF|F_SPLS,0}, { "ld.h", SPLS_PAIR(0,L3_SIGNED_HALFWORD,0,1) ,"i[1*],d", F_HALF|F_SPLS,0}, - + { "uld.h", 0xf0031c02,0x0000e3fd ,"[++1],d", F_HALF|F_SPLS,0}, { "uld.h", 0xf0031402,0x0000ebfd ,"[1++],d", F_HALF|F_SPLS,0}, { "uld.h", 0xf0031ffe,0x0000e001 ,"[--1],d", F_HALF|F_SPLS,0}, @@ -402,7 +402,7 @@ struct lanai_opcode lanai_opcodes[] = { { "uld.h",SPLS_PAIR(0,L3_UNSIGNED_HALFWORD,1,0),"i[1],d", F_HALF|F_SPLS,0}, { "uld.h",SPLS_PAIR(0,L3_UNSIGNED_HALFWORD,1,1),"i[*1],d", F_HALF|F_SPLS,0}, { "uld.h",SPLS_PAIR(0,L3_UNSIGNED_HALFWORD,0,1),"i[1*],d", F_HALF|F_SPLS,0}, - + { "ld.b", 0xf0034c01,0x0000b3fe ,"[++1],d", F_BYTE|F_SPLS,0}, { "ld.b", 0xf0034401,0x0000bbfe ,"[1++],d", F_BYTE|F_SPLS,0}, { "ld.b", 0xf0034fff,0x0000b000 ,"[--1],d", F_BYTE|F_SPLS,0}, @@ -418,7 +418,7 @@ struct lanai_opcode lanai_opcodes[] = { { "ld.b", SPLS_PAIR(0,L3_SIGNED_BYTE,1,0) ,"i[1],d", F_BYTE|F_SPLS,0}, { "ld.b", SPLS_PAIR(0,L3_SIGNED_BYTE,1,1) ,"i[*1],d", F_BYTE|F_SPLS,0}, { "ld.b", SPLS_PAIR(0,L3_SIGNED_BYTE,0,1) ,"i[1*],d", F_BYTE|F_SPLS,0}, - + { "uld.b", 0xf0035c01,0x0000a3fe ,"[++1],d", F_BYTE|F_SPLS,0}, { "uld.b", 0xf0035401,0x0000abfe ,"[1++],d", F_BYTE|F_SPLS,0}, { "uld.b", 0xf0035fff,0x0000a000 ,"[--1],d", F_BYTE|F_SPLS,0}, @@ -439,7 +439,7 @@ struct lanai_opcode lanai_opcodes[] = { { "leadz", LEADZ_PAIR(0) ,"1,d", F_LEADZ,0}, { "leadz.f", LEADZ_PAIR(1) ,"1,d", F_LEADZ,0}, - + /* or */ { "or", RR_PAIR(0,L3_OR) ,"1,2,d", F_RR,0}, @@ -449,8 +449,8 @@ struct lanai_opcode lanai_opcodes[] = { { "or.f", RI_PAIR(L3_OR,1,0) ,"1,j,d", F_RI,0}, { "or.f", RI_PAIR(L3_OR,1,1) ,"1,J,d", F_RI,0}, - /* popc */ - + /* popc */ + { "popc", POPC_PAIR(0) ,"1,d", F_POPC,0}, { "popc.f", POPC_PAIR(1) ,"1,d", F_POPC,0}, @@ -491,7 +491,7 @@ struct lanai_opcode lanai_opcodes[] = { { "st", RM_PAIR(1,1,0) ,"d,o[1]", F_RM,0}, { "st", RM_PAIR(1,1,1) ,"d,o[*1]", F_RM,0}, { "st", RM_PAIR(1,0,1) ,"d,o[1*]", F_RM,0}, - + { "st.h", 0xf0032c02,0x0000d3fd ,"d,[++1]", F_HALF|F_SPLS,0}, { "st.h", 0xf0032402,0x0000dbfd ,"d,[1++]", F_HALF|F_SPLS,0}, { "st.h", 0xf0032ffe,0x0000d001 ,"d,[--1]", F_HALF|F_SPLS,0}, @@ -507,7 +507,7 @@ struct lanai_opcode lanai_opcodes[] = { { "st.h", SPLS_PAIR(1,L3_SIGNED_HALFWORD,1,0) ,"d,i[1]", F_HALF|F_SPLS,0}, { "st.h", SPLS_PAIR(1,L3_SIGNED_HALFWORD,1,1) ,"d,i[*1]", F_HALF|F_SPLS,0}, { "st.h", SPLS_PAIR(1,L3_SIGNED_HALFWORD,0,1) ,"d,i[1*]", F_HALF|F_SPLS,0}, - + { "st.b", 0xf0036c01,0x000093fe ,"d,[++1]", F_BYTE|F_SPLS,0}, { "st.b", 0xf0036401,0x00009bfe ,"d,[1++]", F_BYTE|F_SPLS,0}, { "st.b", 0xf0036fff,0x00009000 ,"d,[--1]", F_BYTE|F_SPLS,0}, diff --git a/libr/asm/arch/mips/gnu/micromips-opc.c b/libr/asm/arch/mips/gnu/micromips-opc.c index c2a01666b2..5f10b4c640 100644 --- a/libr/asm/arch/mips/gnu/micromips-opc.c +++ b/libr/asm/arch/mips/gnu/micromips-opc.c @@ -1,5 +1,5 @@ /* - Based on commits 250d07de5cf6efc81ed934c25292beb63c7e3129 from master branch + Based on commits 250d07de5cf6efc81ed934c25292beb63c7e3129 from master branch of binutils-gdb. */ /* micromips-opc.c. microMIPS opcode table. diff --git a/libr/asm/arch/mips/gnu/mips-dis.c b/libr/asm/arch/mips/gnu/mips-dis.c index 6f722d6c3b..e012601c7e 100644 --- a/libr/asm/arch/mips/gnu/mips-dis.c +++ b/libr/asm/arch/mips/gnu/mips-dis.c @@ -1,5 +1,5 @@ /* - Based on commits 250d07de5cf6efc81ed934c25292beb63c7e3129 from master branch + Based on commits 250d07de5cf6efc81ed934c25292beb63c7e3129 from master branch of binutils-gdb. */ /* Default disassembler options are modified to match radare2 config. */ @@ -983,7 +983,7 @@ parse_mips_ase_option (const char *option) mips_ase |= ASE_LOONGSON_CAM; return TRUE; } - + /* Put here for match ext2 frist */ if (CONST_STRNEQ (option, "loongson-ext2")) { diff --git a/libr/asm/arch/mips/gnu/mips-formats.h b/libr/asm/arch/mips/gnu/mips-formats.h index 6bc88824e6..96fd32ba0d 100755 --- a/libr/asm/arch/mips/gnu/mips-formats.h +++ b/libr/asm/arch/mips/gnu/mips-formats.h @@ -1,6 +1,6 @@ -/* Modified version of mips-formats.h. Some assetions are removed. */ +/* Modified version of mips-formats.h. Some assetions are removed. */ /* - Based on commits 250d07de5cf6efc81ed934c25292beb63c7e3129 from master branch + Based on commits 250d07de5cf6efc81ed934c25292beb63c7e3129 from master branch of binutils-gdb. */ /* mips-formats.h diff --git a/libr/asm/arch/mips/gnu/mips-opc.c b/libr/asm/arch/mips/gnu/mips-opc.c index 6b48f0e737..da5f813766 100644 --- a/libr/asm/arch/mips/gnu/mips-opc.c +++ b/libr/asm/arch/mips/gnu/mips-opc.c @@ -1,5 +1,5 @@ /* - Based on commits 250d07de5cf6efc81ed934c25292beb63c7e3129 from master branch + Based on commits 250d07de5cf6efc81ed934c25292beb63c7e3129 from master branch of binutils-gdb. */ /* mips-opc.c -- MIPS opcode list. diff --git a/libr/asm/arch/mips/gnu/mips16-opc.c b/libr/asm/arch/mips/gnu/mips16-opc.c index 43d4cf8261..12a39dd18c 100644 --- a/libr/asm/arch/mips/gnu/mips16-opc.c +++ b/libr/asm/arch/mips/gnu/mips16-opc.c @@ -1,5 +1,5 @@ /* - Based on commits 250d07de5cf6efc81ed934c25292beb63c7e3129 from master branch + Based on commits 250d07de5cf6efc81ed934c25292beb63c7e3129 from master branch of binutils-gdb. */ /* mips16-opc.c. Mips16 opcode table. diff --git a/libr/asm/arch/msp430/msp430_disas.c b/libr/asm/arch/msp430/msp430_disas.c index 2e13217d7b..f060dea47b 100644 --- a/libr/asm/arch/msp430/msp430_disas.c +++ b/libr/asm/arch/msp430/msp430_disas.c @@ -167,7 +167,7 @@ static int decode_emulation(ut16 instr, struct msp430_cmd *cmd) } else if (opcode == MSP430_ADD && as == 2 && src == MSP430_R3) { snprintf(cmd->instr, sizeof (cmd->instr), "%s", bw ? "incd.b" : "incd"); remove_first_operand(cmd); - } else if (opcode == MSP430_XOR && as == 3 && src == MSP430_R3) { + } else if (opcode == MSP430_XOR && as == 3 && src == MSP430_R3) { snprintf(cmd->instr, sizeof (cmd->instr), "%s", bw ? "inv.b" : "inv"); remove_first_operand(cmd); } else if (opcode == MSP430_ADD && src == dst) { @@ -279,7 +279,7 @@ static int decode_addressing_mode(ut16 instr, ut16 op1, ut16 op2, struct msp430_ /* addressing mode of destination operand */ switch (ad) { case 0: /* register mode */ - snprintf(dstbuf, sizeof (dstbuf), ", %s", msp430_register_names[dst]); + snprintf(dstbuf, sizeof (dstbuf), ", %s", msp430_register_names[dst]); break; case 1: /* check addr. mode of source operand */ diff --git a/libr/asm/arch/nios/gnu/nios2-dis.c b/libr/asm/arch/nios/gnu/nios2-dis.c index 7bc597fd19..af1112aa96 100644 --- a/libr/asm/arch/nios/gnu/nios2-dis.c +++ b/libr/asm/arch/nios/gnu/nios2-dis.c @@ -160,7 +160,7 @@ static struct nios2_reg * nios2_coprocessor_regs (void) { static struct nios2_reg *cached = NULL; - + if (!cached) { int i; @@ -180,7 +180,7 @@ static struct nios2_reg * nios2_control_regs (void) { static struct nios2_reg *cached = NULL; - + if (!cached) { int i; diff --git a/libr/asm/arch/ppc/gnu/ppc-opc.c b/libr/asm/arch/ppc/gnu/ppc-opc.c index 45cfa3be52..e2794955ab 100644 --- a/libr/asm/arch/ppc/gnu/ppc-opc.c +++ b/libr/asm/arch/ppc/gnu/ppc-opc.c @@ -590,12 +590,12 @@ const struct powerpc_operand powerpc_operands[] = #define FCRT_MASK (0x1f << 21) { 0x1f, 21, 0, 0, PPC_OPERAND_FCR }, - /* Xilinx FSL related masks and macros */ + /* Xilinx FSL related masks and macros */ #define FSL (FCRT + 1) #define FSL_MASK (0x1f << 11) - { 0x1f, 11, 0, 0, PPC_OPERAND_FSL }, + { 0x1f, 11, 0, 0, PPC_OPERAND_FSL }, - /* Xilinx UDI related masks and macros */ + /* Xilinx UDI related masks and macros */ #define URT (FSL + 1) { 0x1f, 21, 0, 0, PPC_OPERAND_UDI }, @@ -2349,7 +2349,7 @@ const struct powerpc_opcode powerpc_opcodes[] = { {"vandc", VX (4,1092), VX_MASK, PPCVEC, {VD, VA, VB}}, {"vcmpequh.", VXR(4, 70,1), VXR_MASK, PPCVEC, {VD, VA, VB}}, {"udi1fcm.", APU(4, 547,0), APU_MASK, PPC405|PPC440, {URT, URA, URB}}, -{"udi1fcm", APU(4, 547,1), APU_MASK, PPC405|PPC440, {URT, URA, URB}}, +{"udi1fcm", APU(4, 547,1), APU_MASK, PPC405|PPC440, {URT, URA, URB}}, {"evmwhssf", VX (4,1095), VX_MASK, PPCSPE, {RS, RA, RB}}, {"evmwlumi", VX (4,1096), VX_MASK, PPCSPE, {RS, RA, RB}}, {"vminfp", VX (4,1098), VX_MASK, PPCVEC, {VD, VA, VB}}, @@ -2381,7 +2381,7 @@ const struct powerpc_opcode powerpc_opcodes[] = { {"vor", VX (4,1156), VX_MASK, PPCVEC, {VD, VA, VB}}, {"vcmpequw.", VXR(4, 134,1), VXR_MASK, PPCVEC, {VD, VA, VB}}, {"udi2fcm.", APU(4, 579,0), APU_MASK, PPC405|PPC440, {URT, URA, URB}}, -{"udi2fcm", APU(4, 579,1), APU_MASK, PPC405|PPC440, {URT, URA, URB}}, +{"udi2fcm", APU(4, 579,1), APU_MASK, PPC405|PPC440, {URT, URA, URB}}, {"machhwsuo", XO (4, 76,1,0),XO_MASK, PPC405|PPC440, {RT, RA, RB}}, {"machhwsuo.", XO (4, 76,1,1),XO_MASK, PPC405|PPC440, {RT, RA, RB}}, {"ps_merge10", XOPS(4,592,0), XOPS_MASK, PPCPS, {FRT, FRA, FRB}}, @@ -2395,7 +2395,7 @@ const struct powerpc_opcode powerpc_opcodes[] = { {"evdivws", VX (4,1222), VX_MASK, PPCSPE, {RS, RA, RB}}, {"vcmpeqfp.", VXR(4, 198,1), VXR_MASK, PPCVEC, {VD, VA, VB}}, {"udi3fcm.", APU(4, 611,0), APU_MASK, PPC405|PPC440, {URT, URA, URB}}, -{"udi3fcm", APU(4, 611,1), APU_MASK, PPC405|PPC440, {URT, URA, URB}}, +{"udi3fcm", APU(4, 611,1), APU_MASK, PPC405|PPC440, {URT, URA, URB}}, {"evdivwu", VX (4,1223), VX_MASK, PPCSPE, {RS, RA, RB}}, {"evaddumiaaw", VX (4,1224), VX_MASK, PPCSPE, {RS, RA}}, {"evaddsmiaaw", VX (4,1225), VX_MASK, PPCSPE, {RS, RA}}, @@ -4898,8 +4898,8 @@ const struct powerpc_opcode powerpc_opcodes[] = { {"dctfix", XRC(59,290,0), X_MASK, POWER6, {FRT, FRB}}, {"dctfix.", XRC(59,290,1), X_MASK, POWER6, {FRT, FRB}}, -{"ddedpd", XRC(59,322,0), X_MASK, POWER6, {SP, FRT, FRB}}, -{"ddedpd.", XRC(59,322,1), X_MASK, POWER6, {SP, FRT, FRB}}, +{"ddedpd", XRC(59,322,0), X_MASK, POWER6, {SP, FRT, FRB}}, +{"ddedpd.", XRC(59,322,1), X_MASK, POWER6, {SP, FRT, FRB}}, {"dxex", XRC(59,354,0), X_MASK, POWER6, {FRT, FRB}}, {"dxex.", XRC(59,354,1), X_MASK, POWER6, {FRT, FRB}}, diff --git a/libr/asm/arch/ppc/libps/libps.c b/libr/asm/arch/ppc/libps/libps.c index 0e366ab1dd..5dea4321cd 100644 --- a/libr/asm/arch/ppc/libps/libps.c +++ b/libr/asm/arch/ppc/libps/libps.c @@ -31,7 +31,7 @@ ps_opcode_t ps_opcodes_array[] = { { psq_st, "psq_st", OP (60), OP_MASK, { OP_FS, OP_DRA, OP_WB, OP_IB}, "Paired Single Quantized Store"}, { psq_stu, "psq_stu", OP (61), OP_MASK, { OP_FS, OP_DRA, OP_WB, OP_IB}, "Paired Single Quantized Store with update"}, - { ps_div, "ps_div", OPSC (4, 18, 0), OPS_MASK, { OP_FD, OP_FA, OP_FB}, "Paired Single Divide"}, + { ps_div, "ps_div", OPSC (4, 18, 0), OPS_MASK, { OP_FD, OP_FA, OP_FB}, "Paired Single Divide"}, { ps_div_dot, "ps_div.", OPSC (4, 18, 1), OPS_MASK_DOT, { OP_FD, OP_FA, OP_FB}, "Paired Single Divide"}, { ps_sub, "ps_sub", OPSC (4, 20, 0), OPS_MASK, { OP_FD, OP_FA, OP_FB}, "Paired Single Subtract"}, { ps_sub_dot, "ps_sub.", OPSC (4, 20, 1), OPS_MASK_DOT, { OP_FD, OP_FA, OP_FB}, "Paired Single Subtract"}, diff --git a/libr/asm/arch/ppc/libvle/vle.c b/libr/asm/arch/ppc/libvle/vle.c index 9b0a7541ce..041cbf0f15 100644 --- a/libr/asm/arch/ppc/libvle/vle.c +++ b/libr/asm/arch/ppc/libvle/vle.c @@ -250,7 +250,7 @@ const e_vle_t e_ops[] = { { "e_and2is." , 0x7000E800, 0x7000E800 | E_MASK_I16L, E_I16LS , R_ANAL_OP_TYPE_AND, R_ANAL_COND_AL, {TYPE_REG, TYPE_IMM, TYPE_IMM, TYPE_NONE, TYPE_NONE}}, { "e_andi" , 0x1800C000, 0x1800C000 | E_MASK_SCI8, E_SCI8I , R_ANAL_OP_TYPE_AND, R_ANAL_COND_AL, {TYPE_REG, TYPE_REG, TYPE_IMM, TYPE_IMM, TYPE_IMM}}, { "e_andi." , 0x1800C800, 0x1800C800 | E_MASK_SCI8, E_SCI8I , R_ANAL_OP_TYPE_AND, R_ANAL_COND_AL, {TYPE_REG, TYPE_REG, TYPE_IMM, TYPE_IMM, TYPE_IMM}}, - // has cr0-cr3 + // has cr0-cr3 { "e_beq" , 0x7A000000, 0x7A120000 | E_MASK_BD15, E_BD15 , R_ANAL_OP_TYPE_CJMP, R_ANAL_COND_EQ, {TYPE_CR, TYPE_JMP, TYPE_NONE, TYPE_NONE, TYPE_NONE}}, { "e_bge" , 0x7A000000, 0x7A000000 | E_MASK_BD15, E_BD15 , R_ANAL_OP_TYPE_CJMP, R_ANAL_COND_GE, {TYPE_CR, TYPE_JMP, TYPE_NONE, TYPE_NONE, TYPE_NONE}}, { "e_bgt" , 0x7A000000, 0x7A110000 | E_MASK_BD15, E_BD15 , R_ANAL_OP_TYPE_CJMP, R_ANAL_COND_GT, {TYPE_CR, TYPE_JMP, TYPE_NONE, TYPE_NONE, TYPE_NONE}}, @@ -269,7 +269,7 @@ const e_vle_t e_ops[] = { { "e_beql" , 0x7A000001, 0x7A130001 | E_MASK_BD15, E_BD15 , R_ANAL_OP_TYPE_CCALL, R_ANAL_COND_VC, {TYPE_CR, TYPE_JMP, TYPE_NONE, TYPE_NONE, TYPE_NONE}}, { "e_bsol" , 0x7A000001, 0x7A140001 | E_MASK_BD15, E_BD15 , R_ANAL_OP_TYPE_CCALL, R_ANAL_COND_VS, {TYPE_CR, TYPE_JMP, TYPE_NONE, TYPE_NONE, TYPE_NONE}}, { "e_bcl" , 0x7A000001, 0x7A140001 | E_MASK_BD15, E_BD15 , R_ANAL_OP_TYPE_CCALL, R_ANAL_COND_VS, {TYPE_CR, TYPE_JMP, TYPE_NONE, TYPE_NONE, TYPE_NONE}}, - // has cr0-cr3 + // has cr0-cr3 { "e_bdnz" , 0x7A200000, 0x7A200000 | E_MASK_BD15, E_BD15c , R_ANAL_OP_TYPE_JMP, R_ANAL_COND_AL, {TYPE_JMP, TYPE_NONE, TYPE_NONE, TYPE_NONE, TYPE_NONE}}, { "e_bdnzl" , 0x7A200001, 0x7A200001 | E_MASK_BD15, E_BD15c , R_ANAL_OP_TYPE_CALL, R_ANAL_COND_AL, {TYPE_JMP, TYPE_NONE, TYPE_NONE, TYPE_NONE, TYPE_NONE}}, { "e_bdz" , 0x7A300000, 0x7A300000 | E_MASK_BD15, E_BD15c , R_ANAL_OP_TYPE_JMP, R_ANAL_COND_AL, {TYPE_JMP, TYPE_NONE, TYPE_NONE, TYPE_NONE, TYPE_NONE}}, diff --git a/libr/asm/arch/propeller/propeller_disas.c b/libr/asm/arch/propeller/propeller_disas.c index 649cdcb2d3..0c85f2462c 100644 --- a/libr/asm/arch/propeller/propeller_disas.c +++ b/libr/asm/arch/propeller/propeller_disas.c @@ -186,7 +186,7 @@ static int decode_jmp (struct propeller_cmd *cmd, ut32 instr) { "#0x%x", get_src (instr) << 2); } else { cmd->immed = 0; - cmd->src = get_src (instr) << 2; + cmd->src = get_src (instr) << 2; snprintf (cmd->operands, PROP_INSTR_MAXLEN - 1, "0x%x", get_src (instr) << 2); } diff --git a/libr/asm/arch/riscv/riscv.c b/libr/asm/arch/riscv/riscv.c index 7b0c96d35c..fe673361ab 100644 --- a/libr/asm/arch/riscv/riscv.c +++ b/libr/asm/arch/riscv/riscv.c @@ -278,7 +278,7 @@ static struct riscv_opcode *get_opcode (insn_t word) { if (!riscv_hash[OP_HASH_IDX (op->match)]) { riscv_hash[OP_HASH_IDX (op->match)] = op; } - } + } init = 1; } diff --git a/libr/asm/arch/sh/gnu/sh-opc.h b/libr/asm/arch/sh/gnu/sh-opc.h index badc6d769c..d0a3d44043 100644 --- a/libr/asm/arch/sh/gnu/sh-opc.h +++ b/libr/asm/arch/sh/gnu/sh-opc.h @@ -568,7 +568,7 @@ sh_opcode_info sh_table[] = { /* 1111nn0111111101 ftrv XMTRX_M4,*/{"ftrv",{XMTRX_M4,V_REG_N},{HEX_F,REG_NM,HEX_F,HEX_D}}, -{ 0 } +{ 0 } }; #endif diff --git a/libr/asm/arch/sparc/gnu/sparc-dis.c b/libr/asm/arch/sparc/gnu/sparc-dis.c index 96357bec03..8dd2baaa4c 100644 --- a/libr/asm/arch/sparc/gnu/sparc-dis.c +++ b/libr/asm/arch/sparc/gnu/sparc-dis.c @@ -109,7 +109,7 @@ static const char *v9_priv_reg_names[] = static const char *v9_hpriv_reg_names[] = { "hpstate", "htstate", "resv2", "hintp", "resv4", "htba", "hver", - "resv7", "resv8", "resv9", "resv10", "resv11", "resv12", "resv13", + "resv7", "resv8", "resv9", "resv10", "resv11", "resv12", "resv13", "resv14", "resv15", "resv16", "resv17", "resv18", "resv19", "resv20", "resv21", "resv22", "resv23", "resv24", "resv25", "resv26", "resv27", "resv28", "resv29", "resv30", "hstick_cmpr" diff --git a/libr/asm/arch/tms320/c55x_plus/hashtable.c b/libr/asm/arch/tms320/c55x_plus/hashtable.c index c6aacd49d7..e95151d2cd 100644 --- a/libr/asm/arch/tms320/c55x_plus/hashtable.c +++ b/libr/asm/arch/tms320/c55x_plus/hashtable.c @@ -314,7 +314,7 @@ st32 get_hashfunc_03(st32 arg1, st32 arg2) { } st32 get_hashfunc_04(st32 arg1, st32 arg2) { - st32 result; + st32 result; if ( arg2 & 0x80000000 ) { if ((arg2 & 0x80000000) == 0x80000000) { @@ -329,7 +329,7 @@ st32 get_hashfunc_04(st32 arg1, st32 arg2) { } st32 get_hashfunc_05(st32 arg1, st32 arg2) { - st32 result; + st32 result; if ( arg2 & 0x80000000 ) { if ((arg2 & 0x80000000) == 0x80000000) { @@ -344,7 +344,7 @@ st32 get_hashfunc_05(st32 arg1, st32 arg2) { } st32 get_hashfunc_06(st32 arg1, st32 arg2) { - st32 result; + st32 result; if ( arg2 & 0x80000000 ) { if ((st32) (arg2 & 0x80000000) == 0x80000000) { @@ -374,7 +374,7 @@ st32 get_hashfunc_07(st32 arg1, st32 arg2) { } st32 get_hashfunc_08(st32 arg1, st32 arg2) { - st32 tmp; + st32 tmp; tmp = arg2 & 0xC0000000; if ( (arg2 & 0xC0000000u) <= 0x80000000 ) { @@ -396,7 +396,7 @@ st32 get_hashfunc_08(st32 arg1, st32 arg2) { } st32 get_hashfunc_09(st32 arg1, st32 arg2) { - st32 v2; + st32 v2; v2 = arg2 & 0xC0000000; if ( (arg2 & 0xC0000000u) <= 0x80000000 ) { @@ -418,8 +418,8 @@ st32 get_hashfunc_09(st32 arg1, st32 arg2) { } st32 get_hashfunc_10(st32 arg1, st32 arg2) { - st32 v2; - st32 v3; + st32 v2; + st32 v3; v2 = arg2; v3 = v2 & 0x500000; @@ -442,7 +442,7 @@ st32 get_hashfunc_10(st32 arg1, st32 arg2) { } st32 get_hashfunc_11(st32 arg1, st32 arg2) { - st32 result; + st32 result; /* */ @@ -459,9 +459,9 @@ st32 get_hashfunc_11(st32 arg1, st32 arg2) { } st32 get_hashfunc_12(st32 arg1, st32 arg2) { - st32 tmp; - st32 v3; - st32 result; + st32 tmp; + st32 v3; + st32 result; tmp = arg2; v3 = tmp & 0x400000; @@ -478,7 +478,7 @@ st32 get_hashfunc_12(st32 arg1, st32 arg2) { } st32 get_hashfunc_13(st32 arg1, st32 arg2) { - st32 result; + st32 result; if ( arg2 & 0x1000000 ) { if ((arg2 & 0x1000000) == 16777216) { @@ -493,7 +493,7 @@ st32 get_hashfunc_13(st32 arg1, st32 arg2) { } st32 get_hashfunc_14(st32 arg1, st32 arg2) { - st32 result; + st32 result; if (arg2 & 0x1000000) { if ((arg2 & 0x1000000) == 0x1000000) { @@ -508,7 +508,7 @@ st32 get_hashfunc_14(st32 arg1, st32 arg2) { } st32 get_hashfunc_15(st32 arg1, st32 arg2) { - st32 result; + st32 result; if ( arg2 & 0x1000000 ) { if ((arg2 & 0x1000000) == 16777216) { @@ -523,7 +523,7 @@ st32 get_hashfunc_15(st32 arg1, st32 arg2) { } st32 get_hashfunc_16(st32 arg1, st32 arg2) { - st32 result; + st32 result; if ( arg2 & 0x1000000 ) { if ((arg2 & 0x1000000) == 16777216) { @@ -538,7 +538,7 @@ st32 get_hashfunc_16(st32 arg1, st32 arg2) { } st32 get_hashfunc_17(st32 arg1, st32 arg2) { - st32 result; + st32 result; if ( arg2 & 0x1000000 ) { if ((arg2 & 0x1000000) == 16777216) { @@ -553,7 +553,7 @@ st32 get_hashfunc_17(st32 arg1, st32 arg2) { } st32 get_hashfunc_18(st32 arg1, st32 arg2) { - st32 result; + st32 result; if ( arg2 & 0x1000000 ) { if ((arg2 & 0x1000000) == 16777216) { @@ -568,7 +568,7 @@ st32 get_hashfunc_18(st32 arg1, st32 arg2) { } st32 get_hashfunc_19(st32 arg1, st32 arg2) { - st32 v2; + st32 v2; v2 = arg2 & 0xC1000000; if ( (arg2 & 0xC1000000u) > 0x40000000 ) { @@ -587,7 +587,7 @@ st32 get_hashfunc_19(st32 arg1, st32 arg2) { } st32 get_hashfunc_20(st32 arg1, st32 arg2) { - st32 v2; + st32 v2; v2 = arg2 & 0x1400000; if ( (arg2 & 0x1400000u) <= 0x1000000 ) { @@ -609,7 +609,7 @@ st32 get_hashfunc_20(st32 arg1, st32 arg2) { } st32 get_hashfunc_21(st32 arg1, st32 arg2) { - st32 v2; + st32 v2; v2 = arg2 & 0x1400000; if ( (arg2 & 0x1400000u) <= 0x1000000 ) { @@ -631,7 +631,7 @@ st32 get_hashfunc_21(st32 arg1, st32 arg2) { } st32 get_hashfunc_22(st32 arg1, st32 arg2) { - st32 result; + st32 result; if ( arg2 & 0x8200 ) { if ((unsigned short)(arg2 & 0x8200) == 512) { @@ -646,8 +646,8 @@ st32 get_hashfunc_22(st32 arg1, st32 arg2) { } st32 get_hashfunc_23(st32 arg1, st32 arg2) { - st32 v2; - st32 v3; + st32 v2; + st32 v3; v2 = arg2; v3 = v2 & 0x41C000; @@ -707,8 +707,8 @@ st32 get_hashfunc_23(st32 arg1, st32 arg2) { } st32 get_hashfunc_24(st32 arg1, st32 arg2) { - st32 v2; - st32 v3; + st32 v2; + st32 v3; v2 = arg2; v3 = v2 & 0x418000; @@ -747,7 +747,7 @@ st32 get_hashfunc_24(st32 arg1, st32 arg2) { } st32 get_hashfunc_25(st32 arg1, st32 arg2) { - ut32 v2; + ut32 v2; v2 = (ut32)hash_const_02 & arg2; if ( ((ut32)hash_const_02 & arg2) <= 0x8000 ) { @@ -782,8 +782,8 @@ st32 get_hashfunc_25(st32 arg1, st32 arg2) { } st32 get_hashfunc_26(st32 arg1, st32 arg2) { - st32 v2; - st32 v3; + st32 v2; + st32 v3; v2 = arg2; v3 = v2 & 0x41C000; @@ -810,9 +810,9 @@ st32 get_hashfunc_26(st32 arg1, st32 arg2) { } st32 get_hashfunc_27(st32 arg1, st32 arg2) { - st32 v2; - st32 v3; - st32 result; + st32 v2; + st32 v3; + st32 result; v2 = arg2; v3 = v2 & 0x18000; @@ -834,9 +834,9 @@ st32 get_hashfunc_27(st32 arg1, st32 arg2) { st32 get_hashfunc_28(st32 arg1, st32 arg2) { - st32 v2; - st32 v3; - char v5; + st32 v2; + st32 v3; + char v5; v2 = arg2; v3 = v2 & 0x1F800; @@ -924,8 +924,8 @@ st32 get_hashfunc_28(st32 arg1, st32 arg2) { } st32 get_hashfunc_29(st32 arg1, st32 arg2) { - st32 v2; - st32 v3; + st32 v2; + st32 v3; v2 = arg2; v3 = v2 & 0x40F800; @@ -949,9 +949,9 @@ st32 get_hashfunc_29(st32 arg1, st32 arg2) { } st32 get_hashfunc_30(st32 arg1, st32 arg2) { - st32 v2; - st32 v3; - st32 result; + st32 v2; + st32 v3; + st32 result; v2 = arg2; v3 = v2 & 0x18000; @@ -972,7 +972,7 @@ st32 get_hashfunc_30(st32 arg1, st32 arg2) { } st32 get_hashfunc_31(st32 arg1, st32 arg2) { - st32 result; + st32 result; st32 v3 = arg2 & 0x380000; if ( (ut32)v3 <= 0x200000 ) { @@ -1012,9 +1012,9 @@ st32 get_hashfunc_31(st32 arg1, st32 arg2) { } st32 get_hashfunc_32(st32 arg1, st32 arg2) { - st32 v2; - st32 v3; - st32 result; + st32 v2; + st32 v3; + st32 result; v2 = arg2; v3 = v2 & 0x18000; @@ -1036,7 +1036,7 @@ st32 get_hashfunc_32(st32 arg1, st32 arg2) { st32 get_hashfunc_33(st32 arg1, st32 arg2) { - st32 result; + st32 result; if ( arg2 & 0x8000 ) { if ((unsigned short)(arg2 & 0x8000) == 32768) { @@ -1051,7 +1051,7 @@ st32 get_hashfunc_33(st32 arg1, st32 arg2) { } st32 get_hashfunc_34(st32 arg1, st32 arg2) { - st32 result; + st32 result; st32 v2 = arg2; st32 v3 = v2 & 0x580000; if ( (ut32)v3 <= 0x180000 ) { @@ -1082,7 +1082,7 @@ st32 get_hashfunc_34(st32 arg1, st32 arg2) { st32 get_hashfunc_35(st32 arg1, st32 arg2) { - st32 result; + st32 result; if ( arg2 & 0x1000000 ) { if ((arg2 & 0x1000000) == 16777216) { @@ -1097,7 +1097,7 @@ st32 get_hashfunc_35(st32 arg1, st32 arg2) { } st32 get_hashfunc_36(st32 arg1, st32 arg2) { - st32 result; + st32 result; if ( arg2 & 0x1C00000 ) { if ((arg2 & 0x1C00000) == 16777216) { @@ -1112,7 +1112,7 @@ st32 get_hashfunc_36(st32 arg1, st32 arg2) { } st32 get_hashfunc_37(st32 arg1, st32 arg2) { - st32 result; + st32 result; if ( (arg2 & 0x1800000) == 8388608 ) { result = 473; @@ -1147,7 +1147,7 @@ st32 get_hashfunc_38(st32 arg1, st32 arg2) { } st32 get_hashfunc_39(st32 arg1, st32 arg2) { - st32 result; + st32 result; if ( (arg2 & 0x1010000) == 65536 ) { result = 25; @@ -1162,7 +1162,7 @@ st32 get_hashfunc_39(st32 arg1, st32 arg2) { } st32 get_hashfunc_40(st32 arg1, st32 arg2) { - st32 result; + st32 result; if ( arg2 & 0x1010000 ) { if ((arg2 & 0x1010000) == 16777216) { @@ -1177,7 +1177,7 @@ st32 get_hashfunc_40(st32 arg1, st32 arg2) { } st32 get_hashfunc_41(st32 arg1, st32 arg2) { - st32 result; + st32 result; st32 v2 = arg2 & 0x1010000; if ( arg2 & 0x1010000 ) { if ( v2 == 16777216 ) { @@ -1216,7 +1216,7 @@ st32 get_hashfunc_42(st32 arg1, st32 arg2) { } st32 get_hashfunc_43(st32 arg1, st32 arg2) { - st32 v2; + st32 v2; v2 = arg2 & 0x1010000; if ( (arg2 & 0x1010000u) <= 0x1000000 ) { @@ -1238,7 +1238,7 @@ st32 get_hashfunc_43(st32 arg1, st32 arg2) { } st32 get_hashfunc_44(st32 arg1, st32 arg2) { - st32 result; + st32 result; if ( arg2 & 0x1000000 ) { if ((arg2 & 0x1000000) == 16777216) { @@ -1253,7 +1253,7 @@ st32 get_hashfunc_44(st32 arg1, st32 arg2) { } st32 get_hashfunc_45(st32 arg1, st32 arg2) { - st32 result; + st32 result; if ( arg2 & 0x1000000 ) { if ((arg2 & 0x1000000) == 16777216) { @@ -1268,7 +1268,7 @@ st32 get_hashfunc_45(st32 arg1, st32 arg2) { } st32 get_hashfunc_46(st32 arg1, st32 arg2) { - st32 v2; + st32 v2; v2 = arg2 & 0xC1000000; if ( (arg2 & 0xC1000000u) > 0x40000000 ) { @@ -1287,7 +1287,7 @@ st32 get_hashfunc_46(st32 arg1, st32 arg2) { } st32 get_hashfunc_47(st32 arg1, st32 arg2) { - st32 result; + st32 result; if ( arg2 & 0x1000000 ) { if ((arg2 & 0x1000000) == 16777216) { @@ -1302,7 +1302,7 @@ st32 get_hashfunc_47(st32 arg1, st32 arg2) { } st32 get_hashfunc_48(st32 arg1, st32 arg2) { - st32 result; + st32 result; if ( arg2 & 0x1000000 ) { if ((arg2 & 0x1000000) == 16777216) { @@ -1317,7 +1317,7 @@ st32 get_hashfunc_48(st32 arg1, st32 arg2) { } st32 get_hashfunc_49(st32 arg1, st32 arg2) { - st32 result; + st32 result; if (arg2 & 0x80000000) { if ((arg2 & 0x80000000) == 0x80000000) { @@ -1417,7 +1417,7 @@ st32 get_hashfunc_52(st32 arg1, st32 arg2) { st32 get_hashfunc_53(st32 arg1, st32 arg2) { st32 v2 = arg2 & 0x8200; - st32 result; + st32 result; if (arg2 & 0x8200) { if (v2 == 512) { @@ -1466,7 +1466,7 @@ st32 get_hashfunc_55(st32 arg1, st32 arg2) { } st32 get_hashfunc_56(st32 arg1, st32 arg2) { - st32 result; + st32 result; st32 v3 = arg2 & 0x18180; if ( (ut32)v3 <= 0x8080 ) { if (v3 == 32896) { @@ -1495,7 +1495,7 @@ st32 get_hashfunc_56(st32 arg1, st32 arg2) { } st32 get_hashfunc_57(st32 arg1, st32 arg2) { - st32 result; + st32 result; if ( arg2 & 0x8000 ) { if ((unsigned short)(arg2 & 0x8000) == 32768) { @@ -1510,9 +1510,9 @@ st32 get_hashfunc_57(st32 arg1, st32 arg2) { } st32 get_hashfunc_58(st32 arg1, st32 arg2) { - st32 v2; - st32 v3; - st32 result; + st32 v2; + st32 v3; + st32 result; v2 = arg2; v3 = v2 & 0x18000; @@ -1533,7 +1533,7 @@ st32 get_hashfunc_58(st32 arg1, st32 arg2) { } st32 get_hashfunc_59(st32 arg1, st32 arg2) { - st32 result; + st32 result; st32 v2 = arg2 & 0x8180; if ( (ut32)v2 <= 0x100 ) { if (v2 == 256) { @@ -1559,7 +1559,7 @@ st32 get_hashfunc_59(st32 arg1, st32 arg2) { } st32 get_hashfunc_60(st32 arg1, st32 arg2) { - st32 result; + st32 result; if ( arg2 & 0x1000000 ) { if ((arg2 & 0x1000000) == 16777216) { @@ -1574,7 +1574,7 @@ st32 get_hashfunc_60(st32 arg1, st32 arg2) { } st32 get_hashfunc_61(st32 arg1, st32 arg2) { - st32 result; + st32 result; if ( arg2 & 0x1000000 ) { if ((arg2 & 0x1000000) == 16777216) { @@ -1589,7 +1589,7 @@ st32 get_hashfunc_61(st32 arg1, st32 arg2) { } st32 get_hashfunc_62(st32 arg1, st32 arg2) { - st32 result; + st32 result; if ( arg2 & 0x1000000 ) { if ((arg2 & 0x1000000) == 16777216) { @@ -1604,7 +1604,7 @@ st32 get_hashfunc_62(st32 arg1, st32 arg2) { } st32 get_hashfunc_63(st32 arg1, st32 arg2) { - st32 result; + st32 result; if ( arg2 & 0x1000000 ) { if ((arg2 & 0x1000000) == 16777216) { @@ -1619,7 +1619,7 @@ st32 get_hashfunc_63(st32 arg1, st32 arg2) { } st32 get_hashfunc_64(st32 arg1, st32 arg2) { - st32 result; + st32 result; if ( arg2 & 0x1000000 ) { if ((arg2 & 0x1000000) == 16777216) { @@ -1634,7 +1634,7 @@ st32 get_hashfunc_64(st32 arg1, st32 arg2) { } st32 get_hashfunc_65(st32 arg1, st32 arg2) { - st32 result; + st32 result; if ( arg2 & 0x1000000 ) { if ((arg2 & 0x1000000) == 16777216) { @@ -1649,7 +1649,7 @@ st32 get_hashfunc_65(st32 arg1, st32 arg2) { } st32 get_hashfunc_66(st32 arg1, st32 arg2) { - st32 result; + st32 result; if ( (arg2 & 0x1C00000) == 12582912 ) { result = 157; @@ -1665,7 +1665,7 @@ st32 get_hashfunc_66(st32 arg1, st32 arg2) { st32 get_hashfunc_67(st32 arg1, st32 arg2) { - st32 result; + st32 result; if ( arg2 & 0x1000000 ) { if ((arg2 & 0x1000000) == 16777216) { @@ -1680,7 +1680,7 @@ st32 get_hashfunc_67(st32 arg1, st32 arg2) { } st32 get_hashfunc_68(st32 arg1, st32 arg2) { - st32 result; + st32 result; if ( arg2 & 0x1000000 ) { if ((arg2 & 0x1000000) == 16777216) { @@ -1695,7 +1695,7 @@ st32 get_hashfunc_68(st32 arg1, st32 arg2) { } st32 get_hashfunc_69(st32 arg1, st32 arg2) { - st32 result; + st32 result; if ( arg2 & 0x1000000 ) { if ((arg2 & 0x1000000) == 16777216) { @@ -1710,8 +1710,8 @@ st32 get_hashfunc_69(st32 arg1, st32 arg2) { } st32 get_hashfunc_70(st32 arg1, st32 arg2) { - st32 v2; - st32 result; + st32 v2; + st32 result; v2 = arg2 & 0x1400000; if ( arg2 & 0x1400000 ) { @@ -1731,7 +1731,7 @@ st32 get_hashfunc_70(st32 arg1, st32 arg2) { } st32 get_hashfunc_71(st32 arg1, st32 arg2) { - st32 result; + st32 result; if ( arg2 & 0x1400000 ) { if ((arg2 & 0x1400000) == 4194304) { @@ -1746,7 +1746,7 @@ st32 get_hashfunc_71(st32 arg1, st32 arg2) { } st32 get_hashfunc_72(st32 arg1, st32 arg2) { - st32 result; + st32 result; if ( arg2 & 0x1000000 ) { if ((arg2 & 0x1000000) == 16777216) { @@ -1761,7 +1761,7 @@ st32 get_hashfunc_72(st32 arg1, st32 arg2) { } st32 get_hashfunc_73(st32 arg1, st32 arg2) { - st32 result; + st32 result; if ( arg2 & 0x1010000 ) { if ((arg2 & 0x1010000) == 16777216) { @@ -1776,7 +1776,7 @@ st32 get_hashfunc_73(st32 arg1, st32 arg2) { } st32 get_hashfunc_74(st32 arg1, st32 arg2) { - st32 result; + st32 result; if ( (arg2 & 0x1010000) == 65536 ) { result = 213; @@ -1791,7 +1791,7 @@ st32 get_hashfunc_74(st32 arg1, st32 arg2) { } st32 get_hashfunc_75(st32 arg1, st32 arg2) { - st32 result; + st32 result; if ( arg2 & 0x80000000 ) { if ((arg2 & 0x80000000) == 0x80000000) { @@ -1806,7 +1806,7 @@ st32 get_hashfunc_75(st32 arg1, st32 arg2) { } st32 get_hashfunc_76(st32 arg1, st32 arg2) { - st32 result; + st32 result; if ( arg2 & 0x1000000 ) { if ((arg2 & 0x1000000) == 16777216) { @@ -1821,7 +1821,7 @@ st32 get_hashfunc_76(st32 arg1, st32 arg2) { } st32 get_hashfunc_77(st32 arg1, st32 arg2) { - st32 result; + st32 result; if ( arg2 & 0x1000000 ) { if ((arg2 & 0x1000000) == 16777216) { @@ -1857,9 +1857,9 @@ st32 get_hashfunc_78(st32 arg1, st32 arg2) { } st32 get_hashfunc_79(st32 arg1, st32 arg2) { - st32 v2; - st32 v3; - st32 result; + st32 v2; + st32 v3; + st32 result; v2 = arg2; v3 = v2 & 0x18180; @@ -1917,9 +1917,9 @@ st32 get_hashfunc_79(st32 arg1, st32 arg2) { } st32 get_hashfunc_80(st32 arg1, st32 arg2) { - st32 v2; - st32 v3; - st32 result; + st32 v2; + st32 v3; + st32 result; v2 = arg2; v3 = v2 & 0x18180; @@ -1977,7 +1977,7 @@ st32 get_hashfunc_80(st32 arg1, st32 arg2) { } st32 get_hashfunc_81(st32 arg1, st32 arg2) { - st32 result; + st32 result; st32 v2 = arg2 & 0x1000180; if ( (arg2 & 0x1000180u) <= 0x1000000 ) { if ((arg2 & 0x1000180) == 16777216) { @@ -2016,8 +2016,8 @@ st32 get_hashfunc_81(st32 arg1, st32 arg2) { } st32 get_hashfunc_82(st32 arg1, st32 arg2) { - st32 v2; - st32 result; + st32 v2; + st32 result; v2 = arg2 & 0x1000180; if ( (arg2 & 0x1000180u) <= 0x100 ) { @@ -2044,9 +2044,9 @@ st32 get_hashfunc_82(st32 arg1, st32 arg2) { } st32 get_hashfunc_83(st32 arg1, st32 arg2) { - st32 v2; - st32 result; - char v4; + st32 v2; + st32 result; + char v4; v2 = arg2 & 0x1810180; if ( (arg2 & 0x1810180u) <= 0x800080 ) { @@ -2127,7 +2127,7 @@ st32 get_hashfunc_83(st32 arg1, st32 arg2) { st32 get_hashfunc_84(st32 arg1, st32 arg2) { - st32 result; + st32 result; st32 v2 = arg2 & 0x1000180; if ( arg2 & 0x1000180 ) { if ( v2 == 16777344 ) { @@ -2146,7 +2146,7 @@ st32 get_hashfunc_84(st32 arg1, st32 arg2) { } st32 get_hashfunc_85(st32 arg1, st32 arg2) { - st32 result; + st32 result; if ( (arg2 & 0x1000180) == 128 ) { result = 511; @@ -2161,7 +2161,7 @@ st32 get_hashfunc_85(st32 arg1, st32 arg2) { } st32 get_hashfunc_86(st32 arg1, st32 arg2) { - st32 result; + st32 result; if ( arg2 & 0x1000000 ) { if ((arg2 & 0x1000000) == 16777216) { @@ -2176,7 +2176,7 @@ st32 get_hashfunc_86(st32 arg1, st32 arg2) { } st32 get_hashfunc_87(st32 arg1, st32 v2) { - st32 result; + st32 result; st32 v3 = v2 & 0x79B981; if (v3 == 33024 || v3 == 4227328) { result = 490; @@ -2205,7 +2205,7 @@ st32 get_hashfunc_88(st32 arg1, st32 arg2) { } st32 get_hashfunc_89(st32 arg1, st32 arg2) { - st32 result; + st32 result; if ( (arg2 & 0x1B901B9) == 16777600 ) { result = 488; @@ -2220,9 +2220,9 @@ st32 get_hashfunc_89(st32 arg1, st32 arg2) { } st32 get_hashfunc_90(st32 arg1, st32 arg2) { - st32 v2; - st32 v4; - st32 v5; + st32 v2; + st32 v4; + st32 v5; v2 = arg2 & 0x1F901B9; if ( (arg2 & 0x1F901B9u) <= 0x1810101 ) { @@ -2267,7 +2267,7 @@ st32 get_hashfunc_90(st32 arg1, st32 arg2) { } st32 get_hashfunc_91(st32 arg1, st32 arg2) { - st32 result; + st32 result; if ( (arg2 & 0x1F901BF) == 8454145 ) { result = 501; diff --git a/libr/asm/arch/tms320/c55x_plus/ins.c b/libr/asm/arch/tms320/c55x_plus/ins.c index e171b3de9c..d96cbb183b 100644 --- a/libr/asm/arch/tms320/c55x_plus/ins.c +++ b/libr/asm/arch/tms320/c55x_plus/ins.c @@ -57,7 +57,7 @@ ut32 get_ins_part(ut32 pos, ut32 len) { if ((st32)pos < 0 || pos >= ins_buff_len) { has_failed = 1; return ret; - } + } for (; len > 0; len--) { ret <<= 8; diff --git a/libr/asm/arch/tricore/gnu/cpu-tricore.c b/libr/asm/arch/tricore/gnu/cpu-tricore.c index 5069971aed..f85bcc5507 100644 --- a/libr/asm/arch/tricore/gnu/cpu-tricore.c +++ b/libr/asm/arch/tricore/gnu/cpu-tricore.c @@ -72,7 +72,7 @@ unsigned long tricore_mask_ssr; unsigned long tricore_mask_ssro; unsigned long tricore_opmask[TRICORE_FMT_MAX]; -int +int bfd_default_scan (info, string) const bfd_arch_info_type *info; const char *string; @@ -247,7 +247,7 @@ tricore_init_arch_vars (mach) tricore_mask_rcrw = 0x00e000ff; tricore_mask_rlc = 0x000000ff; tricore_mask_rr = 0x0ff300ff; - tricore_mask_rr1 = 0x0ffc00ff; + tricore_mask_rr1 = 0x0ffc00ff; tricore_mask_rr2 = 0x0fff00ff; tricore_mask_rrpw = 0x006000ff; tricore_mask_rrr = 0x00f300ff; @@ -295,7 +295,7 @@ tricore_init_arch_vars (mach) tricore_opmask[TRICORE_FMT_RCRW] = tricore_mask_rcrw; tricore_opmask[TRICORE_FMT_RLC] = tricore_mask_rlc; tricore_opmask[TRICORE_FMT_RR] = tricore_mask_rr; - tricore_opmask[TRICORE_FMT_RR1] = tricore_mask_rr1; + tricore_opmask[TRICORE_FMT_RR1] = tricore_mask_rr1; tricore_opmask[TRICORE_FMT_RR2] = tricore_mask_rr2; tricore_opmask[TRICORE_FMT_RRPW] = tricore_mask_rrpw; tricore_opmask[TRICORE_FMT_RRR] = tricore_mask_rrr; diff --git a/libr/asm/arch/tricore/gnu/tricore-dis.c b/libr/asm/arch/tricore/gnu/tricore-dis.c index 4b4d7ed5db..2865804206 100644 --- a/libr/asm/arch/tricore/gnu/tricore-dis.c +++ b/libr/asm/arch/tricore/gnu/tricore-dis.c @@ -1434,7 +1434,7 @@ print_decoded_insn (memaddr, info) abs = (dec_insn.cexp[i] << 1) + memaddr; (*info->print_address_func) (abs, info); break; - + case 'c': needs_creg = 1; /* Fall through. */ @@ -1458,7 +1458,7 @@ print_decoded_insn (memaddr, info) case '&': dec_insn.regs[i] = 10; - /* Fall through. */ + /* Fall through. */ case '@': if (dec_insn.regs[i] == 10) { DPRINT (DFILE, "[" REGPREFIX "sp]"); @@ -1524,7 +1524,7 @@ print_decoded_insn (memaddr, info) break; case 'S': - DPRINT (DFILE, "["REGPREFIX"a15]"); + DPRINT (DFILE, "["REGPREFIX"a15]"); need_comma = 0; break; } @@ -1577,7 +1577,7 @@ decode_tricore_insn (memaddr, insn, len32, info) } /* Oops -- this isn't a valid TriCore insn! Since we know that - MEMADDR is an even address (otherwise it already would have + MEMADDR is an even address (otherwise it already would have been handled by print_insn_tricore below) and that TriCore insns can only start at even addresses, we just print the lower 16 bits of INSN as a .hword pseudo-opcode and return 2, @@ -1880,7 +1880,7 @@ decode_pcp_insn (memaddr, buffer, info) (or possible) to decode a single instruction or a pseudo-op, i.e. 1, 2 or 4 bytes. */ -int +int print_insn_tricore (memaddr, info) bfd_vma memaddr; struct disassemble_info *info; diff --git a/libr/asm/arch/xtensa/gnu/xtensa-dis.c b/libr/asm/arch/xtensa/gnu/xtensa-dis.c index 12e54cbb91..1b34d7cd26 100644 --- a/libr/asm/arch/xtensa/gnu/xtensa-dis.c +++ b/libr/asm/arch/xtensa/gnu/xtensa-dis.c @@ -100,7 +100,7 @@ print_xtensa_operand (bfd_vma memaddr, { xtensa_isa isa = xtensa_default_isa; int signed_operand_val; - + if (show_raw_fields) { if (operand_val < 0xa) { @@ -146,7 +146,7 @@ print_xtensa_operand (bfd_vma memaddr, xtensa_regfile_shortname (isa, opnd_rf), operand_val); i++; - } + } } } diff --git a/libr/asm/arch/z80/expressions.c b/libr/asm/arch/z80/expressions.c index 9b9a97e853..938478eb59 100644 --- a/libr/asm/arch/z80/expressions.c +++ b/libr/asm/arch/z80/expressions.c @@ -462,7 +462,7 @@ rd_factor (const char **p, int *valid, int level, int *check, int print_errors) { (*p)++; int value = rd_value (p, valid, level, check, print_errors); - if (value == 0){ + if (value == 0){ printerr (1, "division by zero\n"); return -1; } diff --git a/libr/asm/d/8051.sdb.txt b/libr/asm/d/8051.sdb.txt index 47f897ecdf..41d388ce2a 100644 --- a/libr/asm/d/8051.sdb.txt +++ b/libr/asm/d/8051.sdb.txt @@ -21,7 +21,7 @@ jnz=jump if accumulator not zero jz=jump if accumulator zero lcall=long call ljmp=long jump -mov=move +mov=move movc=move from code or program memory to accumulator movx=move between external memory and accumulator mul=multiply accumulator and b register diff --git a/libr/asm/d/dalvik.sdb.txt b/libr/asm/d/dalvik.sdb.txt index df9d82be1f..95ccb7a589 100644 --- a/libr/asm/d/dalvik.sdb.txt +++ b/libr/asm/d/dalvik.sdb.txt @@ -15,11 +15,11 @@ aget-object=perform get array at the identified index of array aget-short=perform get array at the identified index of array aget-wide=perform get array at the identified index of array aget=perform get array at the identified index of array -and-int/2addr=adding -and-int/lit16=adding -and-int/lit8=adding +and-int/2addr=adding +and-int/lit16=adding +and-int/lit8=adding and-int=adding, result stored in third register -and-long/2addr=adding +and-long/2addr=adding and-long=adding, result stored in third register aput-boolean=perform put array at the identified index of array aput-byte=perform put array at the identified index of array @@ -46,15 +46,15 @@ const/16=move literal into the specified register const/4=move literal into the specified register const/high16=move literal into the specified register const=move the given literal value into the specified register -div-double/2addr=division +div-double/2addr=division div-double=division, result stored in third register -div-float/2addr=division +div-float/2addr=division div-float=division, result stored in third register -div-int/2addr=division -div-int/lit16=division -div-int/lit8=division +div-int/2addr=division +div-int/lit16=division +div-int/lit8=division div-int=division, result stored in third register -div-long/2addr=division +div-long/2addr=division div-long=division, result stored in third register double-to-float=cast types double-to-int=cast types @@ -215,4 +215,4 @@ xor-int/lit16=logical XOR xor-int/lit8=logical XOR xor-int=logical XOR, result stored in third register xor-long/2addr=logical XOR -xor-long=logical XOR, result stored in third register \ No newline at end of file +xor-long=logical XOR, result stored in third register diff --git a/libr/asm/d/java.sdb.txt b/libr/asm/d/java.sdb.txt index 5e6d643e29..f0d3a27397 100644 --- a/libr/asm/d/java.sdb.txt +++ b/libr/asm/d/java.sdb.txt @@ -1,15 +1,15 @@ aaload=load onto the stack a reference from an array aastore=store into a reference in an array -aconst_null=push a -aload=load a reference onto the stack from a local variable +aconst_null=push a +aload=load a reference onto the stack from a local variable aload_0=load a reference onto the stack from local variable 0 aload_1=load a reference onto the stack from local variable 1 aload_2=load a reference onto the stack from local variable 2 aload_3=load a reference onto the stack from local variable 3 -anewarray=create a new array of references of length +anewarray=create a new array of references of length areturn=return a reference from a method arraylength=get the length of an array -astore=store a reference into a local variable +astore=store a reference into a local variable astore_0=store a reference into local variable 0 astore_1=store a reference into local variable 1 astore_2=store a reference into local variable 2 @@ -17,11 +17,11 @@ astore_3=store a reference into local variable 3 athrow=throws an error or exception (notice that the rest of the stack is cleared, leaving only a reference to the Throwable) baload=load a byte or Boolean value from an array bastore=store a byte or Boolean value into an array -bipush=push a +bipush=push a breakpoint=reserved for breakpoints in Java debuggers; should not appear in any class file caload=load a char from an array castore=store a char into an array -checkcast=checks whether an +checkcast=checks whether an d2f=convert a double to a float d2i=convert a double to an int d2l=convert a double to a long @@ -30,10 +30,10 @@ daload=load a double from an array dastore=store a double into an array dcmpg=compare two doubles dcmpl=compare two doubles -dconst_0=push the constant -dconst_1=push the constant +dconst_0=push the constant +dconst_1=push the constant ddiv=divide two doubles -dload=load a double +dload=load a double dload_0=load a double from local variable 0 dload_1=load a double from local variable 1 dload_2=load a double from local variable 2 @@ -42,7 +42,7 @@ dmul=multiply two doubles dneg=negate a double drem=get the remainder from a division between two doubles dreturn=return a double from a method -dstore=store a double +dstore=store a double dstore_0=store a double into local variable 0 dstore_1=store a double into local variable 1 dstore_2=store a double into local variable 2 @@ -62,29 +62,29 @@ faload=load a float from an array fastore=store a float in an array fcmpg=compare two floats fcmpl=compare two floats -fconst_0=push -fconst_1=push -fconst_2=push +fconst_0=push +fconst_1=push +fconst_2=push fdiv=divide two floats -fload=load a float -fload_0=load a float -fload_1=load a float -fload_2=load a float -fload_3=load a float +fload=load a float +fload_0=load a float +fload_1=load a float +fload_2=load a float +fload_3=load a float fmul=multiply two floats fneg=negate a float frem=get the remainder from a division between two floats freturn=return a float -fstore=store a float -fstore_0=store a float -fstore_1=store a float -fstore_2=store a float -fstore_3=store a float +fstore=store a float +fstore_0=store a float +fstore_1=store a float +fstore_2=store a float +fstore_3=store a float fsub=subtract two floats -getfield=get a field -getstatic=get a static field -goto=goes to another instruction at -goto_w=goes to another instruction at +getfield=get a field +getstatic=get a static field +goto=goes to another instruction at +goto_w=goes to another instruction at i2b=convert an int into a byte i2c=convert an int into a character i2d=convert an int into a double @@ -103,53 +103,53 @@ iconst_3=load the int value 3 onto the stack iconst_4=load the int value 4 onto the stack iconst_5=load the int value 5 onto the stack idiv=divide two integers -if_acmpeq=if references are equal, branch to instruction at -if_acmpne=if references are not equal, branch to instruction at -if_icmpeq=if ints are equal, branch to instruction at -if_icmpge=if -if_icmpgt=if -if_icmple=if -if_icmplt=if -if_icmpne=if ints are not equal, branch to instruction at -ifeq=if -ifge=if -ifgt=if -ifle=if -iflt=if -ifne=if -ifnonnull=if -ifnull=if -iinc=increment local variable -iload=load an int -iload_0=load an int -iload_1=load an int -iload_2=load an int -iload_3=load an int +if_acmpeq=if references are equal, branch to instruction at +if_acmpne=if references are not equal, branch to instruction at +if_icmpeq=if ints are equal, branch to instruction at +if_icmpge=if +if_icmpgt=if +if_icmple=if +if_icmplt=if +if_icmpne=if ints are not equal, branch to instruction at +ifeq=if +ifge=if +ifgt=if +ifle=if +iflt=if +ifne=if +ifnonnull=if +ifnull=if +iinc=increment local variable +iload=load an int +iload_0=load an int +iload_1=load an int +iload_2=load an int +iload_3=load an int impdep1=reserved for implementation-dependent operations within debuggers; should not appear in any class file impdep2=reserved for implementation-dependent operations within debuggers; should not appear in any class file imul=multiply two integers ineg=negate int -instanceof=determines if an object -invokedynamic=invokes a dynamic method and puts the result on the stack (might be void); the method is identified by method reference -invokeinterface=invokes an interface method on object -invokespecial=invoke instance method on object -invokestatic=invoke a static method and puts the result on the stack (might be void); the method is identified by method reference -invokevirtual=invoke virtual method on object +instanceof=determines if an object +invokedynamic=invokes a dynamic method and puts the result on the stack (might be void); the method is identified by method reference +invokeinterface=invokes an interface method on object +invokespecial=invoke instance method on object +invokestatic=invoke a static method and puts the result on the stack (might be void); the method is identified by method reference +invokevirtual=invoke virtual method on object ior=bitwise int or irem=logical int remainder ireturn=return an integer from a method ishl=int shift left ishr=int arithmetic shift right -istore=store int -istore_0=store int -istore_1=store int -istore_2=store int -istore_3=store int +istore=store int +istore_0=store int +istore_1=store int +istore_2=store int +istore_3=store int isub=int subtract iushr=int logical shift right ixor=int xor -jsr=jump to subroutine at -jsr_w=jump to subroutine at +jsr=jump to subroutine at +jsr_w=jump to subroutine at l2d=convert a long to a double l2f=convert a long to a float l2i=convert a long to a int @@ -160,11 +160,11 @@ lastore=store a long to an array lcmp=push 0 if the two longs are the same, 1 if value1 is greater than value2, -1 otherwise lconst_0=push the long 0 onto the stack lconst_1=push the long 1 onto the stack -ldc=push a constant -ldc_w=push a constant -ldc2_w=push a constant +ldc=push a constant +ldc_w=push a constant +ldc2_w=push a constant ldiv=divide two longs -lload=load a long value from a local variable +lload=load a long value from a local variable lload_0=load a long value from a local variable 0 lload_1=load a long value from a local variable 1 lload_2=load a long value from a local variable 2 @@ -175,31 +175,31 @@ lookupswitch=a target address is looked up from a table using a key and executio lor=bitwise or of two longs lrem=remainder of division of two longs lreturn=return a long value -lshl=bitwise shift left of a long -lshr=bitwise shift right of a long -lstore=store a long -lstore_0=store a long -lstore_1=store a long -lstore_2=store a long -lstore_3=store a long +lshl=bitwise shift left of a long +lshr=bitwise shift right of a long +lstore=store a long +lstore_0=store a long +lstore_1=store a long +lstore_2=store a long +lstore_3=store a long lsub=subtract two longs -lushr=bitwise shift right of a long +lushr=bitwise shift right of a long lxor=bitwise exclusive or of two longs monitorenter=enter monitor for object ("grab the lock" – start of synchronized() section) monitorexit=exit monitor for object ("release the lock" – end of synchronized() section) -multianewarray=create a new array of -new=create new object of type identified by class reference in constant pool -newarray=create new array with +multianewarray=create a new array of +new=create new object of type identified by class reference in constant pool +newarray=create new array with nop=perform no operation pop=discard the top value on the stack pop2=discard the top two values on the stack (or one value, if it is a double or long) -putfield=set field to -putstatic=set static field to -ret=continue execution from address taken from a local variable +putfield=set field to +putstatic=set static field to +ret=continue execution from address taken from a local variable return=return void from method saload=load short from array sastore=store short to array sipush=push a short onto the stack swap=swaps two top words on the stack (note that value1 and value2 must not be double or long) -tableswitch=continue execution from an address in the table at offset +tableswitch=continue execution from an address in the table at offset wide=execute diff --git a/libr/asm/d/riscv.sdb.txt b/libr/asm/d/riscv.sdb.txt index 172d3c8de5..ca3d8327d1 100644 --- a/libr/asm/d/riscv.sdb.txt +++ b/libr/asm/d/riscv.sdb.txt @@ -18,8 +18,8 @@ amoor.d=atomic memory operation, bitwise OR (64 bits) amoor.w=atomic memory operation, bitwise OR (32 bits) amoswap.d=atomic memory operation, swap (64 bits) amoswap.w=atomic memory operation, swap (32 bits) -amoxor.d=atomic memory operation, -amoxor.w=atomic memory operation, +amoxor.d=atomic memory operation, +amoxor.w=atomic memory operation, and=bitwise and andi=bitwise and with immediate auipc=add upper immediate to PC diff --git a/libr/asm/d/z80.sdb.txt b/libr/asm/d/z80.sdb.txt index 19f6fa0387..18c7748a8b 100644 --- a/libr/asm/d/z80.sdb.txt +++ b/libr/asm/d/z80.sdb.txt @@ -1,72 +1,72 @@ -adc=add with carry register pair -add=add value n to accumulator. -and=logical AND of operand s to accumulator. -bit=test bit b of location. -call=call subroutine at location nn if condition CC is true. -ccf=complement carry flag. -cp=compare operand s with accumulator. -cpd=comapre location (HL) and acc., decrement HL and BC, -cpdr=perform a CPD and repeat until BC -cpi=compare location (HL) and acc., incr HL, decr BC. -cpir=perform a CPI and repeat until BC -cpl=complement accumulator (1's complement). -daa=decimal adjust accumulator. -dec=decrement operand m. -di=disable interrupts. -djnz=decrement B and jump relative if B -ei=enable interrupts. -ex=exchange the location and register. -exx=exchange the contents of BC,DE,HL with BC',DE',HL'. -halt=halt computer and wait for interrupt. -im=set interrupt mode 0,1 or 2. -in=load the accumulator with input from device n or (C). -inc=increment location. -ind=input from port (C). Decrement HL and B. -indr=perform an IND and repeat until B -ini=input from port (C). HL -inir=perform an INI and repeat until B -jp=unconditional jump to location (HL IY or IX). -jr=c,e Jump relative to PC+e if carry -jr=e Unconditional jump relative to PC+e. -jr=nc,e Jump relative to PC+e if carry -jr=nz,e Jump relative to PC+e if non zero (Z -jr=z,e Jump relative to PC+e if zero (Z -ld=Load accumulator, register or location . -ldd=load location (DE) with location (HL), decrement DE,HL,BC. -lddr=perform an LDD and repeat until BC -ldi=load location (DE) with location (HL), incr DE,HL; decr BC. -ldir=perform an LDI and repeat until BC -neg=negate accumulator (2's complement). -nop=no operation -or=logical OR of operand and accumulator. -otdr=perform an OUTD and repeat until B -otir=perform an OTI and repeat until B -out=(c),r Load output port (C) with register r. -out=(n),a Load output port (n) with accumulator. -outd=load output port (C) with (HL), decrement HL and B. -outi=load output port (C) with (HL), incr HL, decr B. -pop=load IX or IY with top of stack or Load register pair qq with top of stack. -push=load IX or IY or Load register pair qq onto stack. -res=b,m Reset bit b of operand m. -ret=return from subroutine. with cc Return from subroutine if condition cc is true. -reti=return from interrupt. -retn=return from non-maskable interrupt. -rl=rotate left through operand m. -rla=rotate left accumulator through carry. -rlc=(hl,ix+d or IY+d) Rotate location left circular. -rlca=rotate left circular accumulator. -rld=rotate digit left and right between accumulator and (HL). -rr=rotate right through carry operand m. -rra=rotate right accumulator through carry. -rrc=rotate operand m right circular. -rrca=rotate right circular accumulator. -rrd=rotate digit right and left between accumulator and (HL) -rst=restart to location p. -sbc=a,s or HL,ss Subtract operands from accumulator with carry. -scf=set carry flag (C -set=b,(hl or IX+d or IY+d) Set bit b of location. -sla=shift operand left arithmetic. -sra=shift operand right arithmetic. -srl=shift operand right logical. -sub=subtract operand from accumulator. -xor=exclusive OR operand and accumulator. +adc=add with carry register pair +add=add value n to accumulator. +and=logical AND of operand s to accumulator. +bit=test bit b of location. +call=call subroutine at location nn if condition CC is true. +ccf=complement carry flag. +cp=compare operand s with accumulator. +cpd=comapre location (HL) and acc., decrement HL and BC, +cpdr=perform a CPD and repeat until BC +cpi=compare location (HL) and acc., incr HL, decr BC. +cpir=perform a CPI and repeat until BC +cpl=complement accumulator (1's complement). +daa=decimal adjust accumulator. +dec=decrement operand m. +di=disable interrupts. +djnz=decrement B and jump relative if B +ei=enable interrupts. +ex=exchange the location and register. +exx=exchange the contents of BC,DE,HL with BC',DE',HL'. +halt=halt computer and wait for interrupt. +im=set interrupt mode 0,1 or 2. +in=load the accumulator with input from device n or (C). +inc=increment location. +ind=input from port (C). Decrement HL and B. +indr=perform an IND and repeat until B +ini=input from port (C). HL +inir=perform an INI and repeat until B +jp=unconditional jump to location (HL IY or IX). +jr=c,e Jump relative to PC+e if carry +jr=e Unconditional jump relative to PC+e. +jr=nc,e Jump relative to PC+e if carry +jr=nz,e Jump relative to PC+e if non zero (Z +jr=z,e Jump relative to PC+e if zero (Z +ld=Load accumulator, register or location . +ldd=load location (DE) with location (HL), decrement DE,HL,BC. +lddr=perform an LDD and repeat until BC +ldi=load location (DE) with location (HL), incr DE,HL; decr BC. +ldir=perform an LDI and repeat until BC +neg=negate accumulator (2's complement). +nop=no operation +or=logical OR of operand and accumulator. +otdr=perform an OUTD and repeat until B +otir=perform an OTI and repeat until B +out=(c),r Load output port (C) with register r. +out=(n),a Load output port (n) with accumulator. +outd=load output port (C) with (HL), decrement HL and B. +outi=load output port (C) with (HL), incr HL, decr B. +pop=load IX or IY with top of stack or Load register pair qq with top of stack. +push=load IX or IY or Load register pair qq onto stack. +res=b,m Reset bit b of operand m. +ret=return from subroutine. with cc Return from subroutine if condition cc is true. +reti=return from interrupt. +retn=return from non-maskable interrupt. +rl=rotate left through operand m. +rla=rotate left accumulator through carry. +rlc=(hl,ix+d or IY+d) Rotate location left circular. +rlca=rotate left circular accumulator. +rld=rotate digit left and right between accumulator and (HL). +rr=rotate right through carry operand m. +rra=rotate right accumulator through carry. +rrc=rotate operand m right circular. +rrca=rotate right circular accumulator. +rrd=rotate digit right and left between accumulator and (HL) +rst=restart to location p. +sbc=a,s or HL,ss Subtract operands from accumulator with carry. +scf=set carry flag (C +set=b,(hl or IX+d or IY+d) Set bit b of location. +sla=shift operand left arithmetic. +sra=shift operand right arithmetic. +srl=shift operand right logical. +sub=subtract operand from accumulator. +xor=exclusive OR operand and accumulator. diff --git a/libr/asm/p/asm_arm_v35.c b/libr/asm/p/asm_arm_v35.c index 6383740f47..b4e9d3fa2b 100644 --- a/libr/asm/p/asm_arm_v35.c +++ b/libr/asm/p/asm_arm_v35.c @@ -21,7 +21,7 @@ static int disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, int len) { return -1; } ut32 n = r_read_le32 (buf); - // FailureCodes + // FailureCodes int fc = aarch64_decompose (n, &inst, a->pc); if (fc != DISASM_SUCCESS) { return -1; diff --git a/libr/asm/p/asm_snes.h b/libr/asm/p/asm_snes.h index 40cba9e1cf..e583200768 100644 --- a/libr/asm/p/asm_snes.h +++ b/libr/asm/p/asm_snes.h @@ -2,7 +2,7 @@ #define ASM_P_ASM_SNES_H struct snes_asm_flags { - unsigned char M; + unsigned char M; unsigned char X; }; diff --git a/libr/asm/p/asm_x86_nz.c b/libr/asm/p/asm_x86_nz.c index 74fb0eeb63..679a94b792 100644 --- a/libr/asm/p/asm_x86_nz.c +++ b/libr/asm/p/asm_x86_nz.c @@ -137,7 +137,7 @@ typedef struct Opcode_t { } Opcode; static bool immediate_out_of_range(int bits, ut64 immediate) { - return bits == 32 && (immediate >> 32); + return bits == 32 && (immediate >> 32); } static inline bool is_debug_or_control(Operand op) { diff --git a/libr/asm/p/mcore.mk b/libr/asm/p/mcore.mk index dc1f80c510..c59b6fe389 100644 --- a/libr/asm/p/mcore.mk +++ b/libr/asm/p/mcore.mk @@ -10,5 +10,5 @@ ALL_TARGETS+=${TARGET_MCORE} ${TARGET_MCORE}: ${OBJ_MCORE} ${CC} -o ${TARGET_MCORE} ${OBJ_MCORE} \ - $(call libname,asm_mcore) ${LDFLAGS} ${CFLAGS} + $(call libname,asm_mcore) ${LDFLAGS} ${CFLAGS} endif diff --git a/libr/asm/p/ppc_cs.mk b/libr/asm/p/ppc_cs.mk index 86c26ab41b..69e72dc3b3 100644 --- a/libr/asm/p/ppc_cs.mk +++ b/libr/asm/p/ppc_cs.mk @@ -14,5 +14,5 @@ ALL_TARGETS+=${TARGET_PPCCS} ${TARGET_PPCCS}: ${OBJ_PPCCS} ${CC} -o ${TARGET_PPCCS} ${OBJ_PPCCS} \ $(call libname,asm_ppc_cs) ${LDFLAGS} ${CFLAGS} \ - ${SHARED2_PPCCS} ${CS_LDFLAGS} + ${SHARED2_PPCCS} ${CS_LDFLAGS} endif diff --git a/libr/bin/format/elf/elf.c b/libr/bin/format/elf/elf.c index bb6a15c99c..bad286c879 100644 --- a/libr/bin/format/elf/elf.c +++ b/libr/bin/format/elf/elf.c @@ -230,7 +230,7 @@ ut64 Elf_(r_bin_elf_get_phnum)(ELFOBJ *obj) { ut64 num = obj->ehdr.e_phnum & UT16_MAX; if (obj->ehdr.e_phnum == 0xffff) { ut32 shnum = obj->ehdr.e_shnum; - // sh_info member of the initial entry in section header table. + // sh_info member of the initial entry in section header table. if (shnum > 0) { ut32 shoff = obj->ehdr.e_shoff; Elf_(Shdr) shdr = {0}; diff --git a/libr/bin/format/elf/elf.h b/libr/bin/format/elf/elf.h index 32d84d5d71..58215c729f 100644 --- a/libr/bin/format/elf/elf.h +++ b/libr/bin/format/elf/elf.h @@ -187,7 +187,7 @@ char* Elf_(r_bin_elf_get_arch)(struct Elf_(r_bin_elf_obj_t) *bin); char* Elf_(r_bin_elf_get_machine_name)(struct Elf_(r_bin_elf_obj_t) *bin); char* Elf_(r_bin_elf_get_head_flag)(ELFOBJ *bin); //yin char* Elf_(r_bin_elf_get_abi)(ELFOBJ *bin); -char* Elf_(r_bin_elf_get_cpu)(ELFOBJ *bin); +char* Elf_(r_bin_elf_get_cpu)(ELFOBJ *bin); char* Elf_(r_bin_elf_get_file_type)(struct Elf_(r_bin_elf_obj_t) *bin); char* Elf_(r_bin_elf_get_elf_class)(struct Elf_(r_bin_elf_obj_t) *bin); int Elf_(r_bin_elf_get_bits)(struct Elf_(r_bin_elf_obj_t) *bin); diff --git a/libr/bin/format/elf/elf_write.c b/libr/bin/format/elf/elf_write.c index f171b661f4..ac2fbe00e7 100644 --- a/libr/bin/format/elf/elf_write.c +++ b/libr/bin/format/elf/elf_write.c @@ -46,7 +46,7 @@ ut64 Elf_(r_bin_elf_resize_section)(RBinFile *bf, const char *name, ut64 size) { eprintf ("Cannot find section\n"); return 0; } - + eprintf ("delta: %"PFMT64d"\n", delta); /* rewrite rel's (imports) */ @@ -128,12 +128,12 @@ ut64 Elf_(r_bin_elf_resize_section)(RBinFile *bf, const char *name, ut64 size) { /* rewrite program headers */ for (i = 0, phdrp = phdr; i < ehdr->e_phnum; i++, phdrp++) { -#if 0 +#if 0 if (phdrp->p_offset < rsz_offset && phdrp->p_offset + phdrp->p_filesz > rsz_offset) { phdrp->p_filesz += delta; phdrp->p_memsz += delta; } -#endif +#endif if (phdrp->p_offset >= rsz_offset + rsz_osize) { phdrp->p_offset += delta; if (phdrp->p_vaddr) { @@ -145,7 +145,7 @@ ut64 Elf_(r_bin_elf_resize_section)(RBinFile *bf, const char *name, ut64 size) { } else if (phdrp->p_offset + phdrp->p_filesz >= rsz_offset + rsz_osize) { phdrp->p_filesz += delta; phdrp->p_memsz += delta; - } + } off = ehdr->e_phoff + i * sizeof (Elf_(Phdr)); if (r_buf_write_at (bin->b, off, (ut8 *)phdrp, sizeof (Elf_ (Phdr))) == -1) { perror ("write (phdr)"); diff --git a/libr/bin/format/le/le_specs.h b/libr/bin/format/le/le_specs.h index 74444b6856..14a4e7e0e1 100644 --- a/libr/bin/format/le/le_specs.h +++ b/libr/bin/format/le/le_specs.h @@ -34,7 +34,7 @@ typedef enum { LE_RT_FD = 21, /* DBCS uniq/font driver */ } LE_resource_type; -// This bit signifies that additional information is contained in the linear EXE module +// This bit signifies that additional information is contained in the linear EXE module // and will be used in the future for parameter type checking. #define ENTRY_PARAMETER_TYPING_PRESENT 0x80 diff --git a/libr/bin/format/mach0/mach0.c b/libr/bin/format/mach0/mach0.c index fdd94d7c05..e301f2e7f0 100644 --- a/libr/bin/format/mach0/mach0.c +++ b/libr/bin/format/mach0/mach0.c @@ -395,15 +395,15 @@ static bool parse_segments(struct MACH0_(obj_t) *bin, ut64 off) { i += 16; memcpy (&bin->sects[k].segname, &sec[i], 16); i += 16; - snprintf (section_flagname, sizeof (section_flagname), "mach0_section_%.16s_%.16s.offset", + snprintf (section_flagname, sizeof (section_flagname), "mach0_section_%.16s_%.16s.offset", bin->sects[k].segname, bin->sects[k].sectname); sdb_num_set (bin->kv, section_flagname, offset, 0); #if R_BIN_MACH064 - snprintf (section_flagname, sizeof (section_flagname), "mach0_section_%.16s_%.16s.format", + snprintf (section_flagname, sizeof (section_flagname), "mach0_section_%.16s_%.16s.format", bin->sects[k].segname, bin->sects[k].sectname); sdb_set (bin->kv, section_flagname, "mach0_section64", 0); #else - snprintf (section_flagname, sizeof (section_flagname), "mach0_section_%.16s_%.16s.format", + snprintf (section_flagname, sizeof (section_flagname), "mach0_section_%.16s_%.16s.format", bin->sects[k].segname, bin->sects[k].sectname); sdb_set (bin->kv, section_flagname, "mach0_section", 0); #endif diff --git a/libr/bin/format/ne/ne.c b/libr/bin/format/ne/ne.c index fd45f7d441..8cd70dffa1 100644 --- a/libr/bin/format/ne/ne.c +++ b/libr/bin/format/ne/ne.c @@ -240,7 +240,7 @@ static char *__resource_type_str(int type) { case 24: typeName = "MANIFEST"; break; - default: + default: return r_str_newf ("UNKNOWN (%d)", type); } return strdup (typeName); @@ -281,7 +281,7 @@ static bool __ne_get_resources(r_bin_ne_obj_t *bin) { break; } else if (ti.rtTypeID & 0x8000) { res->name = __resource_type_str (ti.rtTypeID & ~0x8000); - } else { + } else { // Offset to resident name table res->name = __read_nonnull_str_at (bin->buf, (ut64)resoff + ti.rtTypeID); } diff --git a/libr/bin/format/omf/omf.h b/libr/bin/format/omf/omf.h index 0ace48bbc9..0bdd159c7e 100644 --- a/libr/bin/format/omf/omf.h +++ b/libr/bin/format/omf/omf.h @@ -25,7 +25,7 @@ typedef struct OMF_DATA{ struct OMF_DATA *next; } OMF_data; -// sections return by the plugin are the addr of datas because sections are +// sections return by the plugin are the addr of datas because sections are // separate on non contiguous block on the omf file typedef struct { ut32 name_idx; diff --git a/libr/bin/format/pe/pe.c b/libr/bin/format/pe/pe.c index 119e1a0be4..2b9748cdce 100644 --- a/libr/bin/format/pe/pe.c +++ b/libr/bin/format/pe/pe.c @@ -155,7 +155,7 @@ struct r_bin_pe_addr_t *PE_(check_msvcseh)(struct PE_(r_bin_pe_obj_t) *bin) { } } - // MSVC 32bit debug + // MSVC 32bit debug if (b[3] == 0xe8) { // 55 push ebp // 8B EC mov ebp, esp @@ -177,7 +177,7 @@ struct r_bin_pe_addr_t *PE_(check_msvcseh)(struct PE_(r_bin_pe_obj_t) *bin) { // E8 xx xx xx xx call xxxxxxxx <- Follow this // 89 xx xx mov dword [xxxx], eax // E8 xx xx xx xx call xxxxxxxx - if (b[n] == 0xe8 && n + 8 <= sizeof (b) && !memcmp (b + n + 5, "\x83\xc4\x04", 3) + if (b[n] == 0xe8 && n + 8 <= sizeof (b) && !memcmp (b + n + 5, "\x83\xc4\x04", 3) && b[n + 8] == 0xe8 && b[n + 13] == 0x89 && b[n + 16] == 0xe8) { follow_offset (entry, bin->b, b, sizeof (b), bin->big_endian, n + 8); int j, calls = 0; diff --git a/libr/bin/format/pyc/marshal.c b/libr/bin/format/pyc/marshal.c index ca9f09a101..5c49546895 100644 --- a/libr/bin/format/pyc/marshal.c +++ b/libr/bin/format/pyc/marshal.c @@ -773,7 +773,7 @@ static pyc_object *copy_object(pyc_object *object) { copy->type = object->type; if ((int)object->type == 0) { // do nothing - } else + } else switch (object->type) { case TYPE_NULL: break; diff --git a/libr/bin/format/qnx/qnx.h b/libr/bin/format/qnx/qnx.h index a240effa54..ca9db0b103 100644 --- a/libr/bin/format/qnx/qnx.h +++ b/libr/bin/format/qnx/qnx.h @@ -1,4 +1,4 @@ -/* radare - LGPL - 2019 - deepakchethan */ +/* radare - LGPL - 2019 - deepakchethan */ #ifndef _QNX_H #define _QNX_H @@ -85,4 +85,4 @@ typedef struct { lmf_rw_end rwend; }) QnxObj; -#endif \ No newline at end of file +#endif diff --git a/libr/bin/format/qnx/qnx_specs.h b/libr/bin/format/qnx/qnx_specs.h index 0a0c264d34..924627c4e5 100644 --- a/libr/bin/format/qnx/qnx_specs.h +++ b/libr/bin/format/qnx/qnx_specs.h @@ -7,7 +7,7 @@ #define QNX_MAX_REC_SIZE (0x8000 - 512) // was 0xFFFF #define QNX_MAX_DATA_SIZE (QNX_MAX_REC_SIZE - sizeof(lmf_data)) #define VERIFY_END (VERIFY_OFFSET + sizeof(RWEndRec.verify)) -#define QNX_MAX_FIXUPS (0x8000 - 512) +#define QNX_MAX_FIXUPS (0x8000 - 512) #define QNX_MAGIC "\x00\x00\x38\x00\x00\x00" #define QNX_HDR_SIZE sizeof (lmf_header) @@ -24,4 +24,4 @@ #define LINEAR32_CODE_FIXUP 0x80000000 #define LINEAR32_SELF_RELATIVE_FIXUP 0x40000000 -#endif \ No newline at end of file +#endif diff --git a/libr/bin/format/xbe/xbe.h b/libr/bin/format/xbe/xbe.h index 7bb35ae942..95dbd16b6f 100644 --- a/libr/bin/format/xbe/xbe.h +++ b/libr/bin/format/xbe/xbe.h @@ -68,6 +68,6 @@ typedef struct { xbe_header header; int kt_key; int ep_key; -} r_bin_xbe_obj_t; +} r_bin_xbe_obj_t; diff --git a/libr/bin/mangling/cxx/Makefile b/libr/bin/mangling/cxx/Makefile index 8c4225a4a0..0ae2652385 100644 --- a/libr/bin/mangling/cxx/Makefile +++ b/libr/bin/mangling/cxx/Makefile @@ -1,5 +1,5 @@ all: - emcc -z -o cxx.js -I. *.c -s EXPORTED_FUNCTIONS='["_cxx","cwrap"]' -DMY_EMSCRIPTEN=1 -s MODULARIZE=1 -s EXPORT_NAME=Demangle -s "EXTRA_EXPORTED_RUNTIME_METHODS=['cwrap']" + emcc -z -o cxx.js -I. *.c -s EXPORTED_FUNCTIONS='["_cxx","cwrap"]' -DMY_EMSCRIPTEN=1 -s MODULARIZE=1 -s EXPORT_NAME=Demangle -s "EXTRA_EXPORTED_RUNTIME_METHODS=['cwrap']" sync: rm -f demangle.h cp-demangle.c cp-demangle.h diff --git a/libr/bin/mangling/cxx/ansidecl.h b/libr/bin/mangling/cxx/ansidecl.h index 2115ba2595..1fd0164aa3 100644 --- a/libr/bin/mangling/cxx/ansidecl.h +++ b/libr/bin/mangling/cxx/ansidecl.h @@ -170,7 +170,7 @@ So instead we use the macro below and test it against specific values. */ #define VA_OPEN(AP, VAR) { va_list AP; va_start(AP, VAR); { struct Qdmy #define VA_CLOSE(AP) } va_end(AP); } #define VA_FIXEDARG(AP, T, N) struct Qdmy - + #undef const #undef volatile #undef signed diff --git a/libr/bin/mangling/cxx/cp-demangle.c b/libr/bin/mangling/cxx/cp-demangle.c index 7cc2448e7a..ef6dbd96b0 100644 --- a/libr/bin/mangling/cxx/cp-demangle.c +++ b/libr/bin/mangling/cxx/cp-demangle.c @@ -25,7 +25,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ /* This code implements a demangler for the g++ V3 ABI. The ABI is @@ -1599,7 +1599,7 @@ d_prefix (struct d_info *di) /* ::= ::= ::= - ::= + ::= ::= L */ @@ -2611,7 +2611,7 @@ cplus_demangle_type (struct d_info *di) ret = NULL; can_subst = 1; break; - + case 'p': /* Pack expansion. */ ret = d_make_comp (di, DEMANGLE_COMPONENT_PACK_EXPANSION, @@ -4410,7 +4410,7 @@ d_find_pack (struct d_print_info *dpi, case DEMANGLE_COMPONENT_PACK_EXPANSION: return NULL; - + case DEMANGLE_COMPONENT_LAMBDA: case DEMANGLE_COMPONENT_NAME: case DEMANGLE_COMPONENT_TAGGED_NAME: @@ -6472,7 +6472,7 @@ cplus_demangle_v3_callback (const char *mangled, int options, return d_demangle_callback (mangled, options, callback, opaque); } -/* Demangle a Java symbol. Java uses a subset of the V3 ABI C++ mangling +/* Demangle a Java symbol. Java uses a subset of the V3 ABI C++ mangling conventions, but the output formatting is a little different. This instructs the C++ demangler not to emit pointer characters ("*"), to use Java's namespace separator symbol ("." instead of "::"), and to output @@ -6639,7 +6639,7 @@ print_usage (FILE* fp, int exit_value) } /* Option specification for getopt_long. */ -static const struct option long_options[] = +static const struct option long_options[] = { { "help", no_argument, NULL, 'h' }, { "no-params", no_argument, NULL, 'p' }, @@ -6663,7 +6663,7 @@ main (int argc, char *argv[]) program_name = argv[0]; /* Parse options. */ - do + do { opt_char = getopt_long (argc, argv, "hpv", long_options, NULL); switch (opt_char) @@ -6687,7 +6687,7 @@ main (int argc, char *argv[]) } while (opt_char != -1); - if (optind == argc) + if (optind == argc) /* No command line arguments were provided. Filter stdin. */ { dyn_string_t mangled = dyn_string_new (3); diff --git a/libr/bin/mangling/cxx/cp-demangle.h b/libr/bin/mangling/cxx/cp-demangle.h index 51b8a243e0..41b491f767 100644 --- a/libr/bin/mangling/cxx/cp-demangle.h +++ b/libr/bin/mangling/cxx/cp-demangle.h @@ -25,7 +25,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file provides some definitions shared by cp-demangle.c and diff --git a/libr/bin/mangling/cxx/libiberty.h b/libr/bin/mangling/cxx/libiberty.h index 5c3920ca3e..a450d77cb3 100644 --- a/libr/bin/mangling/cxx/libiberty.h +++ b/libr/bin/mangling/cxx/libiberty.h @@ -2,7 +2,7 @@ Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. - + Note - certain prototypes declared in this header file are for functions whoes implementation copyright does not belong to the FSF. Those prototypes are present in this file for reference @@ -24,7 +24,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. - + Written by Cygnus Support, 1994. The libiberty library provides a number of functions which are @@ -207,7 +207,7 @@ extern char * getpwd (void); #ifdef __MINGW32__ /* Forward declaration to avoid #include . */ struct timeval; -extern int gettimeofday (struct timeval *, void *); +extern int gettimeofday (struct timeval *, void *); #endif /* Get the amount of time the process has run, in microseconds. */ @@ -447,7 +447,7 @@ extern struct pex_obj *pex_init (int flags, const char *pname, /* Capture stderr to a pipe. The output can be read by calling pex_read_err and reading from the returned FILE object. This flag may be specified only for - the last program in a pipeline. + the last program in a pipeline. This flag is supported only on Unix and Windows. */ #define PEX_STDERR_TO_PIPE 0x40 diff --git a/libr/bin/mangling/swift-sd.c b/libr/bin/mangling/swift-sd.c index 6c4d9d3d34..ff49196e2b 100644 --- a/libr/bin/mangling/swift-sd.c +++ b/libr/bin/mangling/swift-sd.c @@ -1,4 +1,4 @@ -/* work-in-progress reverse engineered swift-demangler in C +/* work-in-progress reverse engineered swift-demangler in C * Copyright MIT 2015-2019 * by pancake@nopcode.org */ diff --git a/libr/bin/p/bin_msx.c b/libr/bin/p/bin_msx.c index ba7cb2a8eb..3e671cb681 100644 --- a/libr/bin/p/bin_msx.c +++ b/libr/bin/p/bin_msx.c @@ -158,7 +158,7 @@ static RList *sections(RBinFile *bf) { return ret; } -static RList *entries(RBinFile *bf) { +static RList *entries(RBinFile *bf) { RList *ret = r_list_new (); RBinAddr *ptr = R_NEW0 (RBinAddr); if (!ret || !ptr) { diff --git a/libr/bin/p/bin_tic.c b/libr/bin/p/bin_tic.c index ab453efb87..f54837186b 100644 --- a/libr/bin/p/bin_tic.c +++ b/libr/bin/p/bin_tic.c @@ -14,7 +14,7 @@ #define CHUNK_COVER_DEP 3 // deprecated in 0.90 #define CHUNK_MAP 4 // map data. This is copied to RAM at0x8000...0xFF7F. #define CHUNK_CODE 5 -#define CHUNK_FLAGS 6 // sprite flags data. This is copied to RAM at 0x14404...0x14603. +#define CHUNK_FLAGS 6 // sprite flags data. This is copied to RAM at 0x14404...0x14603. #define CHUNK_SAMPLES 9 // SFX. This is copied to RAM at0x100E4...0x11163. #define CHUNK_WAVEFORM 10 // This is copied to RAM at0x0FFE4...0x100E3. #define CHUNK_PALETTE 12 // The SCN palette is copied to RAM at0x3FC0...0x3FEF. @@ -107,7 +107,7 @@ static bool check_buffer(RBinFile *bf, RBuffer *buf) { case CHUNK_SCREEN: #if 0 eprintf ("BANK %d CHUNK %2d (%s) LENGTH %d\n", - bank_number, chunk_type, + bank_number, chunk_type, chunk_name (chunk_type), chunk_length); #endif break; @@ -261,7 +261,7 @@ static RList *sections(RBinFile *bf) { } #if 0 eprintf ("BANK %d CHUNK %2d (%s) LENGTH %d\n", - bank_number, chunk_type, + bank_number, chunk_type, chunk_name (chunk_type), chunk_length); #endif break; diff --git a/libr/bin/p/bin_write_mach0.c b/libr/bin/p/bin_write_mach0.c index 6e6ae37ca9..8a9d83d1e0 100644 --- a/libr/bin/p/bin_write_mach0.c +++ b/libr/bin/p/bin_write_mach0.c @@ -26,7 +26,7 @@ static MachoPointers findLastCommand(RBinFile *bf) { ut32 loadc[2] = {0}; r_buf_read_at (bin->b, off, (ut8*)&loadc, sizeof (loadc)); //r_buf_seek (bin->b, off, R_BUF_SET); - int len = loadc[1]; // r_buf_read_le32 (loadc[1]); // bin->b); // + int len = loadc[1]; // r_buf_read_le32 (loadc[1]); // bin->b); // if (len < 1) { eprintf ("Error: read (lc) at 0x%08"PFMT64x"\n", off); break; diff --git a/libr/bin/p/java.mk b/libr/bin/p/java.mk index e5ebb1db99..577c25f76f 100644 --- a/libr/bin/p/java.mk +++ b/libr/bin/p/java.mk @@ -1,4 +1,4 @@ -OBJ_JAVA=bin_java.o +OBJ_JAVA=bin_java.o SHARED2_JAVA=$(addprefix ../,${SHARED_JAVA}) diff --git a/libr/bin/p/mach0.mk b/libr/bin/p/mach0.mk index 001fdb0f4e..dcdcf9c7ef 100644 --- a/libr/bin/p/mach0.mk +++ b/libr/bin/p/mach0.mk @@ -10,4 +10,4 @@ ALL_TARGETS+=${TARGET_MACH0} ${TARGET_MACH0}: ${OBJ_MACH0} -${CC} $(call libname,bin_mach0) ${CFLAGS} \ ${OBJ_MACH0} ${SHLR}/sdb/src/libsdb.a \ - $(LINK) $(LDFLAGS) + $(LINK) $(LDFLAGS) diff --git a/libr/bin/p/qnx.mk b/libr/bin/p/qnx.mk index 00521fa066..a277308a98 100644 --- a/libr/bin/p/qnx.mk +++ b/libr/bin/p/qnx.mk @@ -1,4 +1,4 @@ -OBJ_QNX+=bin_qnx.o +OBJ_QNX+=bin_qnx.o STATIC_OBJ+=${OBJ_QNX} @@ -8,4 +8,4 @@ ALL_TARGETS+=${TARGET_QNX} ${TARGET_QNX}: ${OBJ_QNX} ${CC} $(call libname,bin_qnx) -shared ${CFLAGS} \ - -o ${TARGET_QNX} $(LINK) $(LDFLAGS) \ No newline at end of file + -o ${TARGET_QNX} $(LINK) $(LDFLAGS) diff --git a/libr/bin/p/symbols.mk b/libr/bin/p/symbols.mk index 2e60b0e9cc..7b020cef62 100644 --- a/libr/bin/p/symbols.mk +++ b/libr/bin/p/symbols.mk @@ -9,4 +9,4 @@ ALL_TARGETS+=${TARGET_SYMBOLS} ${TARGET_SYMBOLS}: ${OBJ_SYMBOLS} -${CC} $(call libname,bin_mach0) ${CFLAGS} \ ${OBJ_SYMBOLS} ${SHLR}/sdb/src/libsdb.a \ - $(LINK) $(LDFLAGS) + $(LINK) $(LDFLAGS) diff --git a/libr/bin/pdb/tpi.c b/libr/bin/pdb/tpi.c index 4ff98ab964..a2f7b81af8 100644 --- a/libr/bin/pdb/tpi.c +++ b/libr/bin/pdb/tpi.c @@ -13,14 +13,14 @@ static bool is_simple_type(int idx) { '---------------------------'------'----------' |+32 |+12 |+8 |+0 */ - return value < base_idx; + return value < base_idx; // return ((value & 0x00000000FFF00) <= 0x700 && (value & 0x00000000000FF) < 0x80); } /** * @brief Parses simple type if the idx represents one - * - * @param idx + * + * @param idx * @return STypeInfo, leaf_type = 0 -> error * This can be made smarter by using the masks * and splitting it on 2 parts, 1 mode, 1 type @@ -232,18 +232,18 @@ static STypeInfo parse_simple_type(ut32 idx) { simple_type->type = strdup ("uint16_t *"); break; - case eT_LONG: + case eT_LONG: case eT_INT4: simple_type->size = 4; simple_type->type = strdup ("int32_t"); break; - case eT_PLONG: - case eT_PINT4: + case eT_PLONG: + case eT_PINT4: simple_type->size = 2; simple_type->type = strdup ("int32_t *"); break; - case eT_PFLONG: - case eT_PHLONG: + case eT_PFLONG: + case eT_PHLONG: case eT_32PLONG: case eT_32PFLONG: case eT_PFINT4: @@ -1749,7 +1749,7 @@ static void get_modifier_print_type(void *type, char **name) { r_strbuf_init (&buff); if (modifier->umodifier.bits.const_) { r_strbuf_append (&buff, "const "); - } + } if (modifier->umodifier.bits.volatile_) { r_strbuf_append (&buff, "volatile "); } diff --git a/libr/bin/pdb/types.h b/libr/bin/pdb/types.h index 8bbcb7d37c..0e1a77406c 100644 --- a/libr/bin/pdb/types.h +++ b/libr/bin/pdb/types.h @@ -1014,7 +1014,7 @@ typedef enum { eLF_SKIP = 0x00001200, eLF_ARGLIST = 0x00001201, eLF_DEFARG_ST = 0x00001202, - eLF_FIELDLIST = 0x00001203, + eLF_FIELDLIST = 0x00001203, eLF_DERIVED = 0x00001204, // derived class list leaf eLF_BITFIELD = 0x00001205, // type record for LF_BITFIELD eLF_METHODLIST = 0x00001206, // subfield record for overloaded method list diff --git a/libr/cons/d/ayu b/libr/cons/d/ayu index 3ecf05453a..9d10e2d336 100644 --- a/libr/cons/d/ayu +++ b/libr/cons/d/ayu @@ -37,7 +37,7 @@ ec call rgb:ff7733 # push instructions ec reg rgb:e6e1cf # register names ec ret rgb:d66 # ret opcode ec swi rgb:d66 -ec trap rgb:d66 +ec trap rgb:d66 ec cmp rgb:5de ec push rgb:5de ec math rgb:5de diff --git a/libr/cons/d/focus b/libr/cons/d/focus index 64f219eae4..9a236cbcbc 100644 --- a/libr/cons/d/focus +++ b/libr/cons/d/focus @@ -10,7 +10,7 @@ ec ujmp rgb:ff3 ec ret rgb:f00 ec trap rgb:000 rgb:f00 ec offset rgb:fff -ec prompt byellow +ec prompt byellow ec comment rgb:0cf ec usrcmt rgb:ff0 rgb:06f ec push rgb:f3f @@ -18,9 +18,9 @@ ec pop rgb:f3f bold ec cmp rgb:ff0 rgb:060 ec nop rgb:000 ec b0x00 green -ec b0x7f cyan -ec b0xff red -ec btext yellow +ec b0x7f cyan +ec b0xff red +ec btext yellow ec other rgb:666 ec num rgb:ff0 ec reg rgb:6f0 rgb:000 diff --git a/libr/cons/d/white2 b/libr/cons/d/white2 index 662cc4f2f2..04e799b972 100644 --- a/libr/cons/d/white2 +++ b/libr/cons/d/white2 @@ -42,7 +42,7 @@ ec push rgb:ff7733 # push instructions ec reg rgb:400080 # register names ec ret rgb:F92672 0 bold # ret opcode ec swi rgb:d66 -ec trap rgb:d66 +ec trap rgb:d66 ec ucall rgb:A63A00 0 bold ec ujmp rgb:376B4C 0 bold underline ec usrcmt rgb:007D96 0 bold # user comment diff --git a/libr/cons/stiv.c b/libr/cons/stiv.c index 6a3623f89b..022e335e08 100644 --- a/libr/cons/stiv.c +++ b/libr/cons/stiv.c @@ -56,7 +56,7 @@ static int rgb(int r, int g, int b) { r = R_DIM (r, 0, 255); g = R_DIM (g, 0, 255); b = R_DIM (b, 0, 255); - r = (int)(r/50.6); + r = (int)(r/50.6); g = (int)(g/50.6); b = (int)(b/50.6); return 16 + (r*36) + (g*6) + b; diff --git a/libr/core/cmd.c b/libr/core/cmd.c index e49504fde7..55dbaf80fe 100644 --- a/libr/core/cmd.c +++ b/libr/core/cmd.c @@ -3970,7 +3970,7 @@ repeat_arroba: } r_sys_setenv (k, v); r_list_append (tmpenvs, k); - } + } } free (k); } else if (ptr[1] == '.') { // "@." diff --git a/libr/core/cmd_anal.c b/libr/core/cmd_anal.c index 9b35c903e3..7d474f6890 100644 --- a/libr/core/cmd_anal.c +++ b/libr/core/cmd_anal.c @@ -101,7 +101,7 @@ static const char *help_msg_aaf[] = { "Usage:", "aaf[efrt?]", " # analyse all functionsee also 'af' and 'afna'", "aaf", "", "same as afr@@c:isq", "aafe", " ", "same as aef@@F", - "aaff", "", "set a flag for every function", + "aaff", "", "set a flag for every function", "aafr", " [len]", "consecutive function analysis (e anal.hasnext=1;afr@@c:isq)", "aaft", "", "recursive type matching across all functions", NULL @@ -5137,7 +5137,7 @@ void cmd_anal_reg(RCore *core, const char *str) { if (r) { //eprintf ("%s 0x%08"PFMT64x" -> ", str, // r_reg_get_value (core->dbg->reg, r)); - r_reg_set_value (core->dbg->reg, r, n); + r_reg_set_value (core->dbg->reg, r, n); r_debug_reg_sync (core->dbg, R_REG_TYPE_ALL, true); //eprintf ("0x%08"PFMT64x"\n", // r_reg_get_value (core->dbg->reg, r)); diff --git a/libr/core/cmd_flag.c b/libr/core/cmd_flag.c index 567f862ad2..15f45ada57 100644 --- a/libr/core/cmd_flag.c +++ b/libr/core/cmd_flag.c @@ -1512,7 +1512,7 @@ rep: } flaglist = r_flag_get_list (core->flags, addr); isJson = strchr (input, 'j'); - PJ *pj = pj_new (); + PJ *pj = pj_new (); if (isJson) { pj_a (pj); } @@ -1602,7 +1602,7 @@ rep: if (f->offset != addr) { // if input contains 'j' print json if (strchr (input, 'j')) { - PJ *pj = pj_new (); + PJ *pj = pj_new (); pj_o (pj); pj_kn (pj, "offset", f->offset); pj_ks (pj, "name", f->name); diff --git a/libr/core/cmd_print.c b/libr/core/cmd_print.c index c39a99af12..795876b660 100644 --- a/libr/core/cmd_print.c +++ b/libr/core/cmd_print.c @@ -3160,7 +3160,7 @@ static void cmd_print_pv(RCore *core, const char *input, bool useBytes) { if (!heaped_block) { break; } - r_io_read_at (core->io, core->offset + blockdelta, heaped_block, blocksize); + r_io_read_at (core->io, core->offset + blockdelta, heaped_block, blocksize); block = heaped_block; } ut64 v; diff --git a/libr/core/cmd_search.c b/libr/core/cmd_search.c index e9943037e9..61c6e5a86f 100644 --- a/libr/core/cmd_search.c +++ b/libr/core/cmd_search.c @@ -4077,7 +4077,7 @@ reread: if (input[1] == '?') { r_core_cmd_help (core, help_msg_search_delta); break; - } + } if (input[1]) { r_search_reset (core->search, R_SEARCH_DELTAKEY); r_search_kw_add (core->search, diff --git a/libr/core/cmd_search_rop.c b/libr/core/cmd_search_rop.c index 89482504f4..59979701fd 100644 --- a/libr/core/cmd_search_rop.c +++ b/libr/core/cmd_search_rop.c @@ -615,11 +615,11 @@ static char* rop_classify_arithmetic_const(RCore *core, RList *ropList) { if (value_dst != diff_dst) { r_list_foreach (constants, iter_const, constant) { ut64 value_ct = r_num_get (NULL, constant); - simulate = simulate_op (op, value_src1, value_ct, - diff_src1, value_ct, op_result, + simulate = simulate_op (op, value_src1, value_ct, + diff_src1, value_ct, op_result, item_dst->size); - simulate_r = simulate_op (op, value_ct, value_src1, - value_ct, diff_src1, op_result_r, + simulate_r = simulate_op (op, value_ct, value_src1, + value_ct, diff_src1, op_result_r, item_dst->size); if (simulate && op_result && value_dst == *op_result) { char *tmp = r_str_newf ("%s <-- %s %s %s;", item_dst->name, item_src1->name, op, constant); diff --git a/libr/core/disasm_stackptr.inc b/libr/core/disasm_stackptr.inc index 251088554a..11749f7980 100644 --- a/libr/core/disasm_stackptr.inc +++ b/libr/core/disasm_stackptr.inc @@ -52,7 +52,7 @@ static int _stackptr_range(RDisasmState *ds, ut64 addr, ut64 addr_end, int stack r_anal_op_free (op); } at += sz; - } + } return stackptr; } diff --git a/libr/core/patch.c b/libr/core/patch.c index 94051cffd2..5e5f7c1145 100644 --- a/libr/core/patch.c +++ b/libr/core/patch.c @@ -116,7 +116,7 @@ R_API int r_core_patch(RCore *core, const char *patch) { for (; *p; p++) { /* read until newline */ if (!*p || *p == '\n') { - *p++ = 0; + *p++ = 0; } else { continue; } diff --git a/libr/core/vslides.c b/libr/core/vslides.c index 6cc8b3a0e6..7ee6ef8435 100644 --- a/libr/core/vslides.c +++ b/libr/core/vslides.c @@ -116,7 +116,7 @@ R_API void r_core_visual_slides(RCore *core, const char *file) { } break; case '!': - // + // { r_core_cmdf (core, "vim %s", file); char *ndata = r_file_slurp (file, NULL); diff --git a/libr/crypto/p/crypto_aes_wrap.c b/libr/crypto/p/crypto_aes_wrap.c index 5b13edad40..ba81b22ac0 100644 --- a/libr/crypto/p/crypto_aes_wrap.c +++ b/libr/crypto/p/crypto_aes_wrap.c @@ -1,4 +1,4 @@ -/* radare - LGPL - Copyright 2021 - Sylvain Pelissier +/* radare - LGPL - Copyright 2021 - Sylvain Pelissier Implementation of AES Key Wrap Algorithm (RFC 3394) */ #include diff --git a/libr/crypto/p/crypto_serpent_algo.c b/libr/crypto/p/crypto_serpent_algo.c index 21e5c29cf1..674d639e98 100644 --- a/libr/crypto/p/crypto_serpent_algo.c +++ b/libr/crypto/p/crypto_serpent_algo.c @@ -90,7 +90,7 @@ static void apply_FP(ut32 in[DW_BY_BLOCK], ut32 out[DW_BY_BLOCK]) { } static bool serpent_keyschedule(struct serpent_state st, ut32 subkeys[NB_SUBKEYS * DW_BY_BLOCK]) { - if ((st.key_size != 128) && (st.key_size != 192) + if ((st.key_size != 128) && (st.key_size != 192) && (st.key_size != 256)) { eprintf ("Invalid key size"); return false; @@ -136,7 +136,7 @@ static bool serpent_keyschedule(struct serpent_state st, ut32 subkeys[NB_SUBKEYS // Apply IP on every subkey for (i = 0; i < NB_SUBKEYS; i++) { - apply_IP (&subkeys[i * DW_BY_BLOCK], + apply_IP (&subkeys[i * DW_BY_BLOCK], &tmpkeys[DW_BY_USERKEY + i * DW_BY_BLOCK]); } @@ -155,7 +155,7 @@ static void apply_permut(ut32 block[DW_BY_BLOCK]) { ut32 tmp_block[DW_BY_BLOCK] = {0}; apply_FP (block, tmp_block); rotl (tmp_block + 0, 13); - rotl (tmp_block + 2, 3); + rotl (tmp_block + 2, 3); tmp_block[1] ^= tmp_block[0] ^ tmp_block[2]; tmp_block[3] ^= tmp_block[2] ^ (tmp_block[0] << 3); rotl (tmp_block + 1, 1); @@ -178,7 +178,7 @@ static void apply_permut_inv(ut32 block[DW_BY_BLOCK]) { rotr (tmp_block + 1, 1); tmp_block[3] ^= tmp_block[2] ^ (tmp_block[0] << 3); tmp_block[1] ^= tmp_block[0] ^ tmp_block[2]; - rotr (tmp_block + 2, 3); + rotr (tmp_block + 2, 3); rotr (tmp_block + 0, 13); apply_IP (tmp_block, block); } @@ -189,7 +189,7 @@ static void apply_round(int round, ut32 block[DW_BY_BLOCK], ut32 subkeys[DW_BY_B apply_xor (block, subkeys + 4 * round); for (i = 0; i < DW_BY_BLOCK; i++) { - ut32 res = 0; + ut32 res = 0; for (j = 0; j < 8; j++) { res |= apply_sbox (round % 8, (block[i] >> 4 * j) & 0xf) << 4 * j; } @@ -203,7 +203,7 @@ static void apply_round(int round, ut32 block[DW_BY_BLOCK], ut32 subkeys[DW_BY_B } } -static void apply_round_inv(int round, ut32 block[DW_BY_BLOCK], +static void apply_round_inv(int round, ut32 block[DW_BY_BLOCK], ut32 subkeys[DW_BY_BLOCK*NB_SUBKEYS]) { if (round == NB_ROUNDS - 1) { apply_xor (block, subkeys + 4 * (round + 1)); @@ -215,7 +215,7 @@ static void apply_round_inv(int round, ut32 block[DW_BY_BLOCK], ut32 res; for (i = 0; i < DW_BY_BLOCK; i++) { - res = 0; + res = 0; for (j = 0; j < 8; j++) { res |= apply_sbox_inv (round%8, (block[i] >> 4 * j) & 0xf) << 4 * j; } @@ -225,7 +225,7 @@ static void apply_round_inv(int round, ut32 block[DW_BY_BLOCK], apply_xor (block, subkeys + 4 * round); } -void serpent_encrypt(struct serpent_state *st, ut32 in[DW_BY_BLOCK], +void serpent_encrypt(struct serpent_state *st, ut32 in[DW_BY_BLOCK], ut32 out[DW_BY_BLOCK]) { int i; ut32 subkeys[DW_BY_BLOCK * NB_SUBKEYS] = {0}; diff --git a/libr/debug/p/native/arm.c b/libr/debug/p/native/arm.c index dd286d051c..dd8999baa4 100644 --- a/libr/debug/p/native/arm.c +++ b/libr/debug/p/native/arm.c @@ -75,7 +75,7 @@ int armflag_F = (Cpsr>>6)&1; int armflag_T = (Cpsr>>5)&1; int armflag_M = (Cpsr>>0)&15; - state: JT bits: + state: JT bits: ARM 0 (t) 0 (j) Thumb 1 (T) 0 (j) Btecode 0 (t) 1 (J) diff --git a/libr/debug/p/native/darwin.c b/libr/debug/p/native/darwin.c index c1e023c26c..cb6f748fb4 100644 --- a/libr/debug/p/native/darwin.c +++ b/libr/debug/p/native/darwin.c @@ -23,7 +23,7 @@ int pids_sons_of_r(int pid, int recursive, int limit) { char tmp2[1024]; struct dirent *file; DIR *dh; - + if (pid < 1) return false; dh = opendir ("/proc/"); diff --git a/libr/debug/p/native/linux/reg/linux-s390x.h b/libr/debug/p/native/linux/reg/linux-s390x.h index 426a49b0bb..518ace895b 100644 --- a/libr/debug/p/native/linux/reg/linux-s390x.h +++ b/libr/debug/p/native/linux/reg/linux-s390x.h @@ -11,7 +11,7 @@ r3 argument 1 / return value 1 (if long long) call-clobbered r4 argument 2 call-clobbered r5 argument 3 call-clobbered r6 argument 4 saved -r7 pointer-to arguments 5 to ... saved +r7 pointer-to arguments 5 to ... saved r8 this & that saved r9 this & that saved r10 static-chain ( if nested function ) saved @@ -32,7 +32,7 @@ f1,f3,f5 f7-f15 are call-clobbered. The current architectures have the following registers. - + 16 General propose registers, 32 bit on s/390 and 64 bit on z/Architecture, r0-r15 (or gpr0-gpr15), used for arithmetic and addressing. @@ -49,8 +49,8 @@ Access register 0 (and access register 1 on z/Architecture, which needs a 64 bit pointer) is currently used by the pthread library as a pointer to the current running threads private area. -16 64 bit floating point registers (fp0-fp15 ) IEEE & HFP floating -point format compliant on G5 upwards & a Floating point control reg (FPC) +16 64 bit floating point registers (fp0-fp15 ) IEEE & HFP floating +point format compliant on G5 upwards & a Floating point control reg (FPC) 4 64 bit registers (fp0,fp2,fp4 & fp6) HFP only on older machines. Note: Linux (currently) always uses IEEE & emulates G5 IEEE format on older machines, diff --git a/libr/debug/p/native/maps/darwin.c b/libr/debug/p/native/maps/darwin.c index fda0f13fc2..c86c3c70d4 100644 --- a/libr/debug/p/native/maps/darwin.c +++ b/libr/debug/p/native/maps/darwin.c @@ -148,7 +148,7 @@ static RList *ios_dbg_maps(RDebug *dbg) { info.inheritance? " inherit": "", info.is_submap ? " submap": "", module_name, depth); - //info.shared ? "shar" : "priv", + //info.shared ? "shar" : "priv", //info.reserved ? "reserved" : "not-reserved", //""); //module_name); mr = r_debug_map_new (buf, address, address+size, @@ -318,7 +318,7 @@ static RList *darwin_dbg_maps(RDebug *dbg) { const char *osname = dbg->anal->syscall->os; if (osname && !strcmp (osname, "ios")) { return ios_dbg_maps (dbg); - } + } return osx_dbg_maps (dbg); #endif } diff --git a/libr/debug/p/native/windows/windows_debug.c b/libr/debug/p/native/windows/windows_debug.c index b6a3a1dd44..da237295df 100644 --- a/libr/debug/p/native/windows/windows_debug.c +++ b/libr/debug/p/native/windows/windows_debug.c @@ -460,7 +460,7 @@ static char *__get_file_name_from_handle(HANDLE handle_file) { } } cur_drive++; - } + } err_get_file_name_from_handle: if (map) { UnmapViewOfFile (map); diff --git a/libr/debug/p/native/xnu/xnu_debug.c b/libr/debug/p/native/xnu/xnu_debug.c index e686001f1f..73601c6b48 100644 --- a/libr/debug/p/native/xnu/xnu_debug.c +++ b/libr/debug/p/native/xnu/xnu_debug.c @@ -646,7 +646,7 @@ int xnu_get_vmmap_entries_for_pid(pid_t pid) { if (info.is_submap) { nesting_depth++; } else { - address += size; + address += size; n++; } } @@ -660,7 +660,7 @@ int xnu_get_vmmap_entries_for_pid(pid_t pid) { segment_count * segment_command_sz + thread_count * \ sizeof (struct thread_command) + tstate_size * thread_count -static void get_mach_header_sizes(size_t *mach_header_sz, +static void get_mach_header_sizes(size_t *mach_header_sz, size_t *segment_command_sz) { #if __ppc64__ || __x86_64__ *mach_header_sz = sizeof (struct mach_header_64); @@ -711,11 +711,11 @@ static void xnu_build_corefile_header(vm_offset_t header, int segment_count, int mh64 = (struct mach_header_64 *)header; mh64->magic = MH_MAGIC_64; mh64->cputype = xnu_get_cpu_type (pid); - mh64->cpusubtype = xnu_get_cpu_subtype (); + mh64->cpusubtype = xnu_get_cpu_subtype (); mh64->filetype = MH_CORE; mh64->ncmds = segment_count + thread_count; mh64->sizeofcmds = command_size; - mh64->reserved = 0; // 8-byte alignment + mh64->reserved = 0; // 8-byte alignment #elif __i386__ || __ppc__ || __POWERPC__ struct mach_header *mh; mh = (struct mach_header *)header; @@ -772,7 +772,7 @@ static int xnu_write_mem_maps_to_buffer (RBuffer *buffer, RList *mem_maps, int s struct segment_command *sc; #endif r_list_foreach_safe (mem_maps, iter, iter2, curr_map) { - eprintf ("Writing section from 0x%"PFMT64x" to 0x%"PFMT64x" (%"PFMT64d")\n", + eprintf ("Writing section from 0x%"PFMT64x" to 0x%"PFMT64x" (%"PFMT64d")\n", curr_map->addr, curr_map->addr_end, curr_map->size); vm_map_offset_t vmoffset = curr_map->addr; @@ -859,7 +859,7 @@ cleanup: return error; } -static int xnu_get_thread_status (register thread_t thread, int flavor, +static int xnu_get_thread_status (register thread_t thread, int flavor, thread_state_t tstate, mach_msg_type_number_t *count) { return thread_get_state (thread, flavor, tstate, count); } @@ -969,7 +969,7 @@ bool xnu_generate_corefile (RDebug *dbg, RBuffer *dest) { (flavors[i].count * sizeof(int)); } - command_size = COMMAND_SIZE (segment_count,segment_command_sz, + command_size = COMMAND_SIZE (segment_count,segment_command_sz, r_list_length (threads_list), tstate_size); header_size = command_size + mach_header_sz; // XXX: Add here the round_page() ? header = (vm_offset_t)calloc (1, header_size); diff --git a/libr/debug/p/rap.mk b/libr/debug/p/rap.mk index 9bc99ce1b8..35427029ac 100644 --- a/libr/debug/p/rap.mk +++ b/libr/debug/p/rap.mk @@ -6,7 +6,7 @@ ifeq (${OSTYPE},solaris) LDFLAGS+=-lsocket endif -OBJ_RAP=debug_rap.o +OBJ_RAP=debug_rap.o STATIC_OBJ+=${OBJ_RAP} TARGET_RAP=debug_rap.${EXT_SO} diff --git a/libr/egg/README b/libr/egg/README index d8fcb37e3d..52018ca857 100644 --- a/libr/egg/README +++ b/libr/egg/README @@ -173,7 +173,7 @@ Traps ----- Each architecture have a different instruction to break the execution of the program. REgg language captures calls to 'break()' to run the emit_trap -callback of the selected arch. The +callback of the selected arch. The break(); --> compiles into 'int3' on x86 break; --> compiles into 'int3' on x86 @@ -202,8 +202,8 @@ Control flow Comments -------- -Supported syntax for comments are: +Supported syntax for comments are: - /* multiline comment */' + /* multiline comment */' // single line comment # single line comment diff --git a/libr/fs/fs.c b/libr/fs/fs.c index 3fb02de010..b30d174669 100644 --- a/libr/fs/fs.c +++ b/libr/fs/fs.c @@ -276,7 +276,7 @@ R_API void r_fs_close(RFS* fs, RFSFile* file) { R_API int r_fs_write(RFS* fs, RFSFile* file, ut64 addr, const ut8 *data, int len) { r_return_val_if_fail (fs && file && data && len >= 0, -1); if (fs && file) { - // TODO: fill file->data ? looks like dupe of rbuffer + // TODO: fill file->data ? looks like dupe of rbuffer if (file->p && file->p->write) { return file->p->write (file, addr, data, len);; } diff --git a/libr/hash/entropy.c b/libr/hash/entropy.c index afaed5ff12..02dde46222 100644 --- a/libr/hash/entropy.c +++ b/libr/hash/entropy.c @@ -1,5 +1,5 @@ /* - * This code was done + * This code was done * by an anonymous gnome * ------------------------ * That's pure mathematics, so no sense to adding license shit here. diff --git a/libr/hash/md5.c b/libr/hash/md5.c index ef5cbcd5d2..2138e424a3 100644 --- a/libr/hash/md5.c +++ b/libr/hash/md5.c @@ -12,12 +12,12 @@ * that such works are identified as "derived from the RSA Data * Security, Inc. MD5 Message-Digest Algorithm" in all material * mentioning or referencing the derived work. - * + * * RSA Data Security, Inc. makes no representations concerning either * the merchantability of this software or the suitability of this * software for any particular purpose. It is provided "as is" * without express or implied warranty of any kind. - * + * * These notices must be retained in any copies of any part of this * documentation and/or software. */ diff --git a/libr/hash/sha1.h b/libr/hash/sha1.h index dc1056c2d0..badea00d27 100644 --- a/libr/hash/sha1.h +++ b/libr/hash/sha1.h @@ -1,29 +1,29 @@ -/* +/* * The contents of this file are subject to the Mozilla Public * License Version 1.1 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ - * + * * Software distributed under the License is distributed on an "AS * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or * implied. See the License for the specific language governing * rights and limitations under the License. - * + * * The Original Code is SHA 180-1 Header File - * + * * The Initial Developer of the Original Code is Paul Kocher of - * Cryptography Research. Portions created by Paul Kocher are + * Cryptography Research. Portions created by Paul Kocher are * Copyright (C) 1995-9 by Cryptography Research, Inc. All * Rights Reserved. - * + * * Contributor(s): * * Paul Kocher - * + * * Alternatively, the contents of this file may be used under the * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your + * "GPL"), in which case the provisions of the GPL are applicable + * instead of those above. If you wish to allow use of your * version of this file only under the terms of the GPL and not to * allow others to use your version of this file under the MPL, * indicate your decision by deleting the provisions above and diff --git a/libr/hash/sha2.h b/libr/hash/sha2.h index 37eacb456e..440da38d63 100644 --- a/libr/hash/sha2.h +++ b/libr/hash/sha2.h @@ -1,7 +1,7 @@ /* * FILE: sha2.h * AUTHOR: Aaron D. Gifford - * + * * Copyright (c) 2000-2001, Aaron D. Gifford * All rights reserved. * @@ -16,7 +16,7 @@ * 3. Neither the name of the copyright holder nor the names of contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTOR(S) ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/libr/hash/xxhash.h b/libr/hash/xxhash.h index ef9bd96cea..0261ee0d05 100644 --- a/libr/hash/xxhash.h +++ b/libr/hash/xxhash.h @@ -7,14 +7,14 @@ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -52,8 +52,8 @@ CRC32 0.43 GB/s 9 MD5-32 0.33 GB/s 10 Ronald L. Rivest SHA1-32 0.28 GB/s 10 -Q.Score is a measure of quality of the hash function. -It depends on successfully passing SMHasher test set. +Q.Score is a measure of quality of the hash function. +It depends on successfully passing SMHasher test set. 10 is a perfect score. */ @@ -101,7 +101,7 @@ The function returns a pointer which holds the state of calculation. This pointer must be provided as "void* state" parameter for XXH32_feed(). XXH32_feed() can be called as many times as necessary. The function returns an error code, with 0 meaning OK, and all other values meaning there is an error. -Note that "len" is type "int", which means it is limited to 2^31-1. +Note that "len" is type "int", which means it is limited to 2^31-1. If your data is larger, it is recommended to chunk your data into blocks of size 2^30 (1GB) to avoid any "int" overflow issue. diff --git a/libr/include/heap/r_jemalloc/internal/jemalloc_internal_defs.h b/libr/include/heap/r_jemalloc/internal/jemalloc_internal_defs.h index bbcbf2d260..22aafdea81 100644 --- a/libr/include/heap/r_jemalloc/internal/jemalloc_internal_defs.h +++ b/libr/include/heap/r_jemalloc/internal/jemalloc_internal_defs.h @@ -54,7 +54,7 @@ /* * Defined if __builtin_clz() and __builtin_clzl() are available. */ -#define JEMALLOC_HAVE_BUILTIN_CLZ +#define JEMALLOC_HAVE_BUILTIN_CLZ /* * Defined if os_unfair_lock_*() functions are available, as provided by Darwin. @@ -68,12 +68,12 @@ /* #undef JEMALLOC_OSSPIN */ /* Defined if syscall(2) is usable. */ -#define JEMALLOC_USE_SYSCALL +#define JEMALLOC_USE_SYSCALL /* * Defined if secure_getenv(3) is available. */ -#define JEMALLOC_HAVE_SECURE_GETENV +#define JEMALLOC_HAVE_SECURE_GETENV /* * Defined if issetugid(2) is available. @@ -81,7 +81,7 @@ /* #undef JEMALLOC_HAVE_ISSETUGID */ /* Defined if pthread_atfork(3) is available. */ -#define JEMALLOC_HAVE_PTHREAD_ATFORK +#define JEMALLOC_HAVE_PTHREAD_ATFORK /* * Defined if clock_gettime(CLOCK_MONOTONIC_COARSE, ...) is available. @@ -112,7 +112,7 @@ * Among other things, it must be possible to initialize a mutex without * triggering allocation in order for threaded allocation to be safe. */ -#define JEMALLOC_THREADED_INIT +#define JEMALLOC_THREADED_INIT /* * Defined if the pthreads implementation defines @@ -125,7 +125,7 @@ #define JEMALLOC_TLS_MODEL __attribute__((tls_model("initial-exec"))) /* JEMALLOC_CC_SILENCE enables code that silences unuseful compiler warnings. */ -#define JEMALLOC_CC_SILENCE +#define JEMALLOC_CC_SILENCE /* JEMALLOC_CODE_COVERAGE enables test code coverage analysis. */ /* #undef JEMALLOC_CODE_COVERAGE */ @@ -137,7 +137,7 @@ /* #undef JEMALLOC_DEBUG */ /* JEMALLOC_STATS enables statistics calculation. */ -#define JEMALLOC_STATS +#define JEMALLOC_STATS /* JEMALLOC_PROF enables allocation profiling. */ /* #undef JEMALLOC_PROF */ @@ -156,16 +156,16 @@ * This makes it possible to allocate/deallocate objects without any locking * when the cache is in the steady state. */ -#define JEMALLOC_TCACHE +#define JEMALLOC_TCACHE /* * JEMALLOC_DSS enables use of sbrk(2) to allocate chunks from the data storage * segment (DSS). */ -#define JEMALLOC_DSS +#define JEMALLOC_DSS /* Support memory filling (junk/zero/quarantine/redzone). */ -#define JEMALLOC_FILL +#define JEMALLOC_FILL /* Support utrace(2)-based tracing. */ /* #undef JEMALLOC_UTRACE */ @@ -198,7 +198,7 @@ * VirtualAlloc()/VirtualFree() operations must be precisely matched, i.e. * mappings do *not* coalesce/fragment. */ -#define JEMALLOC_MAPS_COALESCE +#define JEMALLOC_MAPS_COALESCE /* * If defined, use munmap() to unmap freed chunks, rather than storing them for @@ -236,7 +236,7 @@ * If defined, explicitly attempt to more uniformly distribute large allocation * pointer alignments across all cache indices. */ -#define JEMALLOC_CACHE_OBLIVIOUS +#define JEMALLOC_CACHE_OBLIVIOUS /* * Darwin (OS X) uses zones to work around Mach-O symbol override shortcomings. @@ -250,16 +250,16 @@ * JEMALLOC_SYSCTL_VM_OVERCOMMIT: FreeBSD's vm.overcommit sysctl. */ /* #undef JEMALLOC_SYSCTL_VM_OVERCOMMIT */ -#define JEMALLOC_PROC_SYS_VM_OVERCOMMIT_MEMORY +#define JEMALLOC_PROC_SYS_VM_OVERCOMMIT_MEMORY /* Defined if madvise(2) is available. */ -#define JEMALLOC_HAVE_MADVISE +#define JEMALLOC_HAVE_MADVISE /* * Defined if transparent huge pages are supported via the MADV_[NO]HUGEPAGE * arguments to madvise(2). */ -#define JEMALLOC_HAVE_MADVISE_HUGE +#define JEMALLOC_HAVE_MADVISE_HUGE /* * Methods for purging unused pages differ between operating systems. @@ -271,10 +271,10 @@ * address region is later touched. */ /* #undef JEMALLOC_PURGE_MADVISE_FREE */ -#define JEMALLOC_PURGE_MADVISE_DONTNEED +#define JEMALLOC_PURGE_MADVISE_DONTNEED /* Defined if transparent huge page support is enabled. */ -#define JEMALLOC_THP +#define JEMALLOC_THP /* Define if operating system has alloca.h header. */ #define JEMALLOC_HAS_ALLOCA_H 1 @@ -298,13 +298,13 @@ #define LG_SIZEOF_INTMAX_T 3 /* glibc malloc hooks (__malloc_hook, __realloc_hook, __free_hook). */ -#define JEMALLOC_GLIBC_MALLOC_HOOK +#define JEMALLOC_GLIBC_MALLOC_HOOK /* glibc memalign hook. */ -#define JEMALLOC_GLIBC_MEMALIGN_HOOK +#define JEMALLOC_GLIBC_MEMALIGN_HOOK /* Adaptive mutex support in pthreads. */ -#define JEMALLOC_HAVE_PTHREAD_MUTEX_ADAPTIVE_NP +#define JEMALLOC_HAVE_PTHREAD_MUTEX_ADAPTIVE_NP /* * If defined, jemalloc symbols are not exported (doesn't work when diff --git a/libr/include/heap/r_jemalloc/jemalloc_defs.h b/libr/include/heap/r_jemalloc/jemalloc_defs.h index 70857126ce..731faf1620 100644 --- a/libr/include/heap/r_jemalloc/jemalloc_defs.h +++ b/libr/include/heap/r_jemalloc/jemalloc_defs.h @@ -1,22 +1,22 @@ /* include/jemalloc/jemalloc_defs.h. Generated from jemalloc_defs.h.in by configure. */ /* Defined if __attribute__((...)) syntax is supported. */ -#define JEMALLOC_HAVE_ATTR +#define JEMALLOC_HAVE_ATTR /* Defined if alloc_size attribute is supported. */ -#define JEMALLOC_HAVE_ATTR_ALLOC_SIZE +#define JEMALLOC_HAVE_ATTR_ALLOC_SIZE /* Defined if format(gnu_printf, ...) attribute is supported. */ -#define JEMALLOC_HAVE_ATTR_FORMAT_GNU_PRINTF +#define JEMALLOC_HAVE_ATTR_FORMAT_GNU_PRINTF /* Defined if format(printf, ...) attribute is supported. */ -#define JEMALLOC_HAVE_ATTR_FORMAT_PRINTF +#define JEMALLOC_HAVE_ATTR_FORMAT_PRINTF /* * Define overrides for non-standard allocator-related functions if they are * present on the system. */ -#define JEMALLOC_OVERRIDE_MEMALIGN -#define JEMALLOC_OVERRIDE_VALLOC +#define JEMALLOC_OVERRIDE_MEMALIGN +#define JEMALLOC_OVERRIDE_VALLOC /* * At least Linux omits the "const" in: @@ -25,14 +25,14 @@ * * Match the operating system's prototype. */ -#define JEMALLOC_USABLE_SIZE_CONST +#define JEMALLOC_USABLE_SIZE_CONST /* * If defined, specify throw() for the public function prototypes when compiling * with C++. The only justification for this is to match the prototypes that * glibc defines. */ -#define JEMALLOC_USE_CXX_THROW +#define JEMALLOC_USE_CXX_THROW #ifdef _MSC_VER # ifdef _WIN64 diff --git a/libr/include/heap/r_windows.h b/libr/include/heap/r_windows.h index 84c414e64f..81dfecc5ed 100644 --- a/libr/include/heap/r_windows.h +++ b/libr/include/heap/r_windows.h @@ -9,7 +9,7 @@ #include #include -/* +/* Defines most of heap related structures on Windows (some still missing) Tested only on Windows 10 1809 x64 TODO: diff --git a/libr/include/r_anal.h b/libr/include/r_anal.h index 41b58af2d4..6a2abadb26 100644 --- a/libr/include/r_anal.h +++ b/libr/include/r_anal.h @@ -297,7 +297,7 @@ typedef struct r_anal_function_t { HtPP/**/ *label_addrs; RPVector vars; HtUP/*>*/ *inst_vars; // offset of instructions => the variables they access - ut64 reg_save_area; // size of stack area pre-reserved for saving registers + ut64 reg_save_area; // size of stack area pre-reserved for saving registers st64 bp_off; // offset of bp inside owned stack frame st64 stack; // stack frame size int maxstack; diff --git a/libr/include/r_bind.h b/libr/include/r_bind.h index c352d42784..fe1647d52c 100644 --- a/libr/include/r_bind.h +++ b/libr/include/r_bind.h @@ -22,7 +22,7 @@ typedef bool (*RCoreIsMapped)(void *core, ut64 addr, int perm); typedef bool (*RCoreDebugMapsSync)(void *core); typedef const char *(*RCoreGetName)(void *core, ut64 off); typedef char *(*RCoreGetNameDelta)(void *core, ut64 off); -typedef void (*RCoreSeekArchBits)(void *core, ut64 addr); +typedef void (*RCoreSeekArchBits)(void *core, ut64 addr); typedef int (*RCoreConfigGetI)(void *core, const char *key); typedef const char *(*RCoreConfigGet)(void *core, const char *key); typedef ut64 (*RCoreNumGet)(void *core, const char *str); diff --git a/libr/include/r_config.h b/libr/include/r_config.h index 19bedc4727..1062e1e04c 100644 --- a/libr/include/r_config.h +++ b/libr/include/r_config.h @@ -52,7 +52,7 @@ typedef struct r_config_t { bool lock; } RConfig; -typedef struct r_config_hold_t { +typedef struct r_config_hold_t { RConfig *cfg; RList *list; } RConfigHold; diff --git a/libr/include/r_qrcode.h b/libr/include/r_qrcode.h index 729a67af1f..0b05c97659 100644 --- a/libr/include/r_qrcode.h +++ b/libr/include/r_qrcode.h @@ -1,9 +1,9 @@ -/* +/* * QR Code generator library (C) - * + * * Copyright (c) Project Nayuki. (MIT License) * https://www.nayuki.io/page/qr-code-generator-library - * + * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to @@ -34,7 +34,7 @@ extern "C" { /*---- Enumeration types and values ----*/ -/* +/* * Represents the error correction level used in a QR Code symbol. */ enum qrcodegen_Ecc { @@ -45,7 +45,7 @@ enum qrcodegen_Ecc { }; -/* +/* * Represents the mask pattern used in a QR Code symbol. */ enum qrcodegen_Mask { @@ -81,7 +81,7 @@ enum qrcodegen_Mask { /*---- Functions to generate QR Codes ----*/ -/* +/* * Encodes the given text string to a QR Code symbol, returning true if encoding succeeded. * If the data is too long to fit in any version in the given range * at the given ECC level, then false is returned. @@ -104,7 +104,7 @@ R_API bool r_qrcode_text(const char *text, uint8_t tempBuffer[], uint8_t qrcode[ enum qrcodegen_Ecc ecl, int minVersion, int maxVersion, enum qrcodegen_Mask mask, bool boostEcl); -/* +/* * Encodes the given binary data to a QR Code symbol, returning true if encoding succeeded. * If the data is too long to fit in any version in the given range * at the given ECC level, then false is returned. diff --git a/libr/include/r_util/r_graph_drawable.h b/libr/include/r_util/r_graph_drawable.h index 18cc9366f1..6fdd837b05 100644 --- a/libr/include/r_util/r_graph_drawable.h +++ b/libr/include/r_util/r_graph_drawable.h @@ -11,7 +11,7 @@ extern "C" { /** * @brief Generic drawable graph node. - * + * * Provides minimal information to draw something without output format specific details. */ typedef struct r_anal_graph_node_info_t { @@ -19,7 +19,7 @@ typedef struct r_anal_graph_node_info_t { char *body; /** * @brief Optional offset for the object corresponding to node. - * + * * Interactive output modes can use it to provide actions like seeking to * this position or modify the object. */ @@ -32,7 +32,7 @@ R_API RGraphNode *r_graph_add_node_info(RGraph *graph, const char *title, const /** * @brief Convert graph to Graphviz dot format. - * + * * @param graph Graph with RGraphNodeInfo used as node user data * @param node_properties List node styling attributes. Can be set to NULL. * @param edge_properties List edge styling attributes. Can be set to NULL. @@ -40,7 +40,7 @@ R_API RGraphNode *r_graph_add_node_info(RGraph *graph, const char *title, const R_API char *r_graph_drawable_to_dot(RGraph /*RGraphNodeInfo*/ *graph, const char *node_properties, const char *edge_properties); /** * @brief Convert graph to JSON. - * + * * @param[in] graph Graph to convert * @param[out] pj Json output structure. Can be used to include the resulting JSON value inside bigger JSON. * @param[in] use_offset Set this to true if graph uses \ref RGraphNodeInfo::offset offset field. diff --git a/libr/include/r_util/r_idpool.h b/libr/include/r_util/r_idpool.h index cf2b0996ab..fdeedf2d03 100644 --- a/libr/include/r_util/r_idpool.h +++ b/libr/include/r_util/r_idpool.h @@ -70,7 +70,7 @@ R_API void *r_oids_take(ROIDStorage *storage, ut32 id); R_API void *r_oids_otake(ROIDStorage *st, ut32 od); R_API bool r_oids_foreach(ROIDStorage* storage, RIDStorageForeachCb cb, void* user); R_API bool r_oids_foreach_prev(ROIDStorage* storage, RIDStorageForeachCb cb, void* user); -R_API bool r_oids_insert(ROIDStorage *storage, void *data, ut32 *id, ut32 *od, void *user); +R_API bool r_oids_insert(ROIDStorage *storage, void *data, ut32 *id, ut32 *od, void *user); R_API bool r_oids_sort(ROIDStorage *storage, void *user); R_API ut32 r_oids_find (ROIDStorage *storage, void *incoming, void *user); R_API void *r_oids_last(ROIDStorage *storage); diff --git a/libr/include/r_util/r_str_util.h b/libr/include/r_util/r_str_util.h index ee9e5594dc..7cedaf1fda 100644 --- a/libr/include/r_util/r_str_util.h +++ b/libr/include/r_util/r_str_util.h @@ -4,7 +4,7 @@ #ifdef __cplusplus extern "C" { #endif - + #define IS_NULLSTR(x) (!(x) || !*(x)) #define IS_WHITECHAR(x) ((x) == ' ' || (x)=='\t' || (x) == '\n' || (x) == '\r') #define IS_SEPARATOR(x) ((x) == ' ' || (x)=='\t' || (x) == '\n' || (x) == '\r' || (x) == ' '|| \ diff --git a/libr/include/r_util/r_x509.h b/libr/include/r_util/r_x509.h index 3f365134f8..01fac928bd 100644 --- a/libr/include/r_util/r_x509.h +++ b/libr/include/r_util/r_x509.h @@ -6,7 +6,7 @@ extern "C" { #endif /* - * Following RFC 5280 + * Following RFC 5280 */ typedef struct r_x509_validity_t { diff --git a/libr/include/sflib/common/sftypes.h b/libr/include/sflib/common/sftypes.h index 99dc40dbeb..54400cbd29 100644 --- a/libr/include/sflib/common/sftypes.h +++ b/libr/include/sflib/common/sftypes.h @@ -84,7 +84,7 @@ struct utsname {}; struct ustat {}; struct stat {}; struct sched_param {}; -struct timeval +struct timeval { long tv_sec; /* seconds */ long tv_usec; /* microseconds */ @@ -3566,7 +3566,7 @@ struct bsd_dirent { uint16_t d_reclen; uint8_t d_type; uint8_t d_namlen; - char d_name[MAXNAMLEN + 1]; + char d_name[MAXNAMLEN + 1]; }; /* semop system calls takes an array of these. */ diff --git a/libr/include/sflib/darwin-arm-64/sflib.h b/libr/include/sflib/darwin-arm-64/sflib.h index 0563a709ab..6fe37b08b8 100644 --- a/libr/include/sflib/darwin-arm-64/sflib.h +++ b/libr/include/sflib/darwin-arm-64/sflib.h @@ -1,5 +1,5 @@ /* - * sflib.h --- SFLib syscall library for OpenBSD/i386 + * sflib.h --- SFLib syscall library for OpenBSD/i386 * see http://www.secdev.org/projects/shellforge.html for more informations * * Copyright (C) 2004 Philippe Biondi @@ -16,7 +16,7 @@ /* - * Automatically generated by gensflib.py + * Automatically generated by gensflib.py * Fri Nov 25 15:52:34 2011 */ @@ -27,7 +27,7 @@ #include "sfsysnr.h" #include "sfsyscall.h" #include "../common/sftypes.h" - + // syscall static inline _sfsyscall1(void, exit, int, status) static inline _sfsyscall0( pid_t, fork ) diff --git a/libr/include/sflib/darwin-arm-64/sfsyscall.h b/libr/include/sflib/darwin-arm-64/sfsyscall.h index ff0f1cf8ab..5af9616d93 100644 --- a/libr/include/sflib/darwin-arm-64/sfsyscall.h +++ b/libr/include/sflib/darwin-arm-64/sfsyscall.h @@ -1,5 +1,5 @@ /* - * sfsyscall.h --- SFLib syscall macros for OpenBSD/i386 + * sfsyscall.h --- SFLib syscall macros for OpenBSD/i386 * see http://www.secdev.org/projects/shellforge.html for more informations * * Copyright (C) 2004 Philippe Biondi @@ -124,7 +124,7 @@ __asm__ volatile (\ : "I" (__NR_##name),"g" ((long)(arg1)),"r" ((long)(arg2)), \ "r" ((long)(arg3)),"S" ((long)(arg4)) ); \ __sfsyscall_return(type,__res); \ -} +} #define _sfsyscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \ type5,arg5) \ diff --git a/libr/include/sflib/darwin-arm-64/sfsysnr.h b/libr/include/sflib/darwin-arm-64/sfsysnr.h index 737e274e2a..7a7d35cda7 100644 --- a/libr/include/sflib/darwin-arm-64/sfsysnr.h +++ b/libr/include/sflib/darwin-arm-64/sfsysnr.h @@ -1,5 +1,5 @@ /* - * sfsysnr.h --- SFLib syscall numbers for OpenBSD/i386 + * sfsysnr.h --- SFLib syscall numbers for OpenBSD/i386 * see http://www.secdev.org/projects/shellforge.html for more informations * * Copyright (C) 2004 Philippe Biondi @@ -16,19 +16,19 @@ /* - * Automatically generated by gensflib.py + * Automatically generated by gensflib.py * Fri Nov 25 15:52:34 2011 */ #ifndef SFSYSNR_H #define SFSYSNR_H - + /* $Id$ */ -/* +/* * Modified from /usr/include/sys/syscall.h - * created from OpenBSD: syscalls.master,v 1.50 2002/07/06 19:14:20 nordin Exp + * created from OpenBSD: syscalls.master,v 1.50 2002/07/06 19:14:20 nordin Exp */ diff --git a/libr/include/sflib/darwin-x86-32/sflib.h b/libr/include/sflib/darwin-x86-32/sflib.h index 8f5bccfc97..aa11a046b8 100644 --- a/libr/include/sflib/darwin-x86-32/sflib.h +++ b/libr/include/sflib/darwin-x86-32/sflib.h @@ -1,5 +1,5 @@ /* - * sflib.h --- SFLib syscall library for OpenBSD/i386 + * sflib.h --- SFLib syscall library for OpenBSD/i386 * see http://www.secdev.org/projects/shellforge.html for more informations * * Copyright (C) 2004 Philippe Biondi @@ -16,7 +16,7 @@ /* - * Automatically generated by gensflib.py + * Automatically generated by gensflib.py * Fri Nov 25 15:52:34 2011 */ @@ -27,7 +27,7 @@ #include "sfsysnr.h" #include "sfsyscall.h" #include "../common/sftypes.h" - + // syscall static inline _sfsyscall1(void, exit, int, status) static inline _sfsyscall0( pid_t, fork ) diff --git a/libr/include/sflib/darwin-x86-32/sfsyscall.h b/libr/include/sflib/darwin-x86-32/sfsyscall.h index 0646944651..554d337e7c 100644 --- a/libr/include/sflib/darwin-x86-32/sfsyscall.h +++ b/libr/include/sflib/darwin-x86-32/sfsyscall.h @@ -1,5 +1,5 @@ /* - * sfsyscall.h --- SFLib syscall macros for OpenBSD/i386 + * sfsyscall.h --- SFLib syscall macros for OpenBSD/i386 * see http://www.secdev.org/projects/shellforge.html for more informations * * Copyright (C) 2004 Philippe Biondi @@ -16,13 +16,13 @@ /* - * Automatically generated by gensflib.py + * Automatically generated by gensflib.py * Fri Nov 25 15:52:34 2011 */ #ifndef SFSYSCALL_H #define SFSYSCALL_H - + /* $Id$ */ @@ -109,7 +109,7 @@ __asm__ volatile ("pushl %5\n\t" \ : "0" (__NR_##name),"g" ((long)(arg1)),"c" ((long)(arg2)), \ "d" ((long)(arg3)),"S" ((long)(arg4)) ); \ __sfsyscall_return(type,__res); \ -} +} #define _sfsyscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \ type5,arg5) \ diff --git a/libr/include/sflib/darwin-x86-32/sfsysnr.h b/libr/include/sflib/darwin-x86-32/sfsysnr.h index 737e274e2a..7a7d35cda7 100644 --- a/libr/include/sflib/darwin-x86-32/sfsysnr.h +++ b/libr/include/sflib/darwin-x86-32/sfsysnr.h @@ -1,5 +1,5 @@ /* - * sfsysnr.h --- SFLib syscall numbers for OpenBSD/i386 + * sfsysnr.h --- SFLib syscall numbers for OpenBSD/i386 * see http://www.secdev.org/projects/shellforge.html for more informations * * Copyright (C) 2004 Philippe Biondi @@ -16,19 +16,19 @@ /* - * Automatically generated by gensflib.py + * Automatically generated by gensflib.py * Fri Nov 25 15:52:34 2011 */ #ifndef SFSYSNR_H #define SFSYSNR_H - + /* $Id$ */ -/* +/* * Modified from /usr/include/sys/syscall.h - * created from OpenBSD: syscalls.master,v 1.50 2002/07/06 19:14:20 nordin Exp + * created from OpenBSD: syscalls.master,v 1.50 2002/07/06 19:14:20 nordin Exp */ diff --git a/libr/include/sflib/darwin-x86-64/sflib.h b/libr/include/sflib/darwin-x86-64/sflib.h index d96b2713b5..343264ada6 100644 --- a/libr/include/sflib/darwin-x86-64/sflib.h +++ b/libr/include/sflib/darwin-x86-64/sflib.h @@ -1,5 +1,5 @@ /* - * sflib.h --- SFLib syscall library for OpenBSD/i386 + * sflib.h --- SFLib syscall library for OpenBSD/i386 * see http://www.secdev.org/projects/shellforge.html for more informations * * Copyright (C) 2004 Philippe Biondi @@ -16,7 +16,7 @@ /* - * Automatically generated by gensflib.py + * Automatically generated by gensflib.py * Fri Nov 25 15:52:34 2011 */ @@ -27,7 +27,7 @@ #include "sfsysnr.h" #include "sfsyscall.h" #include "../common/sftypes.h" - + // syscall static inline _sfsyscall1(void, exit, int, status) static inline _sfsyscall0( pid_t, fork ) diff --git a/libr/include/sflib/darwin-x86-64/sfsyscall.h b/libr/include/sflib/darwin-x86-64/sfsyscall.h index 464fb2fa95..4cd3488c2a 100644 --- a/libr/include/sflib/darwin-x86-64/sfsyscall.h +++ b/libr/include/sflib/darwin-x86-64/sfsyscall.h @@ -1,6 +1,6 @@ //ssed on the registers rdi, rsi, rdx, r10, r8 and r9 /* - * sfsyscall.h --- SFLib syscall macros for OpenBSD/i386 + * sfsyscall.h --- SFLib syscall macros for OpenBSD/i386 * see http://www.secdev.org/projects/shellforge.html for more informations * * Copyright (C) 2004 Philippe Biondi @@ -108,7 +108,7 @@ __asm__ volatile ("mov %2, %%rdi\n\t" \ : "0" (0x2000000 | __NR_##name),"g" ((long)(arg1)),"c" ((long)(arg2)), \ "d" ((long)(arg3)),"S" ((long)(arg4)) ); \ __sfsyscall_return(type,__res); \ -} +} #define _sfsyscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \ type5,arg5) \ diff --git a/libr/include/sflib/darwin-x86-64/sfsysnr.h b/libr/include/sflib/darwin-x86-64/sfsysnr.h index 737e274e2a..7a7d35cda7 100644 --- a/libr/include/sflib/darwin-x86-64/sfsysnr.h +++ b/libr/include/sflib/darwin-x86-64/sfsysnr.h @@ -1,5 +1,5 @@ /* - * sfsysnr.h --- SFLib syscall numbers for OpenBSD/i386 + * sfsysnr.h --- SFLib syscall numbers for OpenBSD/i386 * see http://www.secdev.org/projects/shellforge.html for more informations * * Copyright (C) 2004 Philippe Biondi @@ -16,19 +16,19 @@ /* - * Automatically generated by gensflib.py + * Automatically generated by gensflib.py * Fri Nov 25 15:52:34 2011 */ #ifndef SFSYSNR_H #define SFSYSNR_H - + /* $Id$ */ -/* +/* * Modified from /usr/include/sys/syscall.h - * created from OpenBSD: syscalls.master,v 1.50 2002/07/06 19:14:20 nordin Exp + * created from OpenBSD: syscalls.master,v 1.50 2002/07/06 19:14:20 nordin Exp */ diff --git a/libr/include/sflib/freebsd-x86-32/sflib.h b/libr/include/sflib/freebsd-x86-32/sflib.h index 037c046b89..82d74033ba 100644 --- a/libr/include/sflib/freebsd-x86-32/sflib.h +++ b/libr/include/sflib/freebsd-x86-32/sflib.h @@ -1,5 +1,5 @@ /* - * sflib.h --- SFLib syscall library for FreeBSD/i386 + * sflib.h --- SFLib syscall library for FreeBSD/i386 * see http://www.secdev.org/projects/shellforge.html for more informations * * Copyright (C) 2004 Philippe Biondi @@ -16,7 +16,7 @@ /* - * Automatically generated by gensflib.py + * Automatically generated by gensflib.py * Wed Mar 31 17:50:12 2021 */ @@ -27,7 +27,7 @@ #include "sfsysnr.h" #include "sfsyscall.h" #include "../common/sftypes.h" - + // syscall static inline _sfsyscall1(int, exit, int, status) static inline _sfsyscall0( pid_t, fork ) diff --git a/libr/include/sflib/freebsd-x86-32/sfsyscall.h b/libr/include/sflib/freebsd-x86-32/sfsyscall.h index 6d897cd676..3b673aaa9c 100644 --- a/libr/include/sflib/freebsd-x86-32/sfsyscall.h +++ b/libr/include/sflib/freebsd-x86-32/sfsyscall.h @@ -1,5 +1,5 @@ /* - * sfsyscall.h --- SFLib syscall macros for FreeBSD/i386 + * sfsyscall.h --- SFLib syscall macros for FreeBSD/i386 * see http://www.secdev.org/projects/shellforge.html for more informations * * Copyright (C) 2004 Philippe Biondi @@ -16,13 +16,13 @@ /* - * Automatically generated by gensflib.py + * Automatically generated by gensflib.py * Wed Mar 31 17:50:12 2021 */ #ifndef SFSYSCALL_H #define SFSYSCALL_H - + /* $Id$ */ @@ -117,7 +117,7 @@ __asm__ volatile ("pushl %5\n\t" \ : "0" (__NR_##name),"g" ((long)(arg1)),"c" ((long)(arg2)), \ "d" ((long)(arg3)),"S" ((long)(arg4)) ); \ __sfsyscall_return(type,__res); \ -} +} #define _sfsyscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \ type5,arg5) \ diff --git a/libr/include/sflib/freebsd-x86-32/sfsysnr.h b/libr/include/sflib/freebsd-x86-32/sfsysnr.h index 8058d3afbb..23e1917607 100644 --- a/libr/include/sflib/freebsd-x86-32/sfsysnr.h +++ b/libr/include/sflib/freebsd-x86-32/sfsysnr.h @@ -1,5 +1,5 @@ /* - * sfsysnr.h --- SFLib syscall numbers for FreeBSD/i386 + * sfsysnr.h --- SFLib syscall numbers for FreeBSD/i386 * see http://www.secdev.org/projects/shellforge.html for more informations * * Copyright (C) 2004 Philippe Biondi @@ -16,16 +16,16 @@ /* - * Automatically generated by gensflib.py + * Automatically generated by gensflib.py * Wed Mar 31 17:50:12 2021 */ #ifndef SFSYSNR_H #define SFSYSNR_H - + /* $Id$ */ -/* From /usr/include/sys/syscall.h */ +/* From /usr/include/sys/syscall.h */ #define __NR_syscall 0 #define __NR_exit 1 diff --git a/libr/include/sflib/linux-arm-32/sflib.h b/libr/include/sflib/linux-arm-32/sflib.h index f6e6be12fa..c04f24ff31 100644 --- a/libr/include/sflib/linux-arm-32/sflib.h +++ b/libr/include/sflib/linux-arm-32/sflib.h @@ -1,5 +1,5 @@ /* - * sflib.h --- SFLib syscall library for Linux/amd64 + * sflib.h --- SFLib syscall library for Linux/amd64 * see http://www.secdev.org/projects/shellforge.html for more informations * * Copyright (C) 2004 Philippe Biondi @@ -16,7 +16,7 @@ /* - * Automatically generated by gensflib.py + * Automatically generated by gensflib.py * Mon Nov 28 13:53:31 2011 */ @@ -27,7 +27,7 @@ #include "sfsysnr.h" #include "sfsyscall.h" #include "../common/sftypes.h" - + static inline _sfsyscall3( ssize_t, read, int, fd, void *, buf, size_t, count ) static inline _sfsyscall3( ssize_t, write, int, fd, const void *, buf, size_t, count ) diff --git a/libr/include/sflib/linux-arm-32/sfsysnr.h b/libr/include/sflib/linux-arm-32/sfsysnr.h index a5f10f51be..cb99be91bd 100644 --- a/libr/include/sflib/linux-arm-32/sfsysnr.h +++ b/libr/include/sflib/linux-arm-32/sfsysnr.h @@ -1,5 +1,5 @@ /* - * sfsysnr.h --- SFLib syscall numbers for Linux/amd64 + * sfsysnr.h --- SFLib syscall numbers for Linux/amd64 * see http://www.secdev.org/projects/shellforge.html for more informations * * Copyright (C) 2004 Philippe Biondi @@ -16,13 +16,13 @@ /* - * Automatically generated by gensflib.py + * Automatically generated by gensflib.py * Fri Nov 25 15:52:34 2011 */ #ifndef SFSYSNR_H #define SFSYSNR_H - + /* $Id$ */ #define __NR_read 0 diff --git a/libr/include/sflib/linux-arm-64/sflib.h b/libr/include/sflib/linux-arm-64/sflib.h index f6e6be12fa..c04f24ff31 100644 --- a/libr/include/sflib/linux-arm-64/sflib.h +++ b/libr/include/sflib/linux-arm-64/sflib.h @@ -1,5 +1,5 @@ /* - * sflib.h --- SFLib syscall library for Linux/amd64 + * sflib.h --- SFLib syscall library for Linux/amd64 * see http://www.secdev.org/projects/shellforge.html for more informations * * Copyright (C) 2004 Philippe Biondi @@ -16,7 +16,7 @@ /* - * Automatically generated by gensflib.py + * Automatically generated by gensflib.py * Mon Nov 28 13:53:31 2011 */ @@ -27,7 +27,7 @@ #include "sfsysnr.h" #include "sfsyscall.h" #include "../common/sftypes.h" - + static inline _sfsyscall3( ssize_t, read, int, fd, void *, buf, size_t, count ) static inline _sfsyscall3( ssize_t, write, int, fd, const void *, buf, size_t, count ) diff --git a/libr/include/sflib/linux-arm-64/sfsysnr.h b/libr/include/sflib/linux-arm-64/sfsysnr.h index a5f10f51be..cb99be91bd 100644 --- a/libr/include/sflib/linux-arm-64/sfsysnr.h +++ b/libr/include/sflib/linux-arm-64/sfsysnr.h @@ -1,5 +1,5 @@ /* - * sfsysnr.h --- SFLib syscall numbers for Linux/amd64 + * sfsysnr.h --- SFLib syscall numbers for Linux/amd64 * see http://www.secdev.org/projects/shellforge.html for more informations * * Copyright (C) 2004 Philippe Biondi @@ -16,13 +16,13 @@ /* - * Automatically generated by gensflib.py + * Automatically generated by gensflib.py * Fri Nov 25 15:52:34 2011 */ #ifndef SFSYSNR_H #define SFSYSNR_H - + /* $Id$ */ #define __NR_read 0 diff --git a/libr/include/sflib/linux-x86-32/sflib.h b/libr/include/sflib/linux-x86-32/sflib.h index 3edc85e8aa..0a94ef4d3b 100644 --- a/libr/include/sflib/linux-x86-32/sflib.h +++ b/libr/include/sflib/linux-x86-32/sflib.h @@ -1,5 +1,5 @@ /* - * sflib.h --- SFLib syscall library for Linux/i386 + * sflib.h --- SFLib syscall library for Linux/i386 * see http://www.secdev.org/projects/shellforge.html for more informations * * Copyright (C) 2004 Philippe Biondi @@ -16,7 +16,7 @@ /* - * Automatically generated by gensflib.py + * Automatically generated by gensflib.py * Mon Nov 28 15:19:08 2011 */ @@ -27,7 +27,7 @@ #include "sfsysnr.h" #include "sfsyscall.h" #include "../common/sftypes.h" - + static inline _sfsyscall1(void, exit, int, status) static inline _sfsyscall0( pid_t, fork ) diff --git a/libr/include/sflib/linux-x86-32/sfsyscall.h b/libr/include/sflib/linux-x86-32/sfsyscall.h index be715ca9bf..e457d6df36 100644 --- a/libr/include/sflib/linux-x86-32/sfsyscall.h +++ b/libr/include/sflib/linux-x86-32/sfsyscall.h @@ -1,5 +1,5 @@ /* - * sfsyscall.h --- SFLib syscall macros for Linux/i386 + * sfsyscall.h --- SFLib syscall macros for Linux/i386 * see http://www.secdev.org/projects/shellforge.html for more informations * * Copyright (C) 2004 Philippe Biondi @@ -16,13 +16,13 @@ /* - * Automatically generated by gensflib.py + * Automatically generated by gensflib.py * Mon Nov 28 15:19:08 2011 */ #ifndef SFSYSCALL_H #define SFSYSCALL_H - + /* $Id$ */ @@ -118,7 +118,7 @@ __asm__ volatile ("###> " #name "(%2, %3, %4, %5) <###\n\t" \ : "0" (__NR_##name),"r" ((long)(arg1)),"c" ((long)(arg2)), \ "d" ((long)(arg3)),"S" ((long)(arg4)) ); \ __sfsyscall_return(type,__res); \ -} +} #define _sfsyscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \ type5,arg5) \ diff --git a/libr/include/sflib/linux-x86-32/sfsysnr.h b/libr/include/sflib/linux-x86-32/sfsysnr.h index 97f98211d7..41aafe2168 100644 --- a/libr/include/sflib/linux-x86-32/sfsysnr.h +++ b/libr/include/sflib/linux-x86-32/sfsysnr.h @@ -1,5 +1,5 @@ /* - * sfsysnr.h --- SFLib syscall numbers for Linux/i386 + * sfsysnr.h --- SFLib syscall numbers for Linux/i386 * see http://www.secdev.org/projects/shellforge.html for more informations * * Copyright (C) 2004 Philippe Biondi @@ -16,13 +16,13 @@ /* - * Automatically generated by gensflib.py + * Automatically generated by gensflib.py * Mon Nov 28 15:19:08 2011 */ #ifndef SFSYSNR_H #define SFSYSNR_H - + /* $Id$ */ diff --git a/libr/include/sflib/linux-x86-64/sflib.h b/libr/include/sflib/linux-x86-64/sflib.h index f6e6be12fa..c04f24ff31 100644 --- a/libr/include/sflib/linux-x86-64/sflib.h +++ b/libr/include/sflib/linux-x86-64/sflib.h @@ -1,5 +1,5 @@ /* - * sflib.h --- SFLib syscall library for Linux/amd64 + * sflib.h --- SFLib syscall library for Linux/amd64 * see http://www.secdev.org/projects/shellforge.html for more informations * * Copyright (C) 2004 Philippe Biondi @@ -16,7 +16,7 @@ /* - * Automatically generated by gensflib.py + * Automatically generated by gensflib.py * Mon Nov 28 13:53:31 2011 */ @@ -27,7 +27,7 @@ #include "sfsysnr.h" #include "sfsyscall.h" #include "../common/sftypes.h" - + static inline _sfsyscall3( ssize_t, read, int, fd, void *, buf, size_t, count ) static inline _sfsyscall3( ssize_t, write, int, fd, const void *, buf, size_t, count ) diff --git a/libr/include/sflib/linux-x86-64/sfsyscall.h b/libr/include/sflib/linux-x86-64/sfsyscall.h index c2b5bb16c2..2eccf9c7a4 100644 --- a/libr/include/sflib/linux-x86-64/sfsyscall.h +++ b/libr/include/sflib/linux-x86-64/sfsyscall.h @@ -1,5 +1,5 @@ /* - * sfsyscall.h --- SFLib syscall macros for Linux/amd64 + * sfsyscall.h --- SFLib syscall macros for Linux/amd64 * see http://www.secdev.org/projects/shellforge.html for more informations * * Copyright (C) 2004 Philippe Biondi @@ -16,13 +16,13 @@ /* - * Automatically generated by gensflib.py + * Automatically generated by gensflib.py * Mon Nov 28 13:53:31 2011 */ #ifndef SFSYSCALL_H #define SFSYSCALL_H - + /* $Id$ */ diff --git a/libr/include/sflib/linux-x86-64/sfsysnr.h b/libr/include/sflib/linux-x86-64/sfsysnr.h index 886d43223a..9bcd797991 100644 --- a/libr/include/sflib/linux-x86-64/sfsysnr.h +++ b/libr/include/sflib/linux-x86-64/sfsysnr.h @@ -1,5 +1,5 @@ /* - * sfsysnr.h --- SFLib syscall numbers for Linux/amd64 + * sfsysnr.h --- SFLib syscall numbers for Linux/amd64 * see http://www.secdev.org/projects/shellforge.html for more informations * * Copyright (C) 2004 Philippe Biondi @@ -16,13 +16,13 @@ /* - * Automatically generated by gensflib.py + * Automatically generated by gensflib.py * Fri Nov 25 15:52:34 2011 */ #ifndef SFSYSNR_H #define SFSYSNR_H - + /* $Id$ */ #define __NR_read 0 diff --git a/libr/io/p/debug.mk b/libr/io/p/debug.mk index 8e9f0cab88..c3a8e1e541 100644 --- a/libr/io/p/debug.mk +++ b/libr/io/p/debug.mk @@ -12,7 +12,7 @@ LINKFLAGS+=../../io/libr_io.a else LINKFLAGS=-L../../socket -lr_socket LINKFLAGS+=-L../../util -lr_util -LINKFLAGS+=-L.. -lr_io +LINKFLAGS+=-L.. -lr_io endif ifeq (${HAVE_LIB_SSL},1) CFLAGS+=${SSL_CFLAGS} diff --git a/libr/io/p/zip.mk b/libr/io/p/zip.mk index a3b4f54fa1..289a8d09b7 100644 --- a/libr/io/p/zip.mk +++ b/libr/io/p/zip.mk @@ -4,7 +4,7 @@ STATIC_OBJ+=${OBJ_ZIP} TARGET_ZIP=io_zip.${EXT_SO} ALL_TARGETS+=${TARGET_ZIP} -CFLAGS+=-I../../shlr/zip/include +CFLAGS+=-I../../shlr/zip/include ifeq (${WITHPIC},0) LINKFLAGS+=../../util/libr_util.a diff --git a/libr/io/undo.h b/libr/io/undo.h index c82e56e11e..ca7e654871 100644 --- a/libr/io/undo.h +++ b/libr/io/undo.h @@ -10,7 +10,7 @@ struct undow_t { struct list_head list; }; -enum { +enum { UNDO_WRITE_UNSET = 0, UNDO_WRITE_SET = 1 }; diff --git a/libr/libs.custom.mk.example b/libr/libs.custom.mk.example index 4f22a60850..9a06321a4f 100644 --- a/libr/libs.custom.mk.example +++ b/libr/libs.custom.mk.example @@ -1,6 +1,6 @@ LIBS0= util LIBS1= hash socket -LIBS2= +LIBS2= LIBS3= fs #anal bin parse LIBS4= LIBS5= diff --git a/libr/magic/ascmagic.c b/libr/magic/ascmagic.c index 259f5e9a12..2dc30af85e 100644 --- a/libr/magic/ascmagic.c +++ b/libr/magic/ascmagic.c @@ -3,7 +3,7 @@ * Copyright (c) Ian F. Darwin 1986-1995. * Software written by Ian F. Darwin and others; * maintained 1995-present by Christos Zoulas and others. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -140,7 +140,7 @@ return 0; } code = "ISO-8859"; type = "text"; - code_mime = "iso-8859-1"; + code_mime = "iso-8859-1"; } else if (looks_extended(buf, nbytes, ubuf, &ulen)) { code = "Non-ISO extended-ASCII"; type = "text"; diff --git a/libr/magic/d/default/apple b/libr/magic/d/default/apple index c29b7d5e11..6b8b86db30 100644 --- a/libr/magic/d/default/apple +++ b/libr/magic/d/default/apple @@ -91,9 +91,9 @@ # the assumption that 65-72 will all be ASCII (0x20-0x7F), that 73 will # have bits 1 (changed), 2 (busy), 3 (bozo), and 6 (invisible) unset, # and that 74 will be 0. So something like -# +# # 71 belong&0x80804EFF 0x00000000 Macintosh MacBinary data -# +# # >73 byte&0x01 0x01 \b, inited # >73 byte&0x02 0x02 \b, changed # >73 byte&0x04 0x04 \b, busy @@ -236,7 +236,7 @@ >0x9C string INDEX data file index >0x9C string VIEW data view -# spss magic for SPSS system and portable files, +# spss magic for SPSS system and portable files, # from Bruce Foster (bef@nwu.edu). 0 long 0xc1e2c3c9 SPSS Portable File @@ -255,7 +255,7 @@ # entries depend on the data arithmetic added after v.35 # There's also some Pascal strings in here, ditto... -# The boot block signature, according to IM:Files, is +# The boot block signature, according to IM:Files, is # "for HFS volumes, this field always contains the value 0x4C4B." # But if this is true for MFS or HFS+ volumes, I don't know. # Alternatively, the boot block is supposed to be zeroed if it's @@ -305,15 +305,15 @@ #>&42 belong x number of blocks: %d, #>&46 belong x free blocks: %d -# I don't think this is really necessary since it doesn't do much and +# I don't think this is really necessary since it doesn't do much and # anything with a valid driver descriptor will also have a valid # partition map #0 beshort 0x4552 Apple Device Driver data #>&24 beshort =1 \b, MacOS -# Is that the partition type a cstring or a pstring? Well, IM says "strings -# shorter than 32 bytes must be terminated with NULL" so I'll treat it as a -# cstring. Of course, partitions can contain more than four entries, but +# Is that the partition type a cstring or a pstring? Well, IM says "strings +# shorter than 32 bytes must be terminated with NULL" so I'll treat it as a +# cstring. Of course, partitions can contain more than four entries, but # what're you gonna do? # GRR: This magic is too weak, it is just "PM" #0x200 beshort 0x504D Apple Partition data diff --git a/libr/magic/d/default/archive b/libr/magic/d/default/archive index 78136223f2..0f7cb77866 100755 --- a/libr/magic/d/default/archive +++ b/libr/magic/d/default/archive @@ -205,7 +205,7 @@ !:mime application/octet-stream # -# LBR. NB: May conflict with the questionable +# LBR. NB: May conflict with the questionable # "binary Computer Graphics Metafile" format. # 0 string \0\ \ \ \ \ \ \ \ \ \ \ \0\0 LBR archive data @@ -218,7 +218,7 @@ 2 string -pms- PMarc SFX archive (CP/M, DOS) 5 string -pc1- PopCom compressed executable (CP/M) -# Microsoft cabinets +# Microsoft cabinets # by David Necas (Yeti) #0 string MSCF\0\0\0\0 Microsoft cabinet file data, #>25 byte x v%d diff --git a/libr/magic/d/default/cafebabe b/libr/magic/d/default/cafebabe index 9d5acfb9fb..bd2268a0bf 100644 --- a/libr/magic/d/default/cafebabe +++ b/libr/magic/d/default/cafebabe @@ -7,8 +7,8 @@ # must be performed in the same "magic" sequence to get both right. The long # at offset 4 in a mach-O fat file tells the number of architectures; the short at # offset 4 in a Java bytecode file is the JVM minor version and the -# short at offset 6 is the JVM major version. Since there are only -# only 18 labeled Mach-O architectures at current, and the first released +# short at offset 6 is the JVM major version. Since there are only +# only 18 labeled Mach-O architectures at current, and the first released # Java class format was version 43.0, we can safely choose any number # between 18 and 39 to test the number of architectures against # (and use as a hack). Let's not use 18, because the Mach-O people diff --git a/libr/magic/d/default/compressed b/libr/magic/d/default/compressed index 7e9da4de38..6bcb7c9e55 100644 --- a/libr/magic/d/default/compressed +++ b/libr/magic/d/default/compressed @@ -17,7 +17,7 @@ 0 string \211LZO\000\015\012\032\012 LZO compressed data # 7-zip archiver, from Thomas Klausner (wiz@danbala.tuwien.ac.at) -# http://www.7-zip.org or DOC/7zFormat.txt +# http://www.7-zip.org or DOC/7zFormat.txt # 0 string 7z\274\257\047\034 7-zip archive data, >6 byte <0 invalid diff --git a/libr/magic/d/default/database b/libr/magic/d/default/database index 90cbc38e52..3e3da57a2f 100644 --- a/libr/magic/d/default/database +++ b/libr/magic/d/default/database @@ -76,7 +76,7 @@ # From Max Bowsher. 12 long 0x00040988 Berkeley DB >16 long >0 (Log, version %d, native byte-order) -12 belong 0x00040988 Berkeley DB +12 belong 0x00040988 Berkeley DB >16 belong >0 (Log, version %d, big-endian) 12 lelong 0x00040988 Berkeley DB >16 lelong >0 (Log, version %d, little-endian) @@ -96,27 +96,27 @@ # XXX: Weak magic. # Alex Ott ## Paradox file formats -#2 leshort 0x0800 Paradox -#>0x39 byte 3 v. 3.0 -#>0x39 byte 4 v. 3.5 -#>0x39 byte 9 v. 4.x -#>0x39 byte 10 v. 5.x -#>0x39 byte 11 v. 5.x -#>0x39 byte 12 v. 7.x -#>>0x04 byte 0 indexed .DB data file -#>>0x04 byte 1 primary index .PX file -#>>0x04 byte 2 non-indexed .DB data file -#>>0x04 byte 3 non-incrementing secondary index .Xnn file -#>>0x04 byte 4 secondary index .Ynn file -#>>0x04 byte 5 incrementing secondary index .Xnn file -#>>0x04 byte 6 non-incrementing secondary index .XGn file -#>>0x04 byte 7 secondary index .YGn file -#>>>0x04 byte 8 incrementing secondary index .XGn file +#2 leshort 0x0800 Paradox +#>0x39 byte 3 v. 3.0 +#>0x39 byte 4 v. 3.5 +#>0x39 byte 9 v. 4.x +#>0x39 byte 10 v. 5.x +#>0x39 byte 11 v. 5.x +#>0x39 byte 12 v. 7.x +#>>0x04 byte 0 indexed .DB data file +#>>0x04 byte 1 primary index .PX file +#>>0x04 byte 2 non-indexed .DB data file +#>>0x04 byte 3 non-incrementing secondary index .Xnn file +#>>0x04 byte 4 secondary index .Ynn file +#>>0x04 byte 5 incrementing secondary index .Xnn file +#>>0x04 byte 6 non-incrementing secondary index .XGn file +#>>0x04 byte 7 secondary index .YGn file +#>>>0x04 byte 8 incrementing secondary index .XGn file ## XBase database files #0 byte 0x02 #>8 leshort >0 -#>>12 leshort 0 FoxBase +#>>12 leshort 0 FoxBase #!:mime application/x-dbf #>>>0x04 lelong 0 (no records) #>>>0x04 lelong >0 (%ld records) @@ -124,77 +124,77 @@ #0 byte 0x03 #!:mime application/x-dbf #>8 leshort >0 -#>>12 leshort 0 FoxBase+, FoxPro, dBaseIII+, dBaseIV, no memo +#>>12 leshort 0 FoxBase+, FoxPro, dBaseIII+, dBaseIV, no memo #>>>0x04 lelong 0 (no records) #>>>0x04 lelong >0 (%ld records) # #0 byte 0x04 #!:mime application/x-dbf #>8 leshort >0 -#>>12 leshort 0 dBASE IV no memo file +#>>12 leshort 0 dBASE IV no memo file #>>>0x04 lelong 0 (no records) #>>>0x04 lelong >0 (%ld records) # #0 byte 0x05 #!:mime application/x-dbf #>8 leshort >0 -#>>12 leshort 0 dBASE V no memo file +#>>12 leshort 0 dBASE V no memo file #>>>0x04 lelong 0 (no records) #>>>0x04 lelong >0 (%ld records) # #0 byte 0x30 #!:mime application/x-dbf #>8 leshort >0 -#>>12 leshort 0 Visual FoxPro +#>>12 leshort 0 Visual FoxPro #>>>0x04 lelong 0 (no records) #>>>0x04 lelong >0 (%ld records) # #0 byte 0x43 #!:mime application/x-dbf #>8 leshort >0 -#>>12 leshort 0 FlagShip with memo var size +#>>12 leshort 0 FlagShip with memo var size #>>>0x04 lelong 0 (no records) #>>>0x04 lelong >0 (%ld records) # #0 byte 0x7b #!:mime application/x-dbf #>8 leshort >0 -#>>12 leshort 0 dBASEIV with memo +#>>12 leshort 0 dBASEIV with memo #>>>0x04 lelong 0 (no records) #>>>0x04 lelong >0 (%ld records) # #0 byte 0x83 #!:mime application/x-dbf #>8 leshort >0 -#>>12 leshort 0 FoxBase+, dBaseIII+ with memo +#>>12 leshort 0 FoxBase+, dBaseIII+ with memo #>>>0x04 lelong 0 (no records) #>>>0x04 lelong >0 (%ld records) # #0 byte 0x8b #!:mime application/x-dbf #>8 leshort >0 -#>>12 leshort 0 dBaseIV with memo +#>>12 leshort 0 dBaseIV with memo #>>>0x04 lelong 0 (no records) #>>>0x04 lelong >0 (%ld records) # #0 byte 0x8e #!:mime application/x-dbf #>8 leshort >0 -#>>12 leshort 0 dBaseIV with SQL Table +#>>12 leshort 0 dBaseIV with SQL Table #>>>0x04 lelong 0 (no records) #>>>0x04 lelong >0 (%ld records) # #0 byte 0xb3 #!:mime application/x-dbf #>8 leshort >0 -#>>12 leshort 0 FlagShip with .dbt memo +#>>12 leshort 0 FlagShip with .dbt memo #>>>0x04 lelong 0 (no records) #>>>0x04 lelong >0 (%ld records) # #0 byte 0xf5 #!:mime application/x-dbf #>8 leshort >0 -#>>12 leshort 0 FoxPro with memo +#>>12 leshort 0 FoxPro with memo #>>>0x04 lelong 0 (no records) #>>>0x04 lelong >0 (%ld records) # diff --git a/libr/magic/d/default/filesystems b/libr/magic/d/default/filesystems index 7519b7d41d..d077d8f512 100644 --- a/libr/magic/d/default/filesystems +++ b/libr/magic/d/default/filesystems @@ -139,7 +139,7 @@ >0 ulelong 0x009048EB >>0x41 ubyte <2 >>>0x3E ubyte >2 \b; GRand Unified Bootloader -# 0x3 for 0.5.95,0.93,0.94,0.96 0x4 for 1.90 +# 0x3 for 0.5.95,0.93,0.94,0.96 0x4 for 1.90 >>>>0x3E ubyte x \b, stage1 version 0x%x #If it is 0xFF, use a drive passed by BIOS >>>>0x40 ubyte <0xFF \b, boot drive 0x%x @@ -382,7 +382,7 @@ >>>>>376 ubyte&0xDF >0 >>>>>>376 string x \b.%-.3s #>3 string NTFS\ \ \ \ ->389 string Fehler\ beim\ Lesen\ +>389 string Fehler\ beim\ Lesen\ >>407 string des\ Datentr\204gers >>>426 string NTLDR\ fehlt >>>>440 string NTLDR\ ist\ komprimiert @@ -731,8 +731,8 @@ # JuMP short bootcodeoffset NOP assembler instructions will usually be EB xx 90 # http://mirror.href.com/thestarman/asm/2bytejumps.htmm#FWD # older drives may use Near JuMP instruction E9 xx xx ->0 lelong&0x009000EB 0x009000EB ->0 lelong&0x000000E9 0x000000E9 +>0 lelong&0x009000EB 0x009000EB +>0 lelong&0x000000E9 0x000000E9 # maximal short forward jump is 07fx >1 ubyte <0xff \b, code offset 0x%x # mtools-3.9.8/msdos.h @@ -760,7 +760,7 @@ >>>>>16 ubyte >0 >>>>>17 uleshort >0 \b, root entries %u #>>>>>17 uleshort =0 \b, root entries %u=0 (usual Fat32) ->>>>>19 uleshort >0 \b, sectors %u (volumes <=32 MB) +>>>>>19 uleshort >0 \b, sectors %u (volumes <=32 MB) #>>>>>19 uleshort =0 \b, sectors %u=0 (usual Fat32) >>>>>21 ubyte >0xF0 \b, Media descriptor 0x%x #>>>>>21 ubyte =0xF0 \b, Media descriptor 0x%x (usual floppy) @@ -774,9 +774,9 @@ >>>>>38 ubyte !0x70 >>>>>>28 ulelong >0 \b, hidden sectors %u #>>>>>>28 ulelong =0 \b, hidden sectors %u (usual floppy) ->>>>>>32 ulelong >0 \b, sectors %u (volumes > 32 MB) +>>>>>>32 ulelong >0 \b, sectors %u (volumes > 32 MB) #>>>>>>32 ulelong =0 \b, sectors %u (volumes > 32 MB) -# FAT<32 specific +# FAT<32 specific >>>>>82 string !FAT32 #>>>>>>36 ubyte 0x80 \b, physical drive 0x%x=0x80 (usual harddisk) #>>>>>>36 ubyte 0 \b, physical drive 0x%x=0 (usual floppy) @@ -808,12 +808,12 @@ #>>>>>>48 uleshort =1 \b, infoSector %u (usual) >>>>>>48 uleshort <1 \b, infoSector %u >>>>>>50 uleshort >6 \b, Backup boot sector %u -#>>>>>>50 uleshort =6 \b, Backup boot sector %u (usual) +#>>>>>>50 uleshort =6 \b, Backup boot sector %u (usual) >>>>>>50 uleshort <6 \b, Backup boot sector %u >>>>>>54 ulelong >0 \b, reserved1 0x%x >>>>>>58 ulelong >0 \b, reserved2 0x%x >>>>>>62 ulelong >0 \b, reserved3 0x%x -# same structure as FAT1X +# same structure as FAT1X >>>>>>64 ubyte >0x80 \b, physical drive 0x%x #>>>>>>64 ubyte =0x80 \b, physical drive 0x%x=80 (usual harddisk) >>>>>>64 ubyte&0x7F >0 \b, physical drive 0x%x @@ -828,7 +828,7 @@ >>>>>>71 string =NO\ NAME \b, unlabeled ### FATs end >0x200 lelong 0x82564557 \b, BSD disklabel -# FATX +# FATX 0 string FATX FATX filesystem data @@ -1103,7 +1103,7 @@ # FE 250K 8-inch, 1-sided, single-density # FD 500K 8-inch, 2-sided, single-density # FE 1.2 MB 8-inch, 2-sided, double-density -# F8 ----- Fixed disk +# F8 ----- Fixed disk # # FC xxxK Apricot 70x1x9 boot disk. # @@ -1280,7 +1280,7 @@ #0 string td\000 floppy image data (TeleDisk) # AFS Dump Magic -# From: Ty Sarna +# From: Ty Sarna 0 string \x01\xb3\xa1\x13\x22 AFS Dump >&0 belong x (v%d) >>&0 byte 0x76 @@ -1375,7 +1375,7 @@ >>>>>16 ubyte >0 >>>>>17 uleshort >0 \b, root entries %u #>>>>>17 uleshort =0 \b, root entries %hu=0 (usual Fat32) ->>>>>19 uleshort >0 \b, sectors %u (volumes <=32 MB) +>>>>>19 uleshort >0 \b, sectors %u (volumes <=32 MB) #>>>>>19 uleshort =0 \b, sectors %hu=0 (usual Fat32) >>>>>21 ubyte >0xF0 \b, Media descriptor 0x%x #>>>>>21 ubyte =0xF0 \b, Media descriptor 0x%x (usual floppy) @@ -1394,9 +1394,9 @@ >>>>>>38 ubyte&0x56 =0 >>>>>>>28 ulelong >0 \b, hidden sectors %u #>>>>>>>28 ulelong =0 \b, hidden sectors %u (usual floppy) ->>>>>>>32 ulelong >0 \b, sectors %u (volumes > 32 MB) +>>>>>>>32 ulelong >0 \b, sectors %u (volumes > 32 MB) #>>>>>>>32 ulelong =0 \b, sectors %u (volumes > 32 MB) -# FAT<32 bit specific +# FAT<32 bit specific >>>>>>>82 string/c !fat32 #>>>>>>>>36 ubyte 0x80 \b, physical drive 0x%x=0x80 (usual harddisk) #>>>>>>>>36 ubyte 0 \b, physical drive 0x%x=0 (usual floppy) @@ -1464,14 +1464,14 @@ # 0 or 0xFFFF instead of usual 6 means no backup sector >>>>>>50 uleshort =0xFFFF \b, no Backup boot sector >>>>>>50 uleshort =0 \b, no Backup boot sector -#>>>>>>50 uleshort =6 \b, Backup boot sector %u (usual) +#>>>>>>50 uleshort =6 \b, Backup boot sector %u (usual) >>>>>>50 default x >>>>>>>50 uleshort x \b, Backup boot sector %u # corrected by Joerg Jenderek at Feb 2011 according to http://thestarman.pcministry.com/asm/mbr/MSWIN41.htm#FSINFO >>>>>>52 ulelong >0 \b, reserved1 0x%x >>>>>>56 ulelong >0 \b, reserved2 0x%x >>>>>>60 ulelong >0 \b, reserved3 0x%x -# same structure as FAT1X +# same structure as FAT1X #>>>>>>64 ubyte =0x80 \b, physical drive 0x%x=80 (usual harddisk) #>>>>>>64 ubyte =0 \b, physical drive 0x%x=0 (usual floppy) >>>>>>64 ubyte !0x80 @@ -1485,7 +1485,7 @@ >>>>>>>71 string >NO\ NAME \b, label: "%11.11s" >>>>>>>71 string =NO\ NAME \b, unlabeled # additional tests for floppy image added by Joerg Jenderek -# no fixed disk +# no fixed disk >>>>>21 ubyte !0xF8 # floppy media with 12 bit FAT >>>>>>54 string !FAT16 @@ -1511,7 +1511,7 @@ >>>>>>>>>48 ulequad >0 \b, $MFT start cluster %lld >>>>>>>>>56 ulequad >0 \b, $MFTMirror start cluster %lld # Values 0 to 127 represent MFT record sizes of 0 to 127 clusters. -# Values 128 to 255 represent MFT record sizes of 2^(256-N) bytes. +# Values 128 to 255 represent MFT record sizes of 2^(256-N) bytes. >>>>>>>>>64 lelong <256 >>>>>>>>>>64 lelong <128 \b, clusters/RecordSegment %d >>>>>>>>>>64 ubyte >127 \b, bytes/RecordSegment 2^(-1*%i) @@ -1525,7 +1525,7 @@ >>>>>>>>>80 ulelong >0 \b, checksum 0x%x #>>>>>>>>>80 ulelong =0 \b, checksum 0x%x=0 (usual) >>>>>>>>>0x258 ulelong&0x00009090 =0x00009090 -#>>>>>>>>>>&-92 indirect x \b; contains +#>>>>>>>>>>&-92 indirect x \b; contains # For 2nd NTFS sector added by Joerg Jenderek at Jan 2013 # http://thestarman.pcministry.com/asm/mbr/NTFSbrHexEd.htm # unused assembler instructions JMP y2;NOP;NOP diff --git a/libr/magic/d/default/jpeg b/libr/magic/d/default/jpeg index c791e82864..2d3c6aaa17 100644 --- a/libr/magic/d/default/jpeg +++ b/libr/magic/d/default/jpeg @@ -31,7 +31,7 @@ # # Next, show thumbnail info, if it exists: # >>18 byte !0 \b, thumbnail %dx # >>>19 byte x \b%d -# +# # # EXIF moved down here to avoid reporting a bogus version number, # # and EXIF version number printing added. # # - Patrik R=E5dman @@ -43,21 +43,21 @@ # # Little-endian # >>12 string II # # IFD 0 Entry #5: -# >>>70 leshort 0x8769 +# >>>70 leshort 0x8769 # # EXIF IFD Entry #1: # >>>>(78.l+14) leshort 0x9000 # >>>>>(78.l+23) byte x %c # >>>>>(78.l+24) byte x \b.%c # >>>>>(78.l+25) byte !0x30 \b%c # # IFD 0 Entry #9: -# >>>118 leshort 0x8769 +# >>>118 leshort 0x8769 # # EXIF IFD Entry #3: # >>>>(126.l+38) leshort 0x9000 # >>>>>(126.l+47) byte x %c # >>>>>(126.l+48) byte x \b.%c # >>>>>(126.l+49) byte !0x30 \b%c # # IFD 0 Entry #10 -# >>>130 leshort 0x8769 +# >>>130 leshort 0x8769 # # EXIF IFD Entry #3: # >>>>(138.l+38) leshort 0x9000 # >>>>>(138.l+47) byte x %c @@ -74,7 +74,7 @@ # >>>>>(138.l+72) byte x \b.%c # >>>>>(138.l+73) byte !0x30 \b%c # # IFD 0 Entry #11 -# >>>142 leshort 0x8769 +# >>>142 leshort 0x8769 # # EXIF IFD Entry #3: # >>>>(150.l+38) leshort 0x9000 # >>>>>(150.l+47) byte x %c @@ -93,7 +93,7 @@ # # Big-endian # >>12 string MM # # IFD 0 Entry #9: -# >>>118 beshort 0x8769 +# >>>118 beshort 0x8769 # # EXIF IFD Entry #1: # >>>>(126.L+14) beshort 0x9000 # >>>>>(126.L+23) byte x %c @@ -105,7 +105,7 @@ # >>>>>(126.L+48) byte x \b.%c # >>>>>(126.L+49) byte !0x30 \b%c # # IFD 0 Entry #10 -# >>>130 beshort 0x8769 +# >>>130 beshort 0x8769 # # EXIF IFD Entry #3: # >>>>(138.L+38) beshort 0x9000 # >>>>>(138.L+47) byte x %c @@ -117,7 +117,7 @@ # >>>>>(138.L+72) byte x \b.%c # >>>>>(138.L+73) byte !0x30 \b%c # # IFD 0 Entry #11 -# >>>142 beshort 0x8769 +# >>>142 beshort 0x8769 # # EXIF IFD Entry #4: # >>>>(150.L+50) beshort 0x9000 # >>>>>(150.L+59) byte x %c @@ -153,13 +153,13 @@ # #>>(4.S+6) beshort x \b length=%d # #>14 beshort x \b, %d x # #>16 beshort x \b %d -# +# # # HSI is Handmade Software's proprietary JPEG encoding scheme # #0 string hsi1 JPEG image data, HSI proprietary -# +# # # From: David Santinoli # 0 string \x00\x00\x00\x0C\x6A\x50\x20\x20\x0D\x0A\x87\x0A JPEG 2000 image data -# +# # # Type: JPEG 2000 codesream # # From: Mathieu Malaterre # 0 belong 0xff4fff51 JPEG 2000 codestream diff --git a/libr/magic/d/default/microsoft b/libr/magic/d/default/microsoft index e4e24da6ce..56ef26c7e8 100644 --- a/libr/magic/d/default/microsoft +++ b/libr/magic/d/default/microsoft @@ -71,7 +71,7 @@ !:mime application/zip >0x18 leshort >0x3f ->>(0x3c.l) string PE\0\0 PE +>>(0x3c.l) string PE\0\0 PE !:mime application/x-dosexec # hooray, there's a DOS extender using the PE format, with a valid PE # executable inside (which just prints a message and exits if run in win) @@ -201,7 +201,7 @@ >>(8.s*16) string go32stub for MS-DOS, DJGPP go32 DOS extender >>(8.s*16) string emx >>>&1 string x for DOS, Win or OS/2, emx %s ->>&(&0x42.l-3) byte x +>>&(&0x42.l-3) byte x >>>&0x26 string UPX \b, UPX compressed # and yet another guess: small .text, and after large .data is unusal, could be 32lite >>&0x2c search/0xa0 .text @@ -239,8 +239,8 @@ >28 string WWP\ \b, WWPACK compressed # skip to the end of the exe ->(4.s*512) long x ->>&(2.s-517) byte x +>(4.s*512) long x +>>&(2.s-517) byte x >>>&0 string PK\3\4 \b, ZIP self-extracting archive >>>&0 string Rar! \b, RAR self-extracting archive >>>&0 string =!\x11 \b, AIN 2.x self-extracting archive @@ -437,13 +437,13 @@ # .chr files -0 string PK\010\010BGI Borland font +0 string PK\010\010BGI Borland font >4 string >\0 %s # then there is a copyright notice # .bgi files -0 string pk\010\010BGI Borland device +0 string pk\010\010BGI Borland device >4 string >\0 %s # then there is a copyright notice @@ -516,7 +516,7 @@ # Windows Enhanced Metafile (EMF) -# See msdn.microsoft.com/archive/en-us/dnargdi/html/msdn_enhmeta.asp +# See msdn.microsoft.com/archive/en-us/dnargdi/html/msdn_enhmeta.asp # for further information. Note that "0 lelong 1" should be true i.e. # the first double word in the file should be 1. With the extended # syntax available by some file commands you could write: @@ -524,11 +524,11 @@ # &40 ulelong 0x464D4520 Windows Enhanced Metafile (EMF) image data #40 ulelong 0x464D4520 Windows Enhanced Metafile (EMF) image data #>44 ulelong x version 0x%x. -# If the description has a length greater than zero, it exists and is +# If the description has a length greater than zero, it exists and is # found at offset (*64). #>64 ulelong >0 Description available at offset 0x%x #>>60 ulelong >0 (length 0x%x) -# Note it would be better to print out the description, which is found +# Note it would be better to print out the description, which is found # as below. Unfortunately the following only prints out the first couple # of characters instead of all the "description length" # number of characters -- indicated by the ulelong at offset 60. diff --git a/libr/magic/d/default/mime b/libr/magic/d/default/mime index 534e1247e6..95e62e68e9 100644 --- a/libr/magic/d/default/mime +++ b/libr/magic/d/default/mime @@ -3,7 +3,7 @@ #------------------------------------------------------------------------------ # mime: file(1) magic for MIME encoded files # -0 string Content-Type:\ +0 string Content-Type:\ >14 string >\0 %s 0 string Content-Type: >13 string >\0 %s diff --git a/libr/magic/d/default/netbsd b/libr/magic/d/default/netbsd index 511e759929..de431cd370 100644 --- a/libr/magic/d/default/netbsd +++ b/libr/magic/d/default/netbsd @@ -10,7 +10,7 @@ # >16 lelong >0 not stripped # 0 belong 000000407 a.out NetBSD big-endian object file # >16 belong >0 not stripped -# +# # 0 belong&0377777777 041400413 a.out NetBSD/i386 demand paged # >0 byte &0x80 # >>20 lelong <4096 shared library @@ -32,7 +32,7 @@ # 0 belong&0377777777 041400507 a.out NetBSD/i386 core # >12 string >\0 from '%s' # >32 lelong !0 (signal %d) -# +# # 0 belong&0377777777 041600413 a.out NetBSD/m68k demand paged # >0 byte &0x80 # >>20 belong <8192 shared library @@ -54,7 +54,7 @@ # 0 belong&0377777777 041600507 a.out NetBSD/m68k core # >12 string >\0 from '%s' # >32 belong !0 (signal %d) -# +# # 0 belong&0377777777 042000413 a.out NetBSD/m68k4k demand paged # >0 byte &0x80 # >>20 belong <4096 shared library @@ -76,7 +76,7 @@ # 0 belong&0377777777 042000507 a.out NetBSD/m68k4k core # >12 string >\0 from '%s' # >32 belong !0 (signal %d) -# +# # 0 belong&0377777777 042200413 a.out NetBSD/ns32532 demand paged # >0 byte &0x80 # >>20 lelong <4096 shared library @@ -98,10 +98,10 @@ # 0 belong&0377777777 042200507 a.out NetBSD/ns32532 core # >12 string >\0 from '%s' # >32 lelong !0 (signal %d) -# +# # 0 belong&0377777777 045200507 a.out NetBSD/powerpc core # >12 string >\0 from '%s' -# +# # 0 belong&0377777777 042400413 a.out NetBSD/sparc demand paged # >0 byte &0x80 # >>20 belong <8192 shared library @@ -123,7 +123,7 @@ # 0 belong&0377777777 042400507 a.out NetBSD/sparc core # >12 string >\0 from '%s' # >32 belong !0 (signal %d) -# +# # 0 belong&0377777777 042600413 a.out NetBSD/pmax demand paged # >0 byte &0x80 # >>20 lelong <4096 shared library @@ -145,7 +145,7 @@ # 0 belong&0377777777 042600507 a.out NetBSD/pmax core # >12 string >\0 from '%s' # >32 lelong !0 (signal %d) -# +# # 0 belong&0377777777 043000413 a.out NetBSD/vax 1k demand paged # >0 byte &0x80 # >>20 lelong <4096 shared library @@ -167,7 +167,7 @@ # 0 belong&0377777777 043000507 a.out NetBSD/vax 1k core # >12 string >\0 from '%s' # >32 lelong !0 (signal %d) -# +# # 0 belong&0377777777 045400413 a.out NetBSD/vax 4k demand paged # >0 byte &0x80 # >>20 lelong <4096 shared library @@ -189,7 +189,7 @@ # 0 belong&0377777777 045400507 a.out NetBSD/vax 4k core # >12 string >\0 from '%s' # >32 lelong !0 (signal %d) -# +# # 0 belong&0377777777 043400413 a.out NetBSD/mips demand paged # >0 byte &0x80 # >>20 belong <8192 shared library @@ -211,7 +211,7 @@ # 0 belong&0377777777 043400507 a.out NetBSD/mips core # >12 string >\0 from '%s' # >32 belong !0 (signal %d) -# +# # 0 belong&0377777777 043600413 a.out NetBSD/arm32 demand paged # >0 byte &0x80 # >>20 lelong <4096 shared library diff --git a/libr/magic/d/default/openbsd b/libr/magic/d/default/openbsd index 0f8b54e3c7..b85264e198 100644 --- a/libr/magic/d/default/openbsd +++ b/libr/magic/d/default/openbsd @@ -10,7 +10,7 @@ # >16 lelong >0 not stripped # 0 belong 000000407 OpenBSD big-endian object file # >16 belong >0 not stripped -# +# # 0 belong&0377777777 041400413 OpenBSD/i386 demand paged # >0 byte &0x80 # >>20 lelong <4096 shared library @@ -31,7 +31,7 @@ # >16 lelong >0 not stripped # 0 belong&0377777777 041400507 OpenBSD/i386 core # >12 string >\0 from '%s' -# +# # 0 belong&0377777777 041600413 OpenBSD/m68k demand paged # >0 byte &0x80 # >>20 belong <8192 shared library @@ -52,7 +52,7 @@ # >16 belong >0 not stripped # 0 belong&0377777777 041600507 OpenBSD/m68k core # >12 string >\0 from '%s' -# +# # 0 belong&0377777777 042000413 OpenBSD/m68k4k demand paged # >0 byte &0x80 # >>20 belong <4096 shared library @@ -73,7 +73,7 @@ # >16 belong >0 not stripped # 0 belong&0377777777 042000507 OpenBSD/m68k4k core # >12 string >\0 from '%s' -# +# # 0 belong&0377777777 042200413 OpenBSD/ns32532 demand paged # >0 byte &0x80 # >>20 lelong <4096 shared library @@ -94,7 +94,7 @@ # >16 lelong >0 not stripped # 0 belong&0377777777 042200507 OpenBSD/ns32532 core # >12 string >\0 from '%s' -# +# # 0 belong&0377777777 042400413 OpenBSD/sparc demand paged # >0 byte &0x80 # >>20 belong <8192 shared library @@ -115,7 +115,7 @@ # >16 belong >0 not stripped # 0 belong&0377777777 042400507 OpenBSD/sparc core # >12 string >\0 from '%s' -# +# # 0 belong&0377777777 042600413 OpenBSD/pmax demand paged # >0 byte &0x80 # >>20 lelong <4096 shared library @@ -136,7 +136,7 @@ # >16 lelong >0 not stripped # 0 belong&0377777777 042600507 OpenBSD/pmax core # >12 string >\0 from '%s' -# +# # 0 belong&0377777777 043000413 OpenBSD/vax1k demand paged # >0 byte &0x80 # >>20 lelong <4096 shared library @@ -157,7 +157,7 @@ # >16 lelong >0 not stripped # 0 belong&0377777777 043000507 OpenBSD/vax1k core # >12 string >\0 from '%s' -# +# # 0 belong&0377777777 045400413 OpenBSD/vax demand paged # >0 byte &0x80 # >>20 lelong <4096 shared library @@ -178,19 +178,19 @@ # >16 lelong >0 not stripped # 0 belong&0377777777 045400507 OpenBSD/vax core # >12 string >\0 from '%s' -# +# # # OpenBSD/powerpc core files # 0 belong&0377777777 045200507 OpenBSD/powerpc core # >12 string >\0 from '%s' -# +# # # OpenBSD/sparc64 core files # 0 belong&0377777777 045600507 OpenBSD/sparc64 core # >12 string >\0 from '%s' -# +# # # OpenBSD/hppa core files # 0 belong&0377777777 046400507 OpenBSD/hppa core # >12 string >\0 from '%s' -# +# # # OpenBSD/mips64 # 0 belong&0377777777 047400413 OpenBSD/mips64 demand paged # >0 byte &0x80 @@ -212,7 +212,7 @@ # >16 belong >0 not stripped # 0 belong&0377777777 047400507 OpenBSD/mips64 core # >12 string >\0 from '%s' -# +# # 0 belong&0377777777 043600413 OpenBSD/arm demand paged # >0 byte &0x80 # >>20 lelong <8192 shared library diff --git a/libr/magic/d/default/riff b/libr/magic/d/default/riff index 98adf3dfd0..bcc6c72a2d 100644 --- a/libr/magic/d/default/riff +++ b/libr/magic/d/default/riff @@ -176,7 +176,7 @@ >8 string sfbk SoundFont/Bank # MPEG-1 wrapped in a RIFF, apparently >8 string CDXA \b, wrapped MPEG-1 (CDXA) ->8 string 4XMV \b, 4X Movie file +>8 string 4XMV \b, 4X Movie file # # XXX - some of the below may only appear in little-endian form. diff --git a/libr/magic/d/default/vim b/libr/magic/d/default/vim index ae08f44541..d6fd762dc5 100644 --- a/libr/magic/d/default/vim +++ b/libr/magic/d/default/vim @@ -1,7 +1,7 @@ # $OpenBSD: editors,v 1.2 2008/05/08 01:40:57 chl Exp $ -# Vi IMproved Encrypted file +# Vi IMproved Encrypted file # by David Necas 0 string VimCrypt~ Vim encrypted file data # Vi IMproved Swap file diff --git a/libr/magic/file.h b/libr/magic/file.h index 2f6109a5f7..29143acd19 100644 --- a/libr/magic/file.h +++ b/libr/magic/file.h @@ -3,7 +3,7 @@ * Copyright (c) Ian F. Darwin 1986-1995. * Software written by Ian F. Darwin and others; * maintained 1995-present by Christos Zoulas and others. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/libr/magic/funcs.c b/libr/magic/funcs.c index c6a81aaaa8..0839a894ba 100644 --- a/libr/magic/funcs.c +++ b/libr/magic/funcs.c @@ -2,7 +2,7 @@ /* * Copyright (c) Christos Zoulas 2003. * All Rights Reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -12,7 +12,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/libr/magic/is_tar.c b/libr/magic/is_tar.c index 27fef8cf03..2d0b643140 100644 --- a/libr/magic/is_tar.c +++ b/libr/magic/is_tar.c @@ -3,7 +3,7 @@ * Copyright (c) Ian F. Darwin 1986-1995. * Software written by Ian F. Darwin and others; * maintained 1995-present by Christos Zoulas and others. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -78,8 +78,8 @@ static int from_oct(int digs, const char *where) { } /* - * Return - * 0 if the checksum is bad (i.e., probably not a tar archive), + * Return + * 0 if the checksum is bad (i.e., probably not a tar archive), * 1 for old UNIX tar file, * 2 for Unix Std (POSIX) tar file, * 3 for GNU tar file. diff --git a/libr/magic/magic.c b/libr/magic/magic.c index eb1a51bea1..d6d7cc6b30 100644 --- a/libr/magic/magic.c +++ b/libr/magic/magic.c @@ -26,7 +26,7 @@ R_LIB_VERSION (r_magic); R_API RMagic* r_magic_new(int flags) { return magic_open (flags); } R_API void r_magic_free(RMagic* m) { if (m) { magic_close (m); } } -R_API const char *r_magic_file(RMagic* m, const char * f) { return magic_file (m, f); } +R_API const char *r_magic_file(RMagic* m, const char * f) { return magic_file (m, f); } R_API const char *r_magic_descriptor(RMagic* m, int fd) { return magic_descriptor (m, fd); } R_API const char *r_magic_buffer(RMagic* m, const void *b, size_t s) { return magic_buffer (m, b, s); } R_API const char *r_magic_error(RMagic* m) { return magic_error (m); } @@ -42,7 +42,7 @@ R_API int r_magic_errno(RMagic* m) { return magic_errno (m); } #include "file.h" -#ifndef PIPE_BUF +#ifndef PIPE_BUF /* Get the PIPE_BUF from pathconf */ #ifdef _PC_PIPE_BUF #define PIPE_BUF pathconf(".", _PC_PIPE_BUF) diff --git a/libr/magic/names.h b/libr/magic/names.h index ef5fdf86d9..1636197f15 100644 --- a/libr/magic/names.h +++ b/libr/magic/names.h @@ -3,7 +3,7 @@ * Copyright (c) Ian F. Darwin 1986-1995. * Software written by Ian F. Darwin and others; * maintained 1995-present by Christos Zoulas and others. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/libr/magic/tar.h b/libr/magic/tar.h index 311937e42e..58a58c408f 100644 --- a/libr/magic/tar.h +++ b/libr/magic/tar.h @@ -3,7 +3,7 @@ * Copyright (c) Ian F. Darwin 1986-1995. * Software written by Ian F. Darwin and others; * maintained 1995-present by Christos Zoulas and others. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/libr/main/rasm2.c b/libr/main/rasm2.c index 60d8234d1d..d3d964a9cf 100644 --- a/libr/main/rasm2.c +++ b/libr/main/rasm2.c @@ -157,7 +157,7 @@ static int show_analinfo(RAsmState *as, const char *arg, ut64 offset) { r_anal_op_fini (&aop); } if (as->json) { - pj_end (pj); + pj_end (pj); printf ("%s\n", pj_string (pj)); pj_free (pj); } diff --git a/libr/parse/c/COPYING b/libr/parse/c/COPYING index 223ede7de3..7c8d84f67b 100644 --- a/libr/parse/c/COPYING +++ b/libr/parse/c/COPYING @@ -146,7 +146,7 @@ such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. - + 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an diff --git a/libr/parse/c/tcclib.h b/libr/parse/c/tcclib.h index 42f8f3f578..4dce145136 100644 --- a/libr/parse/c/tcclib.h +++ b/libr/parse/c/tcclib.h @@ -1,8 +1,8 @@ -/* Simple libc header for TCC - * +/* Simple libc header for TCC + * * Add any function you want from the libc there. This file is here * only for your convenience so that you do not need to put the whole - * glibc include files on your floppy disk + * glibc include files on your floppy disk */ #ifndef _TCCLIB_H #define _TCCLIB_H diff --git a/libr/parse/c/tccpp.c b/libr/parse/c/tccpp.c index 28ef31cb76..2a66ff5f6e 100644 --- a/libr/parse/c/tccpp.c +++ b/libr/parse/c/tccpp.c @@ -824,7 +824,7 @@ ST_FUNC void save_parse_state(ParseState *s) s->tokc = tokc; } -/* restore parse state from 's' +/* restore parse state from 's' ST_FUNC void restore_parse_state(ParseState *s) { file->line_num = s->line_num; diff --git a/libr/search/aes_find.c b/libr/search/aes_find.c index 9257adfb1d..9247566eb9 100644 --- a/libr/search/aes_find.c +++ b/libr/search/aes_find.c @@ -1,9 +1,9 @@ /* - * Find expanded AES keys in memory - * + * Find expanded AES keys in memory + * * Algorithm discovered and developed by Victor Muñoz * - PoC and source published at 24c3 at December 2007 - * + * * Thanks for the great moments and code snippets! * * This source is public domain. Feel free to use it and distribute it. @@ -101,4 +101,4 @@ R_API int r_search_aes_update(RSearch *s, ut64 from, const ut8 *buf, int len) { } } return -1; -} \ No newline at end of file +} diff --git a/libr/search/privkey_find.c b/libr/search/privkey_find.c index e346a1d2d7..fb5e4d83da 100644 --- a/libr/search/privkey_find.c +++ b/libr/search/privkey_find.c @@ -35,7 +35,7 @@ static const ut8 *parse_next_field(const ut8 *start, ut32 *len) { } /* Check if `start` points to an ensemble of BER fields -with the format as a private key syntax. We check only the first +with the format as a private key syntax. We check only the first three fields of the key */ static int check_fields(const ut8 *start) { #define KEY_MAX_LEN 26000 @@ -62,7 +62,7 @@ static int check_fields(const ut8 *start) { } // Finds and return index of a private key: -// As defined in RFC 3447 for RSA, as defined in RFC 5915 for +// As defined in RFC 3447 for RSA, as defined in RFC 5915 for // elliptic curves and as defined in 7 of RFC 8410 for SafeCurves R_API int r_search_privkey_update(RSearch *s, ut64 from, const ut8 *buf, int len) { int i, k, max, index, t; diff --git a/libr/search/strings.c b/libr/search/strings.c index a3d65e44a1..14f16dd3d7 100644 --- a/libr/search/strings.c +++ b/libr/search/strings.c @@ -21,7 +21,7 @@ R_API int r_search_get_encoding(const char *name) { for (i = 0; encodings[i]; i++) { ut32 sz = R_MIN (strlen (encodings[i]), lename); if (!r_str_ncasecmp (name, encodings[i], sz)) { - return i; + return i; } } return ENCODING_ASCII; diff --git a/libr/syscall/d/meson.build b/libr/syscall/d/meson.build index a8d64b822e..cbe8c15960 100644 --- a/libr/syscall/d/meson.build +++ b/libr/syscall/d/meson.build @@ -48,4 +48,4 @@ foreach file : sdb_files install_dir: join_paths(r2_sdb, 'syscall') ) endforeach - + diff --git a/libr/util/big.c b/libr/util/big.c index 67cbdbab0a..35e36ab2fb 100644 --- a/libr/util/big.c +++ b/libr/util/big.c @@ -373,7 +373,7 @@ R_API void r_big_div(RNumBig *c, RNumBig *a, RNumBig *b) { } R_API void r_big_mod(RNumBig *c, RNumBig *a, RNumBig *b) { - /* + /* Take divmod and throw away div part */ r_return_if_fail (a); diff --git a/libr/util/d/ascii.sdb.txt b/libr/util/d/ascii.sdb.txt index 5549b45e11..0053a0b4d4 100644 --- a/libr/util/d/ascii.sdb.txt +++ b/libr/util/d/ascii.sdb.txt @@ -1,7 +1,7 @@ 0xa= 0x9= -0x20= +0x20= 0x21=! 0x22=" 0x23=# @@ -95,4 +95,4 @@ 0x7b={ 0x7c=| 0x7d=} -0x7e=~ \ No newline at end of file +0x7e=~ diff --git a/libr/util/print.c b/libr/util/print.c index ebf1da5670..1ef69b342e 100644 --- a/libr/util/print.c +++ b/libr/util/print.c @@ -1319,7 +1319,7 @@ R_API void r_print_hexdump(RPrint *p, ut64 addr, const ut8 *buf, int len, int ba free (rstr); } } - bool first = true; + bool first = true; if (!eol && p && p->use_comments) { for (; j < i + inc; j++) { print (" "); diff --git a/libr/util/qrcode.c b/libr/util/qrcode.c index 32556d7c95..4bede0e293 100644 --- a/libr/util/qrcode.c +++ b/libr/util/qrcode.c @@ -1038,7 +1038,7 @@ R_API char *r_qrcode_gen(const ut8 *text, int len, bool utf8, bool inverted) { bmp |= qrcodegen_getModule (qrcode, x + 1, y) << 1; bmp |= qrcodegen_getModule (qrcode, x, y + 1) << 2; bmp |= qrcodegen_getModule (qrcode, x + 1, y + 1) << 3; - const char *pixel = + const char *pixel = qrcode_utf8_expansions[ inverted ? 15 - bmp diff --git a/libr/util/skiplist.c b/libr/util/skiplist.c index 1f0a7db56e..eef26c95ef 100644 --- a/libr/util/skiplist.c +++ b/libr/util/skiplist.c @@ -237,7 +237,7 @@ R_API RSkipListNode* r_skiplist_find_leq(RSkipList* list, void* data) { int i; for (i = list->list_level; i >= 0; i--) { - while (x->forward[i] != list->head + while (x->forward[i] != list->head && list->compare (x->forward[i]->data, data) <= 0) { x = x->forward[i]; } diff --git a/libr/util/sys.c b/libr/util/sys.c index 8fde8ac446..4637978e7d 100644 --- a/libr/util/sys.c +++ b/libr/util/sys.c @@ -1262,7 +1262,7 @@ R_API int r_sys_uid(void) { DWORD buf_sz = sizeof (buf); // TODO if (!GetUserName ((LPWSTR)buf, (LPDWORD)&buf_sz) ) { - return 1; // + return 1; // } return 0; #elif __wasi__ diff --git a/libr/util/syscmd.c b/libr/util/syscmd.c index da4be3415b..5481951986 100644 --- a/libr/util/syscmd.c +++ b/libr/util/syscmd.c @@ -332,7 +332,7 @@ R_API char *r_syscmd_head(const char *file, int count) { } else { p = file; } - } + } if (p && *p) { char *filename = strdup (p); r_str_trim (filename); diff --git a/pkgcfg/r_anal.pc.acr b/pkgcfg/r_anal.pc.acr index 433373099a..64fdd36486 100644 --- a/pkgcfg/r_anal.pc.acr +++ b/pkgcfg/r_anal.pc.acr @@ -7,5 +7,5 @@ Name: r_anal Description: radare foundation libraries Version: @VERSION@ Requires: r_util r_reg r_syscall r_search r_cons r_flag r_crypto -Libs: -L${libdir} -lr_anal -Cflags: -I${includedir}/libr +Libs: -L${libdir} -lr_anal +Cflags: -I${includedir}/libr diff --git a/pkgcfg/r_asm.pc.acr b/pkgcfg/r_asm.pc.acr index 3af88b7ee7..c3bb098869 100644 --- a/pkgcfg/r_asm.pc.acr +++ b/pkgcfg/r_asm.pc.acr @@ -7,5 +7,5 @@ Name: r_asm Description: radare foundation libraries Version: @VERSION@ Requires: r_syscall r_lang r_util r_parse r_flag r_cons r_reg -Libs: -L${libdir} -lr_asm -Cflags: -I${includedir}/libr +Libs: -L${libdir} -lr_asm +Cflags: -I${includedir}/libr diff --git a/pkgcfg/r_bin.pc.acr b/pkgcfg/r_bin.pc.acr index 9a7c5d0453..11a4a524f8 100644 --- a/pkgcfg/r_bin.pc.acr +++ b/pkgcfg/r_bin.pc.acr @@ -7,5 +7,5 @@ Name: r_bin Description: radare foundation libraries Version: @VERSION@ Requires: r_util r_io r_socket r_magic -Libs: -L${libdir} -lr_bin -Cflags: -I${includedir}/libr +Libs: -L${libdir} -lr_bin +Cflags: -I${includedir}/libr diff --git a/pkgcfg/r_bp.pc.acr b/pkgcfg/r_bp.pc.acr index 0bfd0c7dd8..d3372a9de9 100644 --- a/pkgcfg/r_bp.pc.acr +++ b/pkgcfg/r_bp.pc.acr @@ -7,5 +7,5 @@ Name: r_bp Description: radare foundation libraries Version: @VERSION@ Requires: r_util -Libs: -L${libdir} -lr_bp -Cflags: -I${includedir}/libr +Libs: -L${libdir} -lr_bp +Cflags: -I${includedir}/libr diff --git a/pkgcfg/r_config.pc.acr b/pkgcfg/r_config.pc.acr index a7b756e7be..daa9739905 100644 --- a/pkgcfg/r_config.pc.acr +++ b/pkgcfg/r_config.pc.acr @@ -7,5 +7,5 @@ Name: r_config Description: radare foundation libraries Version: @VERSION@ Requires: r_util -Libs: -L${libdir} -lr_config -Cflags: -I${includedir}/libr +Libs: -L${libdir} -lr_config +Cflags: -I${includedir}/libr diff --git a/pkgcfg/r_cons.pc.acr b/pkgcfg/r_cons.pc.acr index 363c1410fa..68e5b5f6a3 100644 --- a/pkgcfg/r_cons.pc.acr +++ b/pkgcfg/r_cons.pc.acr @@ -7,5 +7,5 @@ Name: r_cons Description: radare foundation libraries Version: @VERSION@ Requires: r_util -Libs: -L${libdir} -lr_cons -Cflags: -I${includedir}/libr +Libs: -L${libdir} -lr_cons +Cflags: -I${includedir}/libr diff --git a/pkgcfg/r_crypto.pc.acr b/pkgcfg/r_crypto.pc.acr index d3d7d36b52..d57360557d 100644 --- a/pkgcfg/r_crypto.pc.acr +++ b/pkgcfg/r_crypto.pc.acr @@ -7,5 +7,5 @@ Name: r_crypto Description: radare foundation libraries Version: @VERSION@ Requires: r_hash r_util r_util r_util -Libs: -L${libdir} -lr_crypto -Cflags: -I${includedir}/libr +Libs: -L${libdir} -lr_crypto +Cflags: -I${includedir}/libr diff --git a/pkgcfg/r_debug.pc.acr b/pkgcfg/r_debug.pc.acr index f949798a9a..23b544388c 100644 --- a/pkgcfg/r_debug.pc.acr +++ b/pkgcfg/r_debug.pc.acr @@ -7,5 +7,5 @@ Name: r_debug Description: radare foundation libraries Version: @VERSION@ Requires: r_reg r_anal r_bp r_io r_parse r_cons r_syscall r_hash r_flag r_util r_egg r_socket -Libs: -L${libdir} -lr_debug -Cflags: -I${includedir}/libr +Libs: -L${libdir} -lr_debug +Cflags: -I${includedir}/libr diff --git a/pkgcfg/r_egg.pc.acr b/pkgcfg/r_egg.pc.acr index a0e5813554..36cf072ee2 100644 --- a/pkgcfg/r_egg.pc.acr +++ b/pkgcfg/r_egg.pc.acr @@ -7,5 +7,5 @@ Name: r_egg Description: radare foundation libraries Version: @VERSION@ Requires: r_asm r_syscall r_util r_parse r_reg r_flag r_cons -Libs: -L${libdir} -lr_egg -Cflags: -I${includedir}/libr +Libs: -L${libdir} -lr_egg +Cflags: -I${includedir}/libr diff --git a/pkgcfg/r_flag.pc.acr b/pkgcfg/r_flag.pc.acr index a22cbbd923..a1ce556b4f 100644 --- a/pkgcfg/r_flag.pc.acr +++ b/pkgcfg/r_flag.pc.acr @@ -7,5 +7,5 @@ Name: r_flag Description: radare foundation libraries Version: @VERSION@ Requires: r_util -Libs: -L${libdir} -lr_flag -Cflags: -I${includedir}/libr +Libs: -L${libdir} -lr_flag +Cflags: -I${includedir}/libr diff --git a/pkgcfg/r_fs.pc.acr b/pkgcfg/r_fs.pc.acr index d13579c521..50a804f9f2 100644 --- a/pkgcfg/r_fs.pc.acr +++ b/pkgcfg/r_fs.pc.acr @@ -7,5 +7,5 @@ Name: r_fs Description: radare foundation libraries Version: @VERSION@ Requires: r_util r_io -Libs: -L${libdir} -lr_fs -Cflags: -I${includedir}/libr +Libs: -L${libdir} -lr_fs +Cflags: -I${includedir}/libr diff --git a/pkgcfg/r_hash.pc.acr b/pkgcfg/r_hash.pc.acr index 271516f9fa..47cc7fbedc 100644 --- a/pkgcfg/r_hash.pc.acr +++ b/pkgcfg/r_hash.pc.acr @@ -8,4 +8,4 @@ Description: radare foundation libraries Version: @VERSION@ Requires: r_util Libs: -L${libdir} -lr_hash @LIBXXHASH@ -Cflags: -I${includedir}/libr +Cflags: -I${includedir}/libr diff --git a/pkgcfg/r_io.pc.acr b/pkgcfg/r_io.pc.acr index bd3a3dfdc8..0f251c33f0 100644 --- a/pkgcfg/r_io.pc.acr +++ b/pkgcfg/r_io.pc.acr @@ -7,5 +7,5 @@ Name: r_io Description: radare foundation libraries Version: @VERSION@ Requires: r_util r_socket r_hash r_cons r_crypto -Libs: -L${libdir} -lr_io -Cflags: -I${includedir}/libr +Libs: -L${libdir} -lr_io +Cflags: -I${includedir}/libr diff --git a/pkgcfg/r_lang.pc.acr b/pkgcfg/r_lang.pc.acr index 04b7aaffa3..4fe0bcd767 100644 --- a/pkgcfg/r_lang.pc.acr +++ b/pkgcfg/r_lang.pc.acr @@ -7,5 +7,5 @@ Name: r_lang Description: radare foundation libraries Version: @VERSION@ Requires: r_util r_cons -Libs: -L${libdir} -lr_lang -Cflags: -I${includedir}/libr +Libs: -L${libdir} -lr_lang +Cflags: -I${includedir}/libr diff --git a/pkgcfg/r_magic.pc.acr b/pkgcfg/r_magic.pc.acr index e16925f251..a298fcde5f 100644 --- a/pkgcfg/r_magic.pc.acr +++ b/pkgcfg/r_magic.pc.acr @@ -8,4 +8,4 @@ Description: radare foundation libraries Version: @VERSION@ Requires: r_util Libs: -L${libdir} -lr_magic @LIBMAGIC@ -Cflags: -I${includedir}/libr +Cflags: -I${includedir}/libr diff --git a/pkgcfg/r_parse.pc.acr b/pkgcfg/r_parse.pc.acr index 93dd3e3804..c8277a8874 100644 --- a/pkgcfg/r_parse.pc.acr +++ b/pkgcfg/r_parse.pc.acr @@ -7,5 +7,5 @@ Name: r_parse Description: radare foundation libraries Version: @VERSION@ Requires: r_flag r_util r_syscall r_reg r_cons -Libs: -L${libdir} -lr_parse -Cflags: -I${includedir}/libr +Libs: -L${libdir} -lr_parse +Cflags: -I${includedir}/libr diff --git a/pkgcfg/r_reg.pc.acr b/pkgcfg/r_reg.pc.acr index a5923e55ea..4d032435a7 100644 --- a/pkgcfg/r_reg.pc.acr +++ b/pkgcfg/r_reg.pc.acr @@ -7,5 +7,5 @@ Name: r_reg Description: radare foundation libraries Version: @VERSION@ Requires: r_util -Libs: -L${libdir} -lr_reg -Cflags: -I${includedir}/libr +Libs: -L${libdir} -lr_reg +Cflags: -I${includedir}/libr diff --git a/pkgcfg/r_search.pc.acr b/pkgcfg/r_search.pc.acr index db06aa5afa..6af6b549f9 100644 --- a/pkgcfg/r_search.pc.acr +++ b/pkgcfg/r_search.pc.acr @@ -7,5 +7,5 @@ Name: r_search Description: radare foundation libraries Version: @VERSION@ Requires: r_util -Libs: -L${libdir} -lr_search -Cflags: -I${includedir}/libr +Libs: -L${libdir} -lr_search +Cflags: -I${includedir}/libr diff --git a/pkgcfg/r_socket.pc.acr b/pkgcfg/r_socket.pc.acr index 3d1babab3b..e13f3700ad 100644 --- a/pkgcfg/r_socket.pc.acr +++ b/pkgcfg/r_socket.pc.acr @@ -7,5 +7,5 @@ Name: r_socket Description: radare foundation libraries Version: @VERSION@ Requires: r_util -Libs: -L${libdir} -lr_socket -Cflags: -I${includedir}/libr +Libs: -L${libdir} -lr_socket +Cflags: -I${includedir}/libr diff --git a/pkgcfg/r_syscall.pc.acr b/pkgcfg/r_syscall.pc.acr index cd0f11165d..6e137c6be4 100644 --- a/pkgcfg/r_syscall.pc.acr +++ b/pkgcfg/r_syscall.pc.acr @@ -7,5 +7,5 @@ Name: r_syscall Description: radare foundation libraries Version: @VERSION@ Requires: r_util -Libs: -L${libdir} -lr_syscall -Cflags: -I${includedir}/libr +Libs: -L${libdir} -lr_syscall +Cflags: -I${includedir}/libr diff --git a/pkgcfg/r_util.pc.acr b/pkgcfg/r_util.pc.acr index 387d4677ee..9c5d7e3888 100644 --- a/pkgcfg/r_util.pc.acr +++ b/pkgcfg/r_util.pc.acr @@ -6,6 +6,6 @@ includedir=${prefix}/include Name: r_util Description: radare foundation libraries Version: @VERSION@ -Requires: +Requires: Libs: -L${libdir} -lr_util @LIBZIP@ @DL_LIBS@ Cflags: -I${includedir}/libr -I${includedir}/libr/sdb diff --git a/shlr/bochs/include/libbochs.h b/shlr/bochs/include/libbochs.h index 83f6bfb09c..24afe55f93 100644 --- a/shlr/bochs/include/libbochs.h +++ b/shlr/bochs/include/libbochs.h @@ -54,7 +54,7 @@ bool bochs_open(libbochs_t* b, const char *rutaBochs, const char *rutaConfig); #endif -/*! +/*! int gdbr_remove_bp(libgdbr_t* g, ut64 address); int gdbr_remove_hwbp(libgdbr_t* g, ut64 address); */ diff --git a/shlr/capstone-patches/.oobfix-X86_insn_reg_intel.patch b/shlr/capstone-patches/.oobfix-X86_insn_reg_intel.patch index 44d9ee9706..0a78239b25 100644 --- a/shlr/capstone-patches/.oobfix-X86_insn_reg_intel.patch +++ b/shlr/capstone-patches/.oobfix-X86_insn_reg_intel.patch @@ -12,6 +12,6 @@ index f7d35d2..06827c3 100644 + int first = 0; + int last = ARR_SIZE(insn_regs_intel) - 1; + int mid = ARR_SIZE(insn_regs_intel) / 2; - + if (!intel_regs_sorted) { memcpy (insn_regs_intel_sorted, insn_regs_intel, diff --git a/shlr/capstone-patches/v4/capstone-calloc.patch b/shlr/capstone-patches/v4/capstone-calloc.patch index d0647084d2..9b48aa296b 100644 --- a/shlr/capstone-patches/v4/capstone-calloc.patch +++ b/shlr/capstone-patches/v4/capstone-calloc.patch @@ -5,7 +5,7 @@ index 4c39f999..e1bce3a6 100644 @@ -24,6 +24,7 @@ void MCInst_Init(MCInst *inst) inst->Operands[i].ImmVal = 0; } - + + memset (inst, 0, sizeof (MCInst)); inst->Opcode = 0; inst->OpcodePub = 0; @@ -16,7 +16,7 @@ index 98f30f76..11092880 100644 +++ b/cs.c @@ -838,7 +838,7 @@ size_t CAPSTONE_API cs_disasm(csh ud, const uint8_t *buffer, size_t size, uint64 size_org = size; - + total_size = sizeof(cs_insn) * cache_size; - total = cs_mem_malloc(total_size); + total = cs_mem_calloc(1, total_size); @@ -24,7 +24,7 @@ index 98f30f76..11092880 100644 // insufficient memory handle->errnum = CS_ERR_MEM; @@ -856,7 +856,7 @@ size_t CAPSTONE_API cs_disasm(csh ud, const uint8_t *buffer, size_t size, uint64 - + if (handle->detail) { // allocate memory for @detail pointer - insn_cache->detail = cs_mem_malloc(sizeof(cs_detail)); diff --git a/shlr/capstone-patches/v4/fix-x86-16.patch b/shlr/capstone-patches/v4/fix-x86-16.patch index 7a8fa2fe12..a5baae8084 100644 --- a/shlr/capstone-patches/v4/fix-x86-16.patch +++ b/shlr/capstone-patches/v4/fix-x86-16.patch @@ -5,7 +5,7 @@ index 32e28916..1fdbe1b4 100644 @@ -641,6 +641,9 @@ static void printPCRelImm(MCInst *MI, unsigned OpNo, SStream *O) if (MI->Opcode == X86_CALLpcrel16 || MI->Opcode == X86_JMP_2) imm = imm & 0xffff; - + + if (MI->csh->mode == CS_MODE_16) + imm |= (MI->address >> 16) << 16; + @@ -19,10 +19,10 @@ index aa2c3bd5..c08cafdc 100644 @@ -858,6 +858,9 @@ static void printPCRelImm(MCInst *MI, unsigned OpNo, SStream *O) if (MI->Opcode == X86_CALLpcrel16 || MI->Opcode == X86_JMP_2) imm = imm & 0xffff; - + + if (MI->csh->mode == CS_MODE_16) + imm |= (MI->address >> 16) << 16; + printImm(MI, O, imm, true); - + if (MI->csh->detail) { diff --git a/shlr/capstone-patches/v4/sstream-null.patch b/shlr/capstone-patches/v4/sstream-null.patch index a7a6144a21..e69e522302 100644 --- a/shlr/capstone-patches/v4/sstream-null.patch +++ b/shlr/capstone-patches/v4/sstream-null.patch @@ -10,5 +10,5 @@ index 90cef53..7ee9fd9 100644 + return; + } unsigned int len = (unsigned int) strlen(s); - + memcpy(ss->buffer + ss->index, s, len); diff --git a/shlr/capstone-patches/v5/fix-x86-16.patch b/shlr/capstone-patches/v5/fix-x86-16.patch index 039d6420bd..1232fed998 100644 --- a/shlr/capstone-patches/v5/fix-x86-16.patch +++ b/shlr/capstone-patches/v5/fix-x86-16.patch @@ -5,7 +5,7 @@ index 216efb25..37cab473 100644 @@ -536,6 +536,9 @@ static void printPCRelImm(MCInst *MI, unsigned OpNo, SStream *O) imm = imm & 0xffffffff; } - + + if (MI->csh->mode == CS_MODE_16) + imm = (imm & 0xf0000) + (imm&0xffff); + @@ -19,10 +19,10 @@ index 5361172d..45625ab1 100644 @@ -767,6 +767,9 @@ static void printPCRelImm(MCInst *MI, unsigned OpNo, SStream *O) imm = imm & 0xffffffff; } - + + if (MI->csh->mode == CS_MODE_16) + imm = (imm & 0xf0000) + (imm&0xffff); + printImm(MI, O, imm, true); - + if (MI->csh->detail) { diff --git a/shlr/capstone-patches/v5/mmm.patch b/shlr/capstone-patches/v5/mmm.patch index 3e76c7d857..9c781c9e30 100644 --- a/shlr/capstone-patches/v5/mmm.patch +++ b/shlr/capstone-patches/v5/mmm.patch @@ -4,9 +4,9 @@ index d734ce5d..d946cd34 100644 +++ b/functions.mk @@ -2,7 +2,6 @@ # Common functions used by Makefile & tests/Makefile - + define compile - @$(CC) -MM -MP -MT $@ -MT $(@:.o=.d) $(CFLAGS) $< > $(@:.o=.d) ${CC} ${CFLAGS} -c $< -o $@ endef - + diff --git a/shlr/grub/fs/btrfs.c b/shlr/grub/fs/btrfs.c index dc4da311a4..bf8d79cd5a 100644 --- a/shlr/grub/fs/btrfs.c +++ b/shlr/grub/fs/btrfs.c @@ -27,7 +27,7 @@ #define BTRFS_SIGNATURE "_BHRfS_M" R_PACKED( struct btrfs_superblock -{ +{ grub_uint8_t dummy1[32]; grub_uint16_t uuid[8]; grub_uint8_t dummy2[16]; diff --git a/shlr/grub/fs/cpio.c b/shlr/grub/fs/cpio.c index 14ae9ee10b..a4ff76a7f7 100644 --- a/shlr/grub/fs/cpio.c +++ b/shlr/grub/fs/cpio.c @@ -363,7 +363,7 @@ grub_cpio_close (grub_file_t file) } #ifndef MODE_USTAR -struct grub_fs grub_cpio_fs = { +struct grub_fs grub_cpio_fs = { .name = "cpiofs", .dir = grub_cpio_dir, .open = grub_cpio_open, diff --git a/shlr/grub/fs/hfsplus.c b/shlr/grub/fs/hfsplus.c index dcfc9cf439..2a2cdd57b6 100644 --- a/shlr/grub/fs/hfsplus.c +++ b/shlr/grub/fs/hfsplus.c @@ -983,7 +983,7 @@ grub_hfsplus_dir (grub_device_t device, const char *path, static grub_err_t -grub_hfsplus_label (grub_device_t device +grub_hfsplus_label (grub_device_t device , char **label) { /* XXX: It's not documented how to read a label. */ diff --git a/shlr/grub/fs/jfs.c b/shlr/grub/fs/jfs.c index 8ab7b0b1dd..7b18c67a1e 100644 --- a/shlr/grub/fs/jfs.c +++ b/shlr/grub/fs/jfs.c @@ -178,7 +178,7 @@ struct grub_jfs_inode { /* The tree describing the extents of the file. */ R_PACKED ( - struct + struct { struct grub_jfs_treehead tree; struct grub_jfs_tree_extent extents[16]; diff --git a/shlr/grub/fs/minix.c b/shlr/grub/fs/minix.c index 551517ecf1..0778d3b16c 100644 --- a/shlr/grub/fs/minix.c +++ b/shlr/grub/fs/minix.c @@ -524,7 +524,7 @@ grub_minix_dir (grub_device_t device, const char *path, char filename[data->filename_size + 1]; #else char * filename = grub_malloc(data->filename_size + 1); -#endif +#endif int dirino = data->ino; struct grub_dirhook_info info; grub_memset (&info, 0, sizeof (info)); diff --git a/shlr/grub/fs/ufs.c b/shlr/grub/fs/ufs.c index bdd91a8b7b..1f93f0a5d0 100644 --- a/shlr/grub/fs/ufs.c +++ b/shlr/grub/fs/ufs.c @@ -443,7 +443,7 @@ grub_ufs_lookup_symlink (struct grub_ufs_data *data, int ino) { grub_disk_read (data->disk, (INODE_DIRBLOCKS (data, 0) - << grub_num_to_cpu32 (data->sblock.log2_blksz, + << grub_num_to_cpu32 (data->sblock.log2_blksz, data->be)), 0, INODE_SIZE (data), symlink); symlink[INODE_SIZE (data)] = '\0'; @@ -535,7 +535,7 @@ grub_ufs_find_file (struct grub_ufs_data *data, const char *path) if (!grub_strcmp (name, filename)) { dirino = data->ino; - grub_ufs_read_inode (data, grub_num_to_cpu32 (dirent.ino, + grub_ufs_read_inode (data, grub_num_to_cpu32 (dirent.ino, data->be), 0); if ((INODE_MODE(data) & GRUB_UFS_ATTR_TYPE) diff --git a/shlr/grub/include/config-util.h b/shlr/grub/include/config-util.h index e50f6c577b..8f3100c00f 100644 --- a/shlr/grub/include/config-util.h +++ b/shlr/grub/include/config-util.h @@ -1060,7 +1060,7 @@ /* Define to the prefix of C symbols at the assembler and linker level, either an underscore or empty. */ -#define USER_LABEL_PREFIX +#define USER_LABEL_PREFIX /* Version number of package */ #define VERSION "1.99~beta0" diff --git a/shlr/grub/include/grub/fshelp.h b/shlr/grub/include/grub/fshelp.h index 6910cd0dfc..202eb540b4 100644 --- a/shlr/grub/include/grub/fshelp.h +++ b/shlr/grub/include/grub/fshelp.h @@ -69,7 +69,7 @@ grub_err_t grub_fshelp_find_file (const char *path, beginning with the block POS. READ_HOOK should be set before reading a block from the file. GET_BLOCK is used to translate file blocks to disk blocks. The file is FILESIZE bytes big and the - blocks have a size of LOG2BLOCKSIZE (in log2). + blocks have a size of LOG2BLOCKSIZE (in log2). */ grub_ssize_t grub_fshelp_read_file (grub_disk_t disk, grub_fshelp_node_t node, void (*read_hook) diff --git a/shlr/grub/include/grub/relocator.h b/shlr/grub/include/grub/relocator.h index 653a00eba7..ffa002ed67 100644 --- a/shlr/grub/include/grub/relocator.h +++ b/shlr/grub/include/grub/relocator.h @@ -41,7 +41,7 @@ grub_phys_addr_t get_physical_target_address (grub_relocator_chunk_t in); grub_err_t -grub_relocator_alloc_chunk_align (struct grub_relocator *rel, +grub_relocator_alloc_chunk_align (struct grub_relocator *rel, grub_relocator_chunk_t *out, grub_phys_addr_t min_addr, grub_phys_addr_t max_addr, diff --git a/shlr/grub/include/grub/relocator_private.h b/shlr/grub/include/grub/relocator_private.h index 1c563cb64e..d8e972e012 100644 --- a/shlr/grub/include/grub/relocator_private.h +++ b/shlr/grub/include/grub/relocator_private.h @@ -65,19 +65,19 @@ void grub_cpu_relocator_jumper (void *rels, grub_addr_t addr); struct grub_relocator_mmap_event { enum { - IN_REG_START = 0, - IN_REG_END = 1, - REG_BEG_START = 2, + IN_REG_START = 0, + IN_REG_END = 1, + REG_BEG_START = 2, REG_BEG_END = REG_BEG_START | 1, #if GRUB_RELOCATOR_HAVE_FIRMWARE_REQUESTS - REG_FIRMWARE_START = 4, + REG_FIRMWARE_START = 4, REG_FIRMWARE_END = REG_FIRMWARE_START | 1, /* To track the regions already in heap. */ - FIRMWARE_BLOCK_START = 6, + FIRMWARE_BLOCK_START = 6, FIRMWARE_BLOCK_END = FIRMWARE_BLOCK_START | 1, #endif #if GRUB_RELOCATOR_HAVE_LEFTOVERS - REG_LEFTOVER_START = 8, + REG_LEFTOVER_START = 8, REG_LEFTOVER_END = REG_LEFTOVER_START | 1, #endif COLLISION_START = 10, @@ -99,7 +99,7 @@ struct grub_relocator_mmap_event }; }; -/* Return 0 on failure, 1 on success. The failure here +/* Return 0 on failure, 1 on success. The failure here can be very time-expensive, so please make sure fill events is accurate. */ #if GRUB_RELOCATOR_HAVE_FIRMWARE_REQUESTS int grub_relocator_firmware_alloc_region (grub_phys_addr_t start, diff --git a/shlr/grub/include/grub/types.h b/shlr/grub/include/grub/types.h index b16dad09b0..09a0596b8d 100644 --- a/shlr/grub/include/grub/types.h +++ b/shlr/grub/include/grub/types.h @@ -158,25 +158,25 @@ static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x) #elif _MSC_VER __inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x) { - grub_uint32_t _x = (x); - _x = (grub_uint32_t) ((_x << 24) - | ((_x & (grub_uint32_t) 0xFF00UL) << 8) - | ((_x & (grub_uint32_t) 0xFF0000UL) >> 8) - | (_x >> 24)); + grub_uint32_t _x = (x); + _x = (grub_uint32_t) ((_x << 24) + | ((_x & (grub_uint32_t) 0xFF00UL) << 8) + | ((_x & (grub_uint32_t) 0xFF0000UL) >> 8) + | (_x >> 24)); return _x; }; __inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x) -{ - grub_uint64_t _x = (x); - _x = (grub_uint64_t) ((_x << 56) - | ((_x & (grub_uint64_t) 0xFF00ULL) << 40) - | ((_x & (grub_uint64_t) 0xFF0000ULL) << 24) - | ((_x & (grub_uint64_t) 0xFF000000ULL) << 8) - | ((_x & (grub_uint64_t) 0xFF00000000ULL) >> 8) - | ((_x & (grub_uint64_t) 0xFF0000000000ULL) >> 24) - | ((_x & (grub_uint64_t) 0xFF000000000000ULL) >> 40) - | (_x >> 56)); +{ + grub_uint64_t _x = (x); + _x = (grub_uint64_t) ((_x << 56) + | ((_x & (grub_uint64_t) 0xFF00ULL) << 40) + | ((_x & (grub_uint64_t) 0xFF0000ULL) << 24) + | ((_x & (grub_uint64_t) 0xFF000000ULL) << 8) + | ((_x & (grub_uint64_t) 0xFF00000000ULL) >> 8) + | ((_x & (grub_uint64_t) 0xFF0000000000ULL) >> 24) + | ((_x & (grub_uint64_t) 0xFF000000000000ULL) >> 40) + | (_x >> 56)); return _x; }; #else /* not gcc 4.3 or newer */ diff --git a/shlr/grub/main.c b/shlr/grub/main.c index d438a872ca..987731b332 100644 --- a/shlr/grub/main.c +++ b/shlr/grub/main.c @@ -78,7 +78,7 @@ grub_file_t openimage(grub_fs_t fs, const char *str) { int dirhook (const char *filename, const struct grub_dirhook_info *info, void *closure) { //info->mtimeset //info->case_insensitive - printf ("DIRFILE: %c (%d) %s\n", info->dir?'d':'f', + printf ("DIRFILE: %c (%d) %s\n", info->dir?'d':'f', info->mtime, filename); return 0; } diff --git a/shlr/qnx/include/libqnxr.h b/shlr/qnx/include/libqnxr.h index 70ec61d3be..c77d25802e 100644 --- a/shlr/qnx/include/libqnxr.h +++ b/shlr/qnx/include/libqnxr.h @@ -29,7 +29,7 @@ typedef struct { st64 tid; } ptid_t; -/*! +/*! * Core "object" that saves * the instance of the lib */ diff --git a/shlr/sdb/Makefile b/shlr/sdb/Makefile index 2537e6cc9b..48b82e6d30 100644 --- a/shlr/sdb/Makefile +++ b/shlr/sdb/Makefile @@ -83,7 +83,7 @@ w32dist: rm -rf sdb-${SDBVER} install-dirs: - $(INSTALL_DIR) ${DESTDIR}${MANDIR} ${DESTDIR}${LIBDIR}/pkgconfig ${DESTDIR}${BINDIR} + $(INSTALL_DIR) ${DESTDIR}${MANDIR} ${DESTDIR}${LIBDIR}/pkgconfig ${DESTDIR}${BINDIR} $(INSTALL_DIR) ${DESTDIR}${DATADIR}/vala/vapi ${DESTDIR}${INCDIR}/sdb INCFILES=src/sdb.h src/sdb_version.h src/cdb.h src/ht_uu.h src/ht_up.h src/ht_pp.h src/types.h diff --git a/shlr/sdb/config.mk b/shlr/sdb/config.mk index 61390f9f9d..59e11d8a33 100644 --- a/shlr/sdb/config.mk +++ b/shlr/sdb/config.mk @@ -123,7 +123,7 @@ CFLAGS+=-DMINGW32=1 else CFLAGS+=-fPIC SOVERSION=0 -LDFLAGS_SHARED?=-fPIC +LDFLAGS_SHARED?=-fPIC endif endif LDFLAGS_SHARED+=-Wl,-soname,libsdb.so.$(SOVERSION) diff --git a/shlr/sdb/src/array.c b/shlr/sdb/src/array.c index d93eea684c..9b277d8742 100644 --- a/shlr/sdb/src/array.c +++ b/shlr/sdb/src/array.c @@ -44,13 +44,13 @@ static int astrcmp(const char *a, const char *b) { } } -static inline int cstring_cmp(const void *a, const void *b) { +static inline int cstring_cmp(const void *a, const void *b) { const char **va = (const char **)a; const char **vb = (const char **)b; return astrcmp (*va, *vb); } -static inline int int_cmp(const void *a, const void *b) { +static inline int int_cmp(const void *a, const void *b) { const ut64 va = *(const ut64 *)a; const ut64 vb = *(const ut64 *)b; if (va > vb) { @@ -60,7 +60,7 @@ static inline int int_cmp(const void *a, const void *b) { return -1; } return 0; -} +} SDB_API ut64 sdb_array_get_num(Sdb *s, const char *key, int idx, ut32 *cas) { int i; @@ -151,7 +151,7 @@ SDB_API int sdb_array_insert(Sdb *s, const char *key, int idx, const char *val, // XXX: lstr is wrongly computed in sdb_const_get_with an off-by-one // we can optimize this by caching value len in memory . add // sdb_const_get_size() - lstr = strlen (str); + lstr = strlen (str); // When removing strlen this conversion should be checked size_t lstr_tmp = lstr; @@ -602,7 +602,7 @@ SDB_API char *sdb_array_pop(Sdb *s, const char *key, ut32 *cas) { } SDB_API char *sdb_array_pop_head(Sdb *s, const char *key, ut32 *cas) { - // remove last element in + // remove last element in ut32 kas; char *end, *str = sdb_get (s, key, &kas); if (!str || !*str) { diff --git a/shlr/sdb/src/json/js0n.c b/shlr/sdb/src/json/js0n.c index 1d04d3a7e2..63db77b673 100644 --- a/shlr/sdb/src/json/js0n.c +++ b/shlr/sdb/src/json/js0n.c @@ -38,7 +38,7 @@ int sdb_js0n(const ut8 *js, RangstrType len, RangstrType *out) { [':'] = &&l_loop, [','] = &&l_loop, ['['] = &&l_up, [']'] = &&l_down, // tracking [] and {} individually would allow fuller validation but is really messy ['{'] = &&l_up, ['}'] = &&l_down, -//TODO: add support for rawstrings +//TODO: add support for rawstrings #if HAVE_RAWSTR ['a'...'z'] = &&l_rawstr, #else @@ -87,7 +87,7 @@ int sdb_js0n(const ut8 *js, RangstrType len, RangstrType *out) { }; static void **go = gostruct; -#if 0 +#if 0 printf (" gostrct= %p\n", gostruct); printf (" gobare = %p\n", gobare); printf (" gostr = %p\n", gostring); diff --git a/shlr/sdb/src/ls.c b/shlr/sdb/src/ls.c index b7cce872b6..2e965ca201 100644 --- a/shlr/sdb/src/ls.c +++ b/shlr/sdb/src/ls.c @@ -82,7 +82,7 @@ static SdbListIter * _sdb_list_split(SdbListIter *head) { SdbListIter *slow; if (!head || !head->n) { return head; - } + } slow = head; fast = head; int count = 0; diff --git a/shlr/sdb/src/sdb.h b/shlr/sdb/src/sdb.h index 7efa7ffdc3..8916a4eb80 100644 --- a/shlr/sdb/src/sdb.h +++ b/shlr/sdb/src/sdb.h @@ -180,7 +180,7 @@ SDB_API int sdb_diff_format(char *str, int size, const SdbDiff *diff); typedef void (*SdbDiffCallback)(const SdbDiff *diff, void *user); // Returns true iff the contents of a and b are equal including contained namespaces -// If cb is non-null, it will be called subsequently with differences. +// If cb is non-null, it will be called subsequently with differences. SDB_API bool sdb_diff(Sdb *a, Sdb *b, SdbDiffCallback cb, void *cb_user); // Gets a pointer to the value associated with `key`. diff --git a/shlr/sdb/src/text.c b/shlr/sdb/src/text.c index 707e926e07..ab5f8cd02f 100644 --- a/shlr/sdb/src/text.c +++ b/shlr/sdb/src/text.c @@ -15,11 +15,11 @@ * ******************** * * Files are UTF-8 and use '\n' line endings. Always. - * + * * Lines starting with '/' denote the path of the namespace for the following data: * * /some/namespace - * + * * The default path is root, just a slash also means root. * These paths are always absolute from the root. Characters that must be escaped in a path are: '/', '\\', '\n', '\r': * @@ -35,13 +35,13 @@ * \/slashedkey=somevalue * * Other than that, at any postion, '\\', '\n' and '\r' must be escaped: - * + * * some\\key=some\nvalue * * In the key, '=' must also be escaped (not necessary in the value): * * some\=key=some=value - * + * * -------- * Example: * diff --git a/shlr/www/f/index.html b/shlr/www/f/index.html index ce35127d09..ee42c041e8 100644 --- a/shlr/www/f/index.html +++ b/shlr/www/f/index.html @@ -86,7 +86,7 @@ font-size: 1.8em; .button { -webkit-box-shadow: 0px 4px 0px #101010; - -webkit-border-radius:0; + -webkit-border-radius:0; -webkit-appearance: none; -moz-box-shadow: 0px 4px 0px #101010; box-shadow: 0px 4px 0px #101010; @@ -217,11 +217,11 @@ b.type='button'; b.className='button'; b.setAttribute('value', title); if (mode == 'set-input') { -onClick(b, () => { +onClick(b, () => { input.value = cmd || title; }); } else if (!cmd || mode == 'input') { -onClick(b, () => { +onClick(b, () => { input.value += title; }); } else { diff --git a/shlr/www/graph/index.js b/shlr/www/graph/index.js index 4c03add55e..78f87ce0a1 100644 --- a/shlr/www/graph/index.js +++ b/shlr/www/graph/index.js @@ -40,7 +40,7 @@ function resizeCanvas() { } /** - * sets the active menu scanning for a menu item which url is a prefix + * sets the active menu scanning for a menu item which url is a prefix * of the one of the current page ignoring file extension. * Nice trick! */ @@ -48,7 +48,7 @@ function setMenu() { var url = document.location.href; // strip extension url = stripExtension(url); - + var ulElement = document.getElementById("menu"); var links = ulElement.getElementsByTagName("A"); var i; diff --git a/shlr/www/graph/js-graph-it.js b/shlr/www/graph/js-graph-it.js index b4a429082f..3547b54e49 100644 --- a/shlr/www/graph/js-graph-it.js +++ b/shlr/www/graph/js-graph-it.js @@ -8,7 +8,7 @@ var nn6=document.getElementById&&!document.all; /**************************************************** * This class is a scanner for the visitor pattern. * ****************************************************/ - + /** * Constructor, parameters are: * visitor: the visitor implementation, it must be a class with a visit(element) method. @@ -36,7 +36,7 @@ function DocumentScanner(visitor, scanElementsOnly) { /***************** * drag and drop * *****************/ - + var isdrag=false; // this flag indicates that the mouse movement is actually a drag. var mouseStartX, mouseStartY; // mouse position when drag starts var elementStartX, elementStartY; // element position when drag starts @@ -54,7 +54,7 @@ var blocksToMove; /** * this variable stores the original z-index of the object being dragged in order * to restore it upon drop. - */ + */ var originalZIndex; /** @@ -169,7 +169,7 @@ function startDrag(e) { } function stopDrag(e) { - isdrag = false; + isdrag = false; if (elementToMove) elementToMove.style.zIndex=originalZIndex; elementToMove = null; @@ -315,7 +315,7 @@ function Canvas(htmlElement) { this.blocks.push(newBlock); return false; } else if(isConnector(element)) { - // connector found, just create it, source or destination blocks may not + // connector found, just create it, source or destination blocks may not // have been initialized yet var newConnector = new Connector(element, this); this.connectors.push(newConnector); @@ -389,7 +389,7 @@ function Block(htmlElement, canvas) /* * initialization */ - + this.canvas = canvas; this.htmlElement = htmlElement; this.id = htmlElement.id; @@ -636,7 +636,7 @@ function Segment(id, parentElement) } /** * Connector class. - * The init function takes two Block objects as arguments representing + * The init function takes two Block objects as arguments representing * the source and destination of the connector */ function Connector(htmlElement, canvas) @@ -1184,7 +1184,7 @@ function findBlock(blockId) { } return null; } - + /* * This function determines whether a html element is to be considered a canvas */ @@ -1214,7 +1214,7 @@ function calculateOffsetTop(obj) { var curtop = 0; if (obj.offsetParent) { curtop = obj.offsetTop - while (obj = obj.offsetParent) + while (obj = obj.offsetParent) curtop += obj.offsetTop } else if (obj.y) curtop += obj.y; @@ -1229,7 +1229,7 @@ function calculateOffsetLeft(obj) var curleft = 0; if (obj.offsetParent) { curleft = obj.offsetLeft - while (obj = obj.offsetParent) + while (obj = obj.offsetParent) curleft += obj.offsetLeft; } else if (obj.x) curleft += obj.x; diff --git a/shlr/www/graph/sf-homepage.css b/shlr/www/graph/sf-homepage.css index 0486e190ec..c4cb356662 100644 --- a/shlr/www/graph/sf-homepage.css +++ b/shlr/www/graph/sf-homepage.css @@ -84,7 +84,7 @@ div.connector { } table.main_table { - width: 100%; + width: 100%; border-collapse: separate; } diff --git a/shlr/www/old/index.html b/shlr/www/old/index.html index 6a97372133..842011a8f5 100644 --- a/shlr/www/old/index.html +++ b/shlr/www/old/index.html @@ -362,8 +362,8 @@ window.onorientationchange = function() { css ('input', 'width', '190px'); css ('.console', 'width', '320px'); document.body.setAttribute ("class","portrait"); - break; - case -90: + break; + case -90: case 90: css ('.header', 'width', '480'); css ('input', 'width', '360'); @@ -546,7 +546,7 @@ var r2 = { - +
@@ -585,11 +585,11 @@ cmds:                ^^^

-
  vvv +
  vvv                vvv                vvv
-

+

diff --git a/shlr/www/old/style.css b/shlr/www/old/style.css index c0e53abe29..f0fb0254bc 100644 --- a/shlr/www/old/style.css +++ b/shlr/www/old/style.css @@ -43,7 +43,7 @@ a { input { /* width:310px; */ - width:190px; + width:190px; border: 1px solid black; background-color: #707070; color: #202020; diff --git a/shlr/zip/include/zip.h b/shlr/zip/include/zip.h index 86b13bd1d9..48d7287d37 100644 --- a/shlr/zip/include/zip.h +++ b/shlr/zip/include/zip.h @@ -20,7 +20,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -131,7 +131,7 @@ extern "C" { #define ZIP_ER_REMOVE 22 /* S Can't remove file */ #define ZIP_ER_DELETED 23 /* N Entry has been deleted */ #define ZIP_ER_ENCRNOTSUPP 24 /* N Encryption method not supported */ -#define ZIP_ER_RDONLY 25 /* N Read-only archive */ +#define ZIP_ER_RDONLY 25 /* N Read-only archive */ #define ZIP_ER_NOPASSWD 26 /* N No password provided */ #define ZIP_ER_WRONGPASSWD 27 /* N Wrong password provided */ @@ -222,7 +222,7 @@ struct zip; struct zip_file; struct zip_source; -typedef zip_uint32_t zip_flags_t; +typedef zip_uint32_t zip_flags_t; typedef zip_int64_t (*zip_source_callback)(void *, void *, zip_uint64_t, enum zip_source_cmd); diff --git a/shlr/zip/include/zipint.h b/shlr/zip/include/zipint.h index 54c92ea74a..27782ab55b 100644 --- a/shlr/zip/include/zipint.h +++ b/shlr/zip/include/zipint.h @@ -20,7 +20,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -271,7 +271,7 @@ struct zip { unsigned int nfile; /* number of opened files within archive */ unsigned int nfile_alloc; /* number of files allocated */ struct zip_file **file; /* opened files within archive */ - + char *tempdir; /* custom temp dir (needed e.g. for OS X sandboxing) */ }; diff --git a/shlr/zip/zip/config.h b/shlr/zip/zip/config.h index 0beb7dcc89..f7b255dbaa 100644 --- a/shlr/zip/zip/config.h +++ b/shlr/zip/zip/config.h @@ -40,7 +40,7 @@ #define HAVE_INTTYPES_H 1 /* Define to 1 if you have the `z' library (-lz). */ -#define HAVE_LIBZ 0 +#define HAVE_LIBZ 0 /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 diff --git a/shlr/zip/zip/zip_add.c b/shlr/zip/zip/zip_add.c index 5b907824b3..4bce3fd4af 100644 --- a/shlr/zip/zip/zip_add.c +++ b/shlr/zip/zip/zip_add.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_add_dir.c b/shlr/zip/zip/zip_add_dir.c index 22a28bd856..e1c402072f 100644 --- a/shlr/zip/zip/zip_add_dir.c +++ b/shlr/zip/zip/zip_add_dir.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_add_entry.c b/shlr/zip/zip/zip_add_entry.c index 3a7e2ccbe9..74bbe5a36a 100644 --- a/shlr/zip/zip/zip_add_entry.c +++ b/shlr/zip/zip/zip_add_entry.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_close.c b/shlr/zip/zip/zip_close.c index 9506d27fdf..a3a690af9a 100644 --- a/shlr/zip/zip/zip_close.c +++ b/shlr/zip/zip/zip_close.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -148,7 +148,7 @@ zip_close(struct zip *za) free(filelist); return -1; } - + if (zip_get_archive_flag(za, ZIP_AFL_TORRENT, 0)) qsort(filelist, survivors, sizeof(filelist[0]), _zip_torrentzip_cmp); @@ -430,14 +430,14 @@ add_data(struct zip *za, struct zip_source *src, struct zip_dirent *de, FILE *ft if ((ret=_zip_dirent_write(de, ft, flags, &za->error)) < 0) return -1; - + if (is_zip64 != ret) { /* Zip64 mismatch between preliminary file header written before data and final file header written afterwards */ _zip_error_set(&za->error, ZIP_ER_INTERNAL, 0); return -1; } - + if (fseeko(ft, offend, SEEK_SET) < 0) { _zip_error_set(&za->error, ZIP_ER_SEEK, errno); return -1; @@ -531,7 +531,7 @@ write_cdir(struct zip *za, const struct zip_filelist *filelist, zip_uint64_t sur if ((size=_zip_cdir_write(za, filelist, survivors, out)) < 0) return -1; - + end = ftello(out); if (zip_get_archive_flag(za, ZIP_AFL_TORRENT, 0) == 0) diff --git a/shlr/zip/zip/zip_delete.c b/shlr/zip/zip/zip_delete.c index cb769367cc..12ce2a666e 100644 --- a/shlr/zip/zip/zip_delete.c +++ b/shlr/zip/zip/zip_delete.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_dir_add.c b/shlr/zip/zip/zip_dir_add.c index 0a74bd6087..cb6e4dbe57 100644 --- a/shlr/zip/zip/zip_dir_add.c +++ b/shlr/zip/zip/zip_dir_add.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_dirent.c b/shlr/zip/zip/zip_dirent.c index 24ddde219f..ba298383ab 100644 --- a/shlr/zip/zip/zip_dirent.c +++ b/shlr/zip/zip/zip_dirent.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -86,7 +86,7 @@ _zip_cdir_grow(struct zip_cdir *cd, zip_uint64_t nentry, struct zip_error *error _zip_error_set(error, ZIP_ER_MEMORY, 0); return -1; } - + for (i=cd->nentry_alloc; ichanged = 0; tde->cloned = 1; @@ -311,7 +311,7 @@ _zip_dirent_new(void) If bufp is non-NULL, data is taken from there and bufp is advanced by the amount of data used; otherwise data is read from fp as needed. - + if leftp is non-NULL, no more bytes than specified by it are used, and *leftp is reduced by the number of bytes used. @@ -375,19 +375,19 @@ _zip_dirent_read(struct zip_dirent *zde, FILE *fp, zde->version_needed = _zip_read2(&cur); zde->bitflags = _zip_read2(&cur); zde->comp_method = _zip_read2(&cur); - + /* convert to time_t */ dostime = _zip_read2(&cur); dosdate = _zip_read2(&cur); zde->last_mod = _zip_d2u_time(dostime, dosdate); - + zde->crc = _zip_read4(&cur); zde->comp_size = _zip_read4(&cur); zde->uncomp_size = _zip_read4(&cur); - + filename_len = _zip_read2(&cur); ef_len = _zip_read2(&cur); - + if (local) { comment_len = 0; zde->disk_number = 0; @@ -490,14 +490,14 @@ _zip_dirent_read(struct zip_dirent *zde, FILE *fp, zde->disk_number = _zip_read4(&ef); } } - + if (!local) { if (zde->offset > ZIP_OFF_MAX) { _zip_error_set(error, ZIP_ER_SEEK, EFBIG); return -1; } } - + zde->extra_fields = _zip_ef_remove_internal(zde->extra_fields); if (bufp) @@ -532,7 +532,7 @@ _zip_dirent_process_ef_utf_8(const struct zip_dirent *de, zip_uint16_t id, struc str = ef_str; } } - + return str; } @@ -605,7 +605,7 @@ _zip_dirent_torrent_normalize(struct zip_dirent *de) last_mod = mktime(&torrenttime); } - + de->version_madeby = 0; de->version_needed = 20; /* 2.0 */ de->bitflags = 2; /* maximum compression */ @@ -704,7 +704,7 @@ _zip_dirent_write(struct zip_dirent *de, FILE *fp, zip_flags_t flags, struct zip is_really_zip64 = _zip_dirent_needs_zip64(de, flags); else is_really_zip64 = is_zip64; - + if ((flags & ZIP_FL_LOCAL) == 0) _zip_write2(is_really_zip64 ? 45 : de->version_madeby, fp); _zip_write2(is_really_zip64 ? 45 : de->version_needed, fp); @@ -727,7 +727,7 @@ _zip_dirent_write(struct zip_dirent *de, FILE *fp, zip_flags_t flags, struct zip _zip_write2(_zip_string_length(de->filename), fp); _zip_write2(_zip_ef_size(de->extra_fields, flags) + _zip_ef_size(ef, ZIP_EF_BOTH), fp); - + if ((flags & ZIP_FL_LOCAL) == 0) { _zip_write2(_zip_string_length(de->comment), fp); _zip_write2((zip_uint16_t)de->disk_number, fp); @@ -770,10 +770,10 @@ _zip_d2u_time(zip_uint16_t dtime, zip_uint16_t ddate) struct tm tm; memset(&tm, 0, sizeof(tm)); - + /* let mktime decide if DST is in effect */ tm.tm_isdst = -1; - + tm.tm_year = ((ddate>>9)&127) + 1980 - 1900; tm.tm_mon = ((ddate>>5)&15) - 1; tm.tm_mday = ddate&31; @@ -800,7 +800,7 @@ _zip_ef_utf8(zip_uint16_t id, struct zip_string *str, struct zip_error *error) if (len+5 > ZIP_UINT16_MAX) { /* XXX: error */ } - + if ((data=(zip_uint8_t *)malloc(len+5)) == NULL) { _zip_error_set(error, ZIP_ER_MEMORY, 0); return NULL; @@ -991,7 +991,7 @@ _zip_write4(zip_uint32_t i, FILE *fp) putc((i>>8)&0xff, fp); putc((i>>16)&0xff, fp); putc((i>>24)&0xff, fp); - + return; } @@ -1008,7 +1008,7 @@ _zip_write8(zip_uint64_t i, FILE *fp) putc((i>>40)&0xff, fp); putc((i>>48)&0xff, fp); putc((i>>56)&0xff, fp); - + return; } diff --git a/shlr/zip/zip/zip_discard.c b/shlr/zip/zip/zip_discard.c index 37ba8c2ea6..236c2148e1 100644 --- a/shlr/zip/zip/zip_discard.c +++ b/shlr/zip/zip/zip_discard.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -75,7 +75,7 @@ zip_discard(struct zip *za) } free(za->file); - + free(za); return; diff --git a/shlr/zip/zip/zip_entry.c b/shlr/zip/zip/zip_entry.c index 58663e8d0c..7a4fa0eb16 100644 --- a/shlr/zip/zip/zip_entry.c +++ b/shlr/zip/zip/zip_entry.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_err_str.c b/shlr/zip/zip/zip_err_str.c index 8fb60036e0..d3f8395121 100644 --- a/shlr/zip/zip/zip_err_str.c +++ b/shlr/zip/zip/zip_err_str.c @@ -33,7 +33,7 @@ const char * const _zip_err_str[] = { "Can't remove file", "Entry has been deleted", "Encryption method not supported", - "Read-only archive", + "Read-only archive", "No password provided", "Wrong password provided", }; @@ -70,7 +70,7 @@ const int _zip_err_type[] = { S, N, N, - N, + N, N, N, }; diff --git a/shlr/zip/zip/zip_error.c b/shlr/zip/zip/zip_error.c index 668cdcd1c0..e948cb1c41 100644 --- a/shlr/zip/zip/zip_error.c +++ b/shlr/zip/zip/zip_error.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -109,7 +109,7 @@ void _zip_error_set_from_source(struct zip_error *err, struct zip_source *src) { int ze, se; - + zip_source_error(src, &ze, &se); _zip_error_set(err, ze, se); } diff --git a/shlr/zip/zip/zip_error_clear.c b/shlr/zip/zip/zip_error_clear.c index b4ff103912..e5cd6555c4 100644 --- a/shlr/zip/zip/zip_error_clear.c +++ b/shlr/zip/zip/zip_error_clear.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_error_get.c b/shlr/zip/zip/zip_error_get.c index 6d1c958c17..9db27ab3b0 100644 --- a/shlr/zip/zip/zip_error_get.c +++ b/shlr/zip/zip/zip_error_get.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_error_get_sys_type.c b/shlr/zip/zip/zip_error_get_sys_type.c index 6c6f380740..0dcd25e85f 100644 --- a/shlr/zip/zip/zip_error_get_sys_type.c +++ b/shlr/zip/zip/zip_error_get_sys_type.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_error_strerror.c b/shlr/zip/zip/zip_error_strerror.c index 3d0951cfb1..5adac56c49 100644 --- a/shlr/zip/zip/zip_error_strerror.c +++ b/shlr/zip/zip/zip_error_strerror.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_error_to_str.c b/shlr/zip/zip/zip_error_to_str.c index 11a0cd2bb0..e8e1406f58 100644 --- a/shlr/zip/zip/zip_error_to_str.c +++ b/shlr/zip/zip/zip_error_to_str.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_extra_field.c b/shlr/zip/zip/zip_extra_field.c index 94cdfa7a23..53d36d0465 100644 --- a/shlr/zip/zip/zip_extra_field.c +++ b/shlr/zip/zip/zip_extra_field.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -45,16 +45,16 @@ struct zip_extra_field * _zip_ef_clone(const struct zip_extra_field *ef, struct zip_error *error) { struct zip_extra_field *head, *prev, *def; - + head = prev = NULL; - + while (ef) { if ((def=_zip_ef_new(ef->id, ef->size, ef->data, ef->flags)) == NULL) { _zip_error_set(error, ZIP_ER_MEMORY, 0); _zip_ef_free(head); return NULL; } - + if (head == NULL) head = def; if (prev) @@ -63,7 +63,7 @@ _zip_ef_clone(const struct zip_extra_field *ef, struct zip_error *error) ef = ef->next; } - + return head; } @@ -93,7 +93,7 @@ _zip_ef_delete_by_id(struct zip_extra_field *ef, zip_uint16_t id, zip_uint16_t i continue; } } - + i++; if (i > id_idx) break; @@ -126,7 +126,7 @@ const zip_uint8_t * _zip_ef_get_by_id(const struct zip_extra_field *ef, zip_uint16_t *lenp, zip_uint16_t id, zip_uint16_t id_idx, zip_flags_t flags, struct zip_error *error) { static const zip_uint8_t empty[1] = { '\0' }; - + int i; i = 0; @@ -267,10 +267,10 @@ _zip_ef_remove_internal(struct zip_extra_field *ef) { struct zip_extra_field *ef_head; struct zip_extra_field *prev, *next; - + ef_head = ef; prev = NULL; - + while (ef) { if (ZIP_EF_IS_INTERNAL(ef->id)) { next = ef->next; @@ -287,7 +287,7 @@ _zip_ef_remove_internal(struct zip_extra_field *ef) ef = ef->next; } } - + return ef_head; } @@ -381,7 +381,7 @@ _zip_read_local_ef(struct zip *za, zip_uint64_t idx) } e->orig->local_extra_fields_read = 1; - + if (e->changes && e->changes->local_extra_fields_read == 0) { e->changes->extra_fields = e->orig->extra_fields; e->changes->local_extra_fields_read = 1; diff --git a/shlr/zip/zip/zip_extra_field_api.c b/shlr/zip/zip/zip_extra_field_api.c index 02ed4555e0..8905967daf 100644 --- a/shlr/zip/zip/zip_extra_field_api.c +++ b/shlr/zip/zip/zip_extra_field_api.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -46,10 +46,10 @@ zip_file_extra_field_delete(struct zip *za, zip_uint64_t idx, zip_uint16_t ef_id _zip_error_set(&za->error, ZIP_ER_INVAL, 0); return -1; } - + if (_zip_get_dirent(za, idx, 0, NULL) == NULL) return -1; - + if (ZIP_IS_RDONLY(za)) { _zip_error_set(&za->error, ZIP_ER_RDONLY, 0); return -1; @@ -57,9 +57,9 @@ zip_file_extra_field_delete(struct zip *za, zip_uint64_t idx, zip_uint16_t ef_id if (_zip_file_extra_field_prepare_for_change(za, idx) < 0) return -1; - + de = za->entry[idx].changes; - + de->extra_fields = _zip_ef_delete_by_id(de->extra_fields, ZIP_EXTRA_FIELD_ALL, ef_idx, flags); return 0; } @@ -75,7 +75,7 @@ zip_file_extra_field_delete_by_id(struct zip *za, zip_uint64_t idx, zip_uint16_t _zip_error_set(&za->error, ZIP_ER_INVAL, 0); return -1; } - + if (_zip_get_dirent(za, idx, 0, NULL) == NULL) return -1; @@ -83,10 +83,10 @@ zip_file_extra_field_delete_by_id(struct zip *za, zip_uint64_t idx, zip_uint16_t _zip_error_set(&za->error, ZIP_ER_RDONLY, 0); return -1; } - + if (_zip_file_extra_field_prepare_for_change(za, idx) < 0) return -1; - + de = za->entry[idx].changes; de->extra_fields = _zip_ef_delete_by_id(de->extra_fields, ef_id, ef_idx, flags); @@ -237,12 +237,12 @@ zip_file_extra_field_set(struct zip *za, zip_uint64_t idx, zip_uint16_t ef_id, z if (_zip_get_dirent(za, idx, 0, NULL) == NULL) return -1; - + if (ZIP_IS_RDONLY(za)) { _zip_error_set(&za->error, ZIP_ER_RDONLY, 0); return -1; } - + if (ZIP_EF_IS_INTERNAL(ef_id)) { _zip_error_set(&za->error, ZIP_ER_INVAL, 0); return -1; @@ -250,7 +250,7 @@ zip_file_extra_field_set(struct zip *za, zip_uint64_t idx, zip_uint16_t ef_id, z if (_zip_file_extra_field_prepare_for_change(za, idx) < 0) return -1; - + de = za->entry[idx].changes; ef = de->extra_fields; @@ -292,7 +292,7 @@ zip_file_extra_field_set(struct zip *za, zip_uint64_t idx, zip_uint16_t ef_id, z _zip_error_set(&za->error, ZIP_ER_INVAL, 0); return -1; } - + if ((ef_new=_zip_ef_new(ef_id, len, data, flags)) == NULL) { _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); return -1; @@ -312,7 +312,7 @@ zip_file_extra_field_set(struct zip *za, zip_uint64_t idx, zip_uint16_t ef_id, z ef->flags &= ~(flags & ZIP_EF_BOTH); ef_new->next = ef->next; ef->next = ef_new; - } + } } else if (ef_prev) { ef_new->next = ef_prev->next; @@ -320,7 +320,7 @@ zip_file_extra_field_set(struct zip *za, zip_uint64_t idx, zip_uint16_t ef_id, z } else de->extra_fields = ef_new; - + return 0; } @@ -330,14 +330,14 @@ int _zip_file_extra_field_prepare_for_change(struct zip *za, zip_uint64_t idx) { struct zip_entry *e; - + if (idx >= za->nentry) { _zip_error_set(&za->error, ZIP_ER_INVAL, 0); return -1; } - + e = za->entry+idx; - + if (e->changes && (e->changes->changed & ZIP_DIRENT_EXTRA_FIELD)) return 0; @@ -345,20 +345,20 @@ _zip_file_extra_field_prepare_for_change(struct zip *za, zip_uint64_t idx) if (_zip_read_local_ef(za, idx) < 0) return -1; } - + if (e->changes == NULL) { if ((e->changes=_zip_dirent_clone(e->orig)) == NULL) { _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); return -1; } } - + if (e->orig && e->orig->extra_fields) { if ((e->changes->extra_fields=_zip_ef_clone(e->orig->extra_fields, &za->error)) == NULL) return -1; } e->changes->changed |= ZIP_DIRENT_EXTRA_FIELD; - + return 0; } diff --git a/shlr/zip/zip/zip_fdopen.c b/shlr/zip/zip/zip_fdopen.c index ae8952ea9a..5804832f56 100644 --- a/shlr/zip/zip/zip_fdopen.c +++ b/shlr/zip/zip/zip_fdopen.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -56,7 +56,7 @@ zip_fdopen(int fd_orig, int _flags, int *zep) return NULL; } flags = (unsigned int)_flags; - + if (flags & ZIP_TRUNCATE) { *zep = ZIP_ER_INVAL; return NULL; diff --git a/shlr/zip/zip/zip_file_add.c b/shlr/zip/zip/zip_file_add.c index 995cb91c1a..1a9b2b00c2 100644 --- a/shlr/zip/zip/zip_file_add.c +++ b/shlr/zip/zip/zip_file_add.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_file_error_clear.c b/shlr/zip/zip/zip_file_error_clear.c index ce8b6cbd94..2fd5e28ba7 100644 --- a/shlr/zip/zip/zip_file_error_clear.c +++ b/shlr/zip/zip/zip_file_error_clear.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_file_error_get.c b/shlr/zip/zip/zip_file_error_get.c index f20e011fc7..40b706cdca 100644 --- a/shlr/zip/zip/zip_file_error_get.c +++ b/shlr/zip/zip/zip_file_error_get.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_file_get_comment.c b/shlr/zip/zip/zip_file_get_comment.c index 766731ea26..2aebfd02ee 100644 --- a/shlr/zip/zip/zip_file_get_comment.c +++ b/shlr/zip/zip/zip_file_get_comment.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_file_get_offset.c b/shlr/zip/zip/zip_file_get_offset.c index 65a011fc07..bd9c633afe 100644 --- a/shlr/zip/zip/zip_file_get_offset.c +++ b/shlr/zip/zip/zip_file_get_offset.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -71,6 +71,6 @@ _zip_file_get_offset(const struct zip *za, zip_uint64_t idx, struct zip_error *e _zip_error_set(error, ZIP_ER_SEEK, EFBIG); return 0; } - + return offset + (zip_uint32_t)size; } diff --git a/shlr/zip/zip/zip_file_rename.c b/shlr/zip/zip/zip_file_rename.c index 383a52adae..0b3885e9d1 100644 --- a/shlr/zip/zip/zip_file_rename.c +++ b/shlr/zip/zip/zip_file_rename.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -44,7 +44,7 @@ zip_file_rename(struct zip *za, zip_uint64_t idx, const char *name, zip_flags_t { const char *old_name; int old_is_dir, new_is_dir; - + if (idx >= za->nentry || (name != NULL && strlen(name) > ZIP_UINT16_MAX)) { _zip_error_set(&za->error, ZIP_ER_INVAL, 0); return -1; @@ -57,7 +57,7 @@ zip_file_rename(struct zip *za, zip_uint64_t idx, const char *name, zip_flags_t if ((old_name=zip_get_name(za, idx, 0)) == NULL) return -1; - + new_is_dir = (name != NULL && name[strlen(name)-1] == '/'); old_is_dir = (old_name[strlen(old_name)-1] == '/'); diff --git a/shlr/zip/zip/zip_file_replace.c b/shlr/zip/zip/zip_file_replace.c index 7e7e942168..ad616b9288 100644 --- a/shlr/zip/zip/zip_file_replace.c +++ b/shlr/zip/zip/zip_file_replace.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -60,7 +60,7 @@ zip_int64_t _zip_file_replace(struct zip *za, zip_uint64_t idx, const char *name, struct zip_source *source, zip_flags_t flags) { zip_uint64_t za_nentry_prev; - + if (ZIP_IS_RDONLY(za)) { _zip_error_set(&za->error, ZIP_ER_RDONLY, 0); return -1; @@ -80,7 +80,7 @@ _zip_file_replace(struct zip *za, zip_uint64_t idx, const char *name, struct zip } idx = (zip_uint64_t)i; } - + if (name && _zip_set_name(za, idx, name, flags) != 0) { if (za->nentry != za_nentry_prev) { _zip_entry_finalize(za->entry+idx); diff --git a/shlr/zip/zip/zip_file_set_comment.c b/shlr/zip/zip/zip_file_set_comment.c index 722f3d43cc..b68187fdf6 100644 --- a/shlr/zip/zip/zip_file_set_comment.c +++ b/shlr/zip/zip/zip_file_set_comment.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_file_strerror.c b/shlr/zip/zip/zip_file_strerror.c index 9ba70f14ff..2d32b53f9f 100644 --- a/shlr/zip/zip/zip_file_strerror.c +++ b/shlr/zip/zip/zip_file_strerror.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_filerange_crc.c b/shlr/zip/zip/zip_filerange_crc.c index 3b1c868407..897604f778 100644 --- a/shlr/zip/zip/zip_filerange_crc.c +++ b/shlr/zip/zip/zip_filerange_crc.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -54,7 +54,7 @@ _zip_filerange_crc(FILE *fp, off_t start, off_t len, uLong *crcp, _zip_error_set(errp, ZIP_ER_SEEK, errno); return -1; } - + while (len > 0) { n = len > BUFSIZE ? BUFSIZE : (size_t)len; if ((n=fread(buf, 1, n, fp)) == 0) { diff --git a/shlr/zip/zip/zip_fopen.c b/shlr/zip/zip/zip_fopen.c index 331f79ea36..fff86f92c5 100644 --- a/shlr/zip/zip/zip_fopen.c +++ b/shlr/zip/zip/zip_fopen.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_fopen_encrypted.c b/shlr/zip/zip/zip_fopen_encrypted.c index 34230f00d7..78f2f5dd78 100644 --- a/shlr/zip/zip/zip_fopen_encrypted.c +++ b/shlr/zip/zip/zip_fopen_encrypted.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_fopen_index.c b/shlr/zip/zip/zip_fopen_index.c index 30466ffa19..ecc73a3fcf 100644 --- a/shlr/zip/zip/zip_fopen_index.c +++ b/shlr/zip/zip/zip_fopen_index.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_fopen_index_encrypted.c b/shlr/zip/zip/zip_fopen_index_encrypted.c index cc81ca7f53..bc4f8e52af 100644 --- a/shlr/zip/zip/zip_fopen_index_encrypted.c +++ b/shlr/zip/zip/zip_fopen_index_encrypted.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -80,7 +80,7 @@ _zip_file_new(struct zip *za) _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); return NULL; } - + if (za->nfile+1 >= za->nfile_alloc) { unsigned int n; n = za->nfile_alloc + 10; diff --git a/shlr/zip/zip/zip_fread.c b/shlr/zip/zip/zip_fread.c index 8235c6dfac..1b93a977b9 100644 --- a/shlr/zip/zip/zip_fread.c +++ b/shlr/zip/zip/zip_fread.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_get_archive_comment.c b/shlr/zip/zip/zip_get_archive_comment.c index 202f761f4e..32ef887af5 100644 --- a/shlr/zip/zip/zip_get_archive_comment.c +++ b/shlr/zip/zip/zip_get_archive_comment.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_get_archive_flag.c b/shlr/zip/zip/zip_get_archive_flag.c index c3be5c14fe..b292177b08 100644 --- a/shlr/zip/zip/zip_get_archive_flag.c +++ b/shlr/zip/zip/zip_get_archive_flag.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_get_compression_implementation.c b/shlr/zip/zip/zip_get_compression_implementation.c index aa4a1605c0..8cafbbbeb4 100644 --- a/shlr/zip/zip/zip_get_compression_implementation.c +++ b/shlr/zip/zip/zip_get_compression_implementation.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_get_encryption_implementation.c b/shlr/zip/zip/zip_get_encryption_implementation.c index 7dcb99210d..b97a49053b 100644 --- a/shlr/zip/zip/zip_get_encryption_implementation.c +++ b/shlr/zip/zip/zip_get_encryption_implementation.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_get_file_comment.c b/shlr/zip/zip/zip_get_file_comment.c index 3be459d4da..64e979d763 100644 --- a/shlr/zip/zip/zip_get_file_comment.c +++ b/shlr/zip/zip/zip_get_file_comment.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_get_name.c b/shlr/zip/zip/zip_get_name.c index f67c7caf43..e6f9fc4c04 100644 --- a/shlr/zip/zip/zip_get_name.c +++ b/shlr/zip/zip/zip_get_name.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_get_num_entries.c b/shlr/zip/zip/zip_get_num_entries.c index 26484baff2..5b7d1235d2 100644 --- a/shlr/zip/zip/zip_get_num_entries.c +++ b/shlr/zip/zip/zip_get_num_entries.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_get_num_files.c b/shlr/zip/zip/zip_get_num_files.c index 29b06dc819..8c02266801 100644 --- a/shlr/zip/zip/zip_get_num_files.c +++ b/shlr/zip/zip/zip_get_num_files.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_name_locate.c b/shlr/zip/zip/zip_name_locate.c index 5534ed9a85..794293f2cd 100644 --- a/shlr/zip/zip/zip_name_locate.c +++ b/shlr/zip/zip/zip_name_locate.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_new.c b/shlr/zip/zip/zip_new.c index f77634a389..537337ae7f 100644 --- a/shlr/zip/zip/zip_new.c +++ b/shlr/zip/zip/zip_new.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -67,6 +67,6 @@ _zip_new(struct zip_error *error) za->nfile = za->nfile_alloc = 0; za->file = NULL; za->tempdir = NULL; - + return za; } diff --git a/shlr/zip/zip/zip_open.c b/shlr/zip/zip/zip_open.c index bcd462e258..f0e6f9f4b9 100644 --- a/shlr/zip/zip/zip_open.c +++ b/shlr/zip/zip/zip_open.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -65,14 +65,14 @@ zip_open(const char *fn, int _flags, int *zep) { FILE *fp; unsigned int flags; - + if (_flags < 0) { if (zep) *zep = ZIP_ER_INVAL; return NULL; } flags = (unsigned int)_flags; - + switch (_zip_file_exists(fn, flags, zep)) { case -1: return NULL; @@ -81,7 +81,7 @@ zip_open(const char *fn, int _flags, int *zep) default: if (flags & ZIP_TRUNCATE) { FILE *f; - + if ((f = fopen(fn, "rb")) == NULL) { set_error(zep, NULL, ZIP_ER_OPEN); return NULL; @@ -105,7 +105,7 @@ ZIP_EXTERN int zip_archive_set_tempdir(struct zip *za, const char *tempdir) { char *new_tempdir; - + if (tempdir) { if ((new_tempdir = strdup(tempdir)) == NULL) { _zip_error_set(&za->error, ZIP_ER_MEMORY, errno); @@ -114,10 +114,10 @@ zip_archive_set_tempdir(struct zip *za, const char *tempdir) } else new_tempdir = NULL; - + free(za->tempdir); za->tempdir = new_tempdir; - + return 0; } @@ -160,7 +160,7 @@ _zip_open(const char *fn, FILE *fp, unsigned int flags, int *zep) za->nentry = cdir->nentry; za->nentry_alloc = cdir->nentry_alloc; za->comment_orig = cdir->comment; - + za->zp = fp; _zip_check_torrentzip(za, cdir); @@ -194,7 +194,7 @@ set_error(int *zep, const struct zip_error *err, int ze) /* _zip_readcdir: tries to find a valid end-of-central-directory at the beginning of buf, and then the corresponding central directory entries. - Returns a struct zip_cdir which contains the central directory + Returns a struct zip_cdir which contains the central directory entries, or NULL if unsuccessful. */ static struct zip_cdir * @@ -295,7 +295,7 @@ _zip_readcdir(FILE *fp, off_t buf_offset, unsigned char *buf, const unsigned cha _zip_cdir_free(cd); return NULL; } - + return cd; } @@ -468,7 +468,7 @@ _zip_file_exists(const char *fn, unsigned int flags, int *zep) set_error(zep, NULL, ZIP_ER_INVAL); return -1; } - + if (stat(fn, &st) != 0) { if (flags & ZIP_CREATE) return 0; @@ -507,7 +507,7 @@ _zip_find_central_dir(FILE *fp, unsigned int flags, int *zep, off_t len) return NULL; } buf_offset = ftello(fp); - + /* 64k is too much for stack */ if ((buf=(unsigned char *)malloc(CDBUFSIZE)) == NULL) { set_error(zep, NULL, ZIP_ER_MEMORY); @@ -522,7 +522,7 @@ _zip_find_central_dir(FILE *fp, unsigned int flags, int *zep, off_t len) free(buf); return NULL; } - + best = -1; cdir = NULL; match = buf+ (buflen < CDBUFSIZE ? 0 : EOCD64LOCLEN); @@ -560,7 +560,7 @@ _zip_find_central_dir(FILE *fp, unsigned int flags, int *zep, off_t len) } free(buf); - + if (best < 0) { set_error(zep, &zerr, 0); _zip_cdir_free(cdir); @@ -576,7 +576,7 @@ static unsigned char * _zip_memmem(const unsigned char *big, size_t biglen, const unsigned char *little, size_t littlelen) { const unsigned char *p; - + if ((biglen < littlelen) || (littlelen == 0)) return NULL; p = big-1; @@ -623,7 +623,7 @@ _zip_read_eocd(const unsigned char *eocd, const unsigned char *buf, off_t buf_of _zip_error_set(error, ZIP_ER_SEEK, EFBIG); return NULL; } - + if (offset+size > (zip_uint64_t)(buf_offset + (eocd-buf))) { /* cdir spans past EOCD record */ _zip_error_set(error, ZIP_ER_INCONS, 0); @@ -640,7 +640,7 @@ _zip_read_eocd(const unsigned char *eocd, const unsigned char *buf, off_t buf_of cd->size = (off_t)size; cd->offset = (off_t)offset; - + return cd; } @@ -659,7 +659,7 @@ _zip_read_eocd64(FILE *f, const zip_uint8_t *eocd64loc, const zip_uint8_t *buf, cdp = eocd64loc+8; eocd_offset = _zip_read8(&cdp); - + if (eocd_offset > ZIP_OFF_MAX || eocd_offset + EOCD64LEN > ZIP_OFF_MAX) { _zip_error_set(error, ZIP_ER_SEEK, EFBIG); return NULL; @@ -697,7 +697,7 @@ _zip_read_eocd64(FILE *f, const zip_uint8_t *eocd64loc, const zip_uint8_t *buf, return NULL; } cdp += 4; - + size = _zip_read8(&cdp); if ((flags & ZIP_CHECKCONS) && size+eocd_offset+12 != (zip_uint64_t)(buf_offset+(eocd64loc-buf))) { @@ -707,7 +707,7 @@ _zip_read_eocd64(FILE *f, const zip_uint8_t *eocd64loc, const zip_uint8_t *buf, cdp += 4; /* skip version made by/needed */ cdp += 8; /* skip num disks */ - + nentry = _zip_read8(&cdp); i = _zip_read8(&cdp); @@ -731,7 +731,7 @@ _zip_read_eocd64(FILE *f, const zip_uint8_t *eocd64loc, const zip_uint8_t *buf, if ((cd=_zip_cdir_new(nentry, error)) == NULL) return NULL; - + cd->size = (off_t)size; cd->offset = (off_t)offset; diff --git a/shlr/zip/zip/zip_rename.c b/shlr/zip/zip/zip_rename.c index 8841caeca9..feb11089d4 100644 --- a/shlr/zip/zip/zip_rename.c +++ b/shlr/zip/zip/zip_rename.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_replace.c b/shlr/zip/zip/zip_replace.c index de717afec7..06656f08d5 100644 --- a/shlr/zip/zip/zip_replace.c +++ b/shlr/zip/zip/zip_replace.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_set_archive_comment.c b/shlr/zip/zip/zip_set_archive_comment.c index df1caee06b..0240aa5d53 100644 --- a/shlr/zip/zip/zip_set_archive_comment.c +++ b/shlr/zip/zip/zip_set_archive_comment.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -79,6 +79,6 @@ zip_set_archive_comment(struct zip *za, const char *comment, zip_uint16_t len) za->comment_changes = cstr; za->comment_changed = 1; } - + return 0; } diff --git a/shlr/zip/zip/zip_set_archive_flag.c b/shlr/zip/zip/zip_set_archive_flag.c index b6cdab120d..22db81c90b 100644 --- a/shlr/zip/zip/zip_set_archive_flag.c +++ b/shlr/zip/zip/zip_set_archive_flag.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -41,7 +41,7 @@ ZIP_EXTERN int zip_set_archive_flag(struct zip *za, unsigned int flag, int value) { unsigned int new_flags; - + if (value) new_flags = za->ch_flags | flag; else diff --git a/shlr/zip/zip/zip_set_default_password.c b/shlr/zip/zip/zip_set_default_password.c index b9aa80acff..71f1af84be 100644 --- a/shlr/zip/zip/zip_set_default_password.c +++ b/shlr/zip/zip/zip_set_default_password.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -48,7 +48,7 @@ zip_set_default_password(struct zip *za, const char *passwd) if (za->default_password) free(za->default_password); - + if (passwd) { if ((za->default_password=strdup(passwd)) == NULL) { _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); diff --git a/shlr/zip/zip/zip_set_file_comment.c b/shlr/zip/zip/zip_set_file_comment.c index 7acd0eb36d..4edb1fcf46 100644 --- a/shlr/zip/zip/zip_set_file_comment.c +++ b/shlr/zip/zip/zip_set_file_comment.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_set_file_compression.c b/shlr/zip/zip/zip_set_file_compression.c index ea8517d70e..b14dd454dd 100644 --- a/shlr/zip/zip/zip_set_file_compression.c +++ b/shlr/zip/zip/zip_set_file_compression.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -60,11 +60,11 @@ zip_set_file_compression(struct zip *za, zip_uint64_t idx, } e = za->entry+idx; - + old_method = (e->orig == NULL ? ZIP_CM_DEFAULT : e->orig->comp_method); - + /* XXX: revisit this when flags are supported, since they may require a recompression */ - + if (method == old_method) { if (e->changes) { e->changes->changed &= ~ZIP_DIRENT_COMP_METHOD; @@ -85,6 +85,6 @@ zip_set_file_compression(struct zip *za, zip_uint64_t idx, e->changes->comp_method = method; e->changes->changed |= ZIP_DIRENT_COMP_METHOD; } - + return 0; } diff --git a/shlr/zip/zip/zip_set_name.c b/shlr/zip/zip/zip_set_name.c index 60c9e7d5bf..f7e7ba187a 100644 --- a/shlr/zip/zip/zip_set_name.c +++ b/shlr/zip/zip/zip_set_name.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_source_buffer.c b/shlr/zip/zip/zip_source_buffer.c index 8a13e7602d..4ab6d1aecc 100644 --- a/shlr/zip/zip/zip_source_buffer.c +++ b/shlr/zip/zip/zip_source_buffer.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -71,7 +71,7 @@ zip_source_buffer(struct zip *za, const void *data, zip_uint64_t len, int freep) f->end = ((const char *)data)+len; f->freep = freep; f->mtime = time(NULL); - + if ((zs=zip_source_function(za, read_data, f)) == NULL) { free(f); return NULL; @@ -115,7 +115,7 @@ read_data(void *state, void *data, zip_uint64_t len, enum zip_source_cmd cmd) case ZIP_SOURCE_STAT: { struct zip_stat *st; - + if (len < sizeof(*st)) return -1; @@ -129,7 +129,7 @@ read_data(void *state, void *data, zip_uint64_t len, enum zip_source_cmd cmd) st->encryption_method = ZIP_EM_NONE; st->valid = ZIP_STAT_MTIME|ZIP_STAT_SIZE|ZIP_STAT_COMP_SIZE |ZIP_STAT_COMP_METHOD|ZIP_STAT_ENCRYPTION_METHOD; - + return sizeof(*st); } diff --git a/shlr/zip/zip/zip_source_close.c b/shlr/zip/zip/zip_source_close.c index 7b89d5fc15..bf319c3982 100644 --- a/shlr/zip/zip/zip_source_close.c +++ b/shlr/zip/zip/zip_source_close.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -49,6 +49,6 @@ zip_source_close(struct zip_source *src) (void)src->cb.l(src->src, src->ud, NULL, 0, ZIP_SOURCE_CLOSE); zip_source_close(src->src); } - + src->is_open = 0; } diff --git a/shlr/zip/zip/zip_source_crc.c b/shlr/zip/zip/zip_source_crc.c index 99bc965228..b8b4a37715 100644 --- a/shlr/zip/zip/zip_source_crc.c +++ b/shlr/zip/zip/zip_source_crc.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -71,7 +71,7 @@ zip_source_crc(struct zip *za, struct zip_source *src, int validate) ctx->e[0] = ctx->e[1] = 0; ctx->size = 0; ctx->crc = 0; - + return zip_source_layered(za, src, crc_read, ctx); } @@ -112,13 +112,13 @@ crc_read(struct zip_source *src, void *_ctx, void *data, if ((st.valid & ZIP_STAT_CRC) && st.crc != ctx->crc) { ctx->e[0] = ZIP_ER_CRC; ctx->e[1] = 0; - + return -1; } if ((st.valid & ZIP_STAT_SIZE) && st.size != ctx->size) { ctx->e[0] = ZIP_ER_INCONS; ctx->e[1] = 0; - + return -1; } } @@ -162,5 +162,5 @@ crc_read(struct zip_source *src, void *_ctx, void *data, default: return -1; } - + } diff --git a/shlr/zip/zip/zip_source_deflate.c b/shlr/zip/zip/zip_source_deflate.c index 879953144c..5c8aed8280 100644 --- a/shlr/zip/zip/zip_source_deflate.c +++ b/shlr/zip/zip/zip_source_deflate.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -108,7 +108,7 @@ compress_read(struct zip_source *src, struct deflate *ctx, if (ctx->e[0] != 0) return -1; - + if (len == 0) return 0; @@ -182,7 +182,7 @@ decompress_read(struct zip_source *src, struct deflate *ctx, if (ctx->e[0] != 0) return -1; - + if (len == 0) return 0; @@ -196,7 +196,7 @@ decompress_read(struct zip_source *src, struct deflate *ctx, switch (ret) { case Z_OK: break; - + case Z_STREAM_END: ctx->eof = 1; end = 1; @@ -379,7 +379,7 @@ deflate_decompress(struct zip_source *src, void *ud, void *data, ctx->e[1] = 0; return -1; } - + } diff --git a/shlr/zip/zip/zip_source_error.c b/shlr/zip/zip/zip_source_error.c index a1efd551ea..91561d1564 100644 --- a/shlr/zip/zip/zip_source_error.c +++ b/shlr/zip/zip/zip_source_error.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_source_file.c b/shlr/zip/zip/zip_source_file.c index 79c8ee5aca..74d361b9f3 100644 --- a/shlr/zip/zip/zip_source_file.c +++ b/shlr/zip/zip/zip_source_file.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_source_filep.c b/shlr/zip/zip/zip_source_filep.c index 0bd2d6846e..0a81373326 100644 --- a/shlr/zip/zip/zip_source_filep.c +++ b/shlr/zip/zip/zip_source_filep.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -197,7 +197,7 @@ read_file(void *state, void *data, zip_uint64_t len, enum zip_source_cmd cmd) struct zip_stat *st; struct stat fst; int err; - + if (z->f) err = fstat(fileno(z->f), &fst); else diff --git a/shlr/zip/zip/zip_source_free.c b/shlr/zip/zip/zip_source_free.c index b1e7840496..650e573647 100644 --- a/shlr/zip/zip/zip_source_free.c +++ b/shlr/zip/zip/zip_source_free.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_source_function.c b/shlr/zip/zip/zip_source_function.c index cb92e339b4..d1a5a15bf8 100644 --- a/shlr/zip/zip/zip_source_function.c +++ b/shlr/zip/zip/zip_source_function.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -52,7 +52,7 @@ zip_source_function(struct zip *za, zip_source_callback zcb, void *ud) zs->cb.f = zcb; zs->ud = ud; - + return zs; } diff --git a/shlr/zip/zip/zip_source_layered.c b/shlr/zip/zip/zip_source_layered.c index ad2870333c..2ed3e906d8 100644 --- a/shlr/zip/zip/zip_source_layered.c +++ b/shlr/zip/zip/zip_source_layered.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -54,6 +54,6 @@ zip_source_layered(struct zip *za, struct zip_source *src, zs->src = src; zs->cb.l = cb; zs->ud = ud; - + return zs; } diff --git a/shlr/zip/zip/zip_source_open.c b/shlr/zip/zip/zip_source_open.c index a5010393e7..4a83637291 100644 --- a/shlr/zip/zip/zip_source_open.c +++ b/shlr/zip/zip/zip_source_open.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -61,7 +61,7 @@ zip_source_open(struct zip_source *src) if (ret < 0) { zip_source_close(src->src); - + if (ret == ZIP_SOURCE_ERR_LOWER) src->error_source = ZIP_LES_LOWER; else @@ -71,6 +71,6 @@ zip_source_open(struct zip_source *src) } src->is_open = 1; - + return 0; } diff --git a/shlr/zip/zip/zip_source_pkware.c b/shlr/zip/zip/zip_source_pkware.c index ec53dfeef0..bc5f67f9b9 100644 --- a/shlr/zip/zip/zip_source_pkware.c +++ b/shlr/zip/zip/zip_source_pkware.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -142,7 +142,7 @@ decrypt_header(struct zip_source *src, struct trad_pkware *ctx) zip_source_error(src, ctx->e, ctx->e+1); return -1; } - + if (n != HEADERLEN) { ctx->e[0] = ZIP_ER_EOF; ctx->e[1] = 0; diff --git a/shlr/zip/zip/zip_source_pop.c b/shlr/zip/zip/zip_source_pop.c index cd9cb529b5..06d4b6a01d 100644 --- a/shlr/zip/zip/zip_source_pop.c +++ b/shlr/zip/zip/zip_source_pop.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_source_read.c b/shlr/zip/zip/zip_source_read.c index 81b90ba42d..2bb3848cca 100644 --- a/shlr/zip/zip/zip_source_read.c +++ b/shlr/zip/zip/zip_source_read.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -59,6 +59,6 @@ zip_source_read(struct zip_source *src, void *data, zip_uint64_t len) src->error_source = ZIP_LES_UPPER; return -1; } - + return ret; } diff --git a/shlr/zip/zip/zip_source_stat.c b/shlr/zip/zip/zip_source_stat.c index 85ae6a2fd6..f1cfa7de3e 100644 --- a/shlr/zip/zip/zip_source_stat.c +++ b/shlr/zip/zip/zip_source_stat.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -67,6 +67,6 @@ zip_source_stat(struct zip_source *src, struct zip_stat *st) src->error_source = ZIP_LES_UPPER; return -1; } - + return 0; } diff --git a/shlr/zip/zip/zip_source_window.c b/shlr/zip/zip/zip_source_window.c index fd202099b5..812363b82e 100644 --- a/shlr/zip/zip/zip_source_window.c +++ b/shlr/zip/zip/zip_source_window.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -146,5 +146,5 @@ window_read(struct zip_source *src, void *_ctx, void *data, default: return -1; } - + } diff --git a/shlr/zip/zip/zip_source_zip.c b/shlr/zip/zip/zip_source_zip.c index e4fc2229f7..7d8944240f 100644 --- a/shlr/zip/zip/zip_source_zip.c +++ b/shlr/zip/zip/zip_source_zip.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -48,10 +48,10 @@ zip_source_zip(struct zip *za, struct zip *srcza, zip_uint64_t srcidx, _zip_error_set(&za->error, ZIP_ER_INVAL, 0); return NULL; } - + if (len == -1) len = 0; - + if (start == 0 && len == 0) flags |= ZIP_FL_COMPRESSED; else diff --git a/shlr/zip/zip/zip_source_zip_new.c b/shlr/zip/zip/zip_source_zip_new.c index 8e48f6f3fa..9c6393d024 100644 --- a/shlr/zip/zip/zip_source_zip_new.c +++ b/shlr/zip/zip/zip_source_zip_new.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_stat.c b/shlr/zip/zip/zip_stat.c index 8254627d92..31cda3fcb5 100644 --- a/shlr/zip/zip/zip_stat.c +++ b/shlr/zip/zip/zip_stat.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_stat_index.c b/shlr/zip/zip/zip_stat_index.c index f4ce72aaa8..bcf21c68a0 100644 --- a/shlr/zip/zip/zip_stat_index.c +++ b/shlr/zip/zip/zip_stat_index.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -49,7 +49,7 @@ zip_stat_index(struct zip *za, zip_uint64_t index, zip_flags_t flags, if ((name=zip_get_name(za, index, flags)) == NULL) return -1; - + if ((flags & ZIP_FL_UNCHANGED) == 0 && ZIP_ENTRY_DATA_CHANGED(za->entry+index)) { @@ -83,6 +83,6 @@ zip_stat_index(struct zip *za, zip_uint64_t index, zip_flags_t flags, st->index = index; st->name = name; st->valid |= ZIP_STAT_INDEX|ZIP_STAT_NAME; - + return 0; } diff --git a/shlr/zip/zip/zip_stat_init.c b/shlr/zip/zip/zip_stat_init.c index d17613bf5e..195470f4dd 100644 --- a/shlr/zip/zip/zip_stat_init.c +++ b/shlr/zip/zip/zip_stat_init.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_strerror.c b/shlr/zip/zip/zip_strerror.c index 9ebee144f9..1d07ddbb22 100644 --- a/shlr/zip/zip/zip_strerror.c +++ b/shlr/zip/zip/zip_strerror.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_string.c b/shlr/zip/zip/zip_string.c index a2d5eb5d3f..a0f13d00c2 100644 --- a/shlr/zip/zip/zip_string.c +++ b/shlr/zip/zip/zip_string.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -44,10 +44,10 @@ zip_uint32_t _zip_string_crc32(const struct zip_string *s) { zip_uint32_t crc; - + crc = (zip_uint32_t)crc32(0L, Z_NULL, 0); - if (s != NULL) + if (s != NULL) crc = (zip_uint32_t)crc32(crc, s->raw, s->length); return crc; @@ -113,7 +113,7 @@ _zip_string_get(struct zip_string *string, zip_uint32_t *lenp, zip_flags_t flags return string->converted; } } - + if (lenp) *lenp = string->length; return string->raw; @@ -137,7 +137,7 @@ _zip_string_new(const zip_uint8_t *raw, zip_uint16_t length, zip_flags_t flags, { struct zip_string *s; enum zip_encoding_type expected_encoding; - + if (length == 0) return NULL; @@ -180,7 +180,7 @@ _zip_string_new(const zip_uint8_t *raw, zip_uint16_t length, zip_flags_t flags, return NULL; } } - + return s; } @@ -191,6 +191,6 @@ _zip_string_write(const struct zip_string *s, FILE *f) { if (s == NULL) return; - + fwrite(s->raw, s->length, 1, f); } diff --git a/shlr/zip/zip/zip_unchange.c b/shlr/zip/zip/zip_unchange.c index 5f0e753b78..7d8c9212ef 100644 --- a/shlr/zip/zip/zip_unchange.c +++ b/shlr/zip/zip/zip_unchange.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -51,7 +51,7 @@ int _zip_unchange(struct zip *za, zip_uint64_t idx, int allow_duplicates) { zip_int64_t i; - + if (idx >= za->nentry) { _zip_error_set(&za->error, ZIP_ER_INVAL, 0); return -1; diff --git a/shlr/zip/zip/zip_unchange_all.c b/shlr/zip/zip/zip_unchange_all.c index bbc2825eb6..a5482defce 100644 --- a/shlr/zip/zip/zip_unchange_all.c +++ b/shlr/zip/zip/zip_unchange_all.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_unchange_archive.c b/shlr/zip/zip/zip_unchange_archive.c index e24ee21727..0bb9041f6d 100644 --- a/shlr/zip/zip/zip_unchange_archive.c +++ b/shlr/zip/zip/zip_unchange_archive.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -47,7 +47,7 @@ zip_unchange_archive(struct zip *za) za->comment_changes = NULL; za->comment_changed = 0; } - + za->ch_flags = za->flags; return 0; diff --git a/shlr/zip/zip/zip_unchange_data.c b/shlr/zip/zip/zip_unchange_data.c index fa25feb038..17c899ed43 100644 --- a/shlr/zip/zip/zip_unchange_data.c +++ b/shlr/zip/zip/zip_unchange_data.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shlr/zip/zip/zip_utf-8.c b/shlr/zip/zip/zip_utf-8.c index e9e5c2cdf6..99174d306c 100644 --- a/shlr/zip/zip/zip_utf-8.c +++ b/shlr/zip/zip/zip_utf-8.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -173,7 +173,7 @@ done: if (expected_encoding != enc && enc != ZIP_ENCODING_ASCII) return ZIP_ENCODING_ERROR; } - + return enc; } diff --git a/shlr/zip/zip/zipint.h b/shlr/zip/zip/zipint.h index bed84d6e76..d981017b51 100644 --- a/shlr/zip/zip/zipint.h +++ b/shlr/zip/zip/zipint.h @@ -20,7 +20,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -40,7 +40,7 @@ #include #ifdef __WINDOWS__ -#define ZIP_EXTERN +#define ZIP_EXTERN //__declspec(dllexport) /* for dup(), close(), etc. */ #include @@ -267,7 +267,7 @@ struct zip { unsigned int nfile; /* number of opened files within archive */ unsigned int nfile_alloc; /* number of files allocated */ struct zip_file **file; /* opened files within archive */ - + char *tempdir; /* custom temp dir (needed e.g. for OS X sandboxing) */ }; diff --git a/sys/CONFIG b/sys/CONFIG index c673aa193b..5b27136d2a 100644 --- a/sys/CONFIG +++ b/sys/CONFIG @@ -2,7 +2,7 @@ PYTHON_VERSION=2.7 PYTHON=python${PYTHON_VERSION} [ -z "${PREFIX}" ] && PREFIX=/usr -ID=`id -u` +ID=`id -u` if [ "$ID" = 0 ]; then SUDO= else diff --git a/sys/android-release.sh b/sys/android-release.sh index 1daa25511f..b2fbb839e2 100755 --- a/sys/android-release.sh +++ b/sys/android-release.sh @@ -55,7 +55,7 @@ if [ ! -d "${R2B}" ]; then fi cd "$R2B" -for a in ${ARCHS} ; do +for a in ${ARCHS} ; do echo "Releasing $a ..." git checkout android-${a} || exit 1 if [ -f "${R2T}/radare2-${v}-android-${a}.tar.gz" ]; then diff --git a/sys/cccl b/sys/cccl index eaeee8150c..a98f91a263 100755 --- a/sys/cccl +++ b/sys/cccl @@ -122,7 +122,7 @@ EOF -O2) clopt="${clopt},${slash}O2" ;; - + -I*) path=$(echo "$1" | sed 's,-I,,') path=$(cygpath -aw "$path") @@ -228,7 +228,7 @@ EOF ;; *.cc | *.cxx | *.C) - # C++ source file with non .cpp extension, make sure cl understand + # C++ source file with non .cpp extension, make sure cl understand # that it is C++ clopt="${clopt},${slash}Tp$1" ;; diff --git a/sys/indent.sh b/sys/indent.sh index fbe1c21f68..f196114785 100755 --- a/sys/indent.sh +++ b/sys/indent.sh @@ -107,7 +107,7 @@ indentFile() { rm -f .tmp-clang-format fi cp -f .clang-format ${D}/.clang-format - cd "$CWD" + cd "$CWD" ( clang-format "${IFILE}" > .tmp-format ) @@ -153,7 +153,7 @@ indentFile() { # 0xa0 mv .tmp-format .tmp-format2 perl -ne 's/[\xa0\xc2]//g;print' < .tmp-format2 > .tmp-format - # remove spaces after #if + # remove spaces after #if #mv .tmp-format .tmp-format2 #perl -ne 's/#if\ */#if /g;print' < .tmp-format2 > .tmp-format # add spce after every // diff --git a/sys/install.sh b/sys/install.sh index 5012714555..9d263becc9 100755 --- a/sys/install.sh +++ b/sys/install.sh @@ -57,7 +57,7 @@ export MAKE="$MAKE" [ -z "${INSTALL_TARGET}" ] && INSTALL_TARGET=symstall -# find +# find cd "$(dirname $0)"/.. pwd diff --git a/sys/ios-cydia.sh b/sys/ios-cydia.sh index ac7e411182..be5bd22f8f 100755 --- a/sys/ios-cydia.sh +++ b/sys/ios-cydia.sh @@ -114,7 +114,7 @@ else ls -l libr/flag/libr_flag.a || exit 1 rm -f libr/*/*.dylib ( - cd binr ; make clean ; + cd binr ; make clean ; cd blob ; make USE_LTO=1 xcrun --sdk iphoneos strip radare2 ) diff --git a/sys/ios-sdk.sh b/sys/ios-sdk.sh index ae5bb4397c..b45f0430a4 100755 --- a/sys/ios-sdk.sh +++ b/sys/ios-sdk.sh @@ -11,7 +11,7 @@ EMBED_BITCODE=1 CFLAGS="-O2 -miphoneos-version-min=10.0" DOSH=0 ARCHS="" # Will be set by -archs argument. If you want to set it -> e.g. ARCHS="armv7+arm64". -MERGE_LIBS=1 # Will merge libs if you build for arm and simulator +MERGE_LIBS=1 # Will merge libs if you build for arm and simulator # Environment variables export PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:$PATH @@ -99,7 +99,7 @@ showHelp() { echo " -a, --archs" echo " Select the archs, you want to build for." - echo " Available archs: armv7, armv7s, arm64, all" + echo " Available archs: armv7, armv7s, arm64, all" echo " You can select multiple archs by concatenating" echo " them with a '+' sign." echo " Or specify 'all' to build for armv7+armv7s+arm64." @@ -139,7 +139,7 @@ if [ $# -eq 0 ] && [ "${#ARCHS}" = 0 ] && [ "${USE_SIMULATOR}" = 0 ]; then fi while test $# -gt 0; do - case "$1" in + case "$1" in -full|--full|-f) shift ARCHS="armv7s+arm64" diff --git a/sys/purge.sh b/sys/purge.sh index c626b608f9..63bc193078 100755 --- a/sys/purge.sh +++ b/sys/purge.sh @@ -6,7 +6,7 @@ if [ -z "${MAKE}" ]; then [ $? = 0 ] && MAKE=gmake fi -echo "All files related to current and previous installations +echo "All files related to current and previous installations of r2 (including libraries) will be deleted. Continue? (y/n) " read answer case "$answer" in diff --git a/sys/shellcheck.sh b/sys/shellcheck.sh index 5df4074ec9..2b616f025d 100755 --- a/sys/shellcheck.sh +++ b/sys/shellcheck.sh @@ -4,7 +4,7 @@ checkshellscript() { filelist="$1" checkfun="$2" - printf '%s\n' "$filelist" | while IFS= read -r file + printf '%s\n' "$filelist" | while IFS= read -r file do $checkfun "$file" done diff --git a/sys/source_bat.bash b/sys/source_bat.bash index 4a8d1e263b..9a247c82bb 100755 --- a/sys/source_bat.bash +++ b/sys/source_bat.bash @@ -21,9 +21,9 @@ fi #echo `dirname "$(readlink -f "$_")"` ___update_env_func___() { tmpbat=$(mktemp --suffix .bat) -rc=$?; if [[ $rc != 0 ]]; then +rc=$?; if [[ $rc != 0 ]]; then echo "Could not create temporary bat file" - return $rc + return $rc fi echo "@echo off " >> $tmpbat @@ -31,16 +31,16 @@ echo "call \"$@\" 1>&2 " >> $tmpbat echo "if %errorlevel% neq 0 exit /b %errorlevel%" >> $tmpbat echo "printenv " >> $tmpbat echo "if %errorlevel% neq 0 exit /b %errorlevel%" >> $tmpbat -rc=$?; if [[ $rc != 0 ]]; then +rc=$?; if [[ $rc != 0 ]]; then echo "Could not write temporary bat file" return $rc fi tmpbat_win=$(basename $tmpbat) env_data=$(cmd "/c call %TEMP%\\$tmpbat_win ") -rc=$?; if [[ $rc != 0 ]]; then +rc=$?; if [[ $rc != 0 ]]; then echo "Could not run temporary bat file" - return $rc + return $rc fi echo @@ -53,7 +53,7 @@ ps1_old=$PS1 while read -r line; do echo "export $line" - export "$line" + export "$line" done <<< "$env_data" export PS1="$ps1_old" diff --git a/sys/sync.sh b/sys/sync.sh index 75b1d4390c..427f90abd3 100755 --- a/sys/sync.sh +++ b/sys/sync.sh @@ -1,7 +1,7 @@ #!/bin/sh if ! git remote | grep upstream > /dev/null -then +then git remote add upstream https://github.com/radareorg/radare2.git fi test -d radare2 && git fetch upstream && git rebase --onto master upstream/master