Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added linkerversion to rz-bin -I #4632

Merged
merged 1 commit into from
Sep 17, 2024

Conversation

tushar3q34
Copy link
Contributor

Your checklist for this pull request

  • I've read the guidelines for contributing to this repository
  • I made sure to follow the project's coding style
  • I've documented or updated the documentation of every function and struct this PR changes. If not so I've explained why.
  • I've added tests that prove my fix is effective or that my feature works (if possible)
  • I've updated the rizin book with the relevant information (if needed)

Detailed description

Added char * linkerversion to RzBinInfo struct and rz_bin_pe_get_linker to get the linker version.
Will be printed as lnkrver 14.29 in the output. Did not use linkerversion because it changes the spacing and requires change in all testcases.

Test plan

Changed the test test/db/formats/pe/arm to check for lnkrver

Closing issues

closes #4601

subprojects/rizin-grammar-c Outdated Show resolved Hide resolved
@tushar3q34
Copy link
Contributor Author

I think I need to increase buffer size to cater with overflows in snprintf() although there will not be any as both MajorLinkerVersion and MinorLinkerVersion are two digit numbers.

@tushar3q34 tushar3q34 force-pushed the dist-rzbin-linker-opt-I branch 2 times, most recently from a705de3 to f8a977f Compare September 12, 2024 16:53
@tushar3q34
Copy link
Contributor Author

@XVilka are both of the failing checks related to this issue or some other issue ?

@XVilka
Copy link
Member

XVilka commented Sep 13, 2024

@XVilka are both of the failing checks related to this issue or some other issue ?

Ignore those, those are non-deterministic errors

librz/core/cbin.c Outdated Show resolved Hide resolved
@wargio
Copy link
Member

wargio commented Sep 13, 2024

ignore the fuzz test failure. is unrelated.

@wargio
Copy link
Member

wargio commented Sep 13, 2024

please rebase on top of dev.

@tushar3q34 tushar3q34 force-pushed the dist-rzbin-linker-opt-I branch 2 times, most recently from cf27b7a to e03a3fb Compare September 13, 2024 15:36
librz/bin/p/bin_pe.inc Outdated Show resolved Hide resolved
Copy link
Member

@wargio wargio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the linker field and use the compiler one.

@github-actions github-actions bot removed the RzCore label Sep 16, 2024
@tushar3q34 tushar3q34 force-pushed the dist-rzbin-linker-opt-I branch 2 times, most recently from db496ec to d61afab Compare September 16, 2024 06:51
@github-actions github-actions bot removed the API label Sep 16, 2024
@tushar3q34
Copy link
Contributor Author

@wargio I am done with the changes. It failed one test : CI / Run debug tests on Ubuntu 20.04
Can you re-run this test once ? I don't think it should fail as it isn't related to the changes I made.

librz/bin/bobj_process.c Outdated Show resolved Hide resolved
@wargio
Copy link
Member

wargio commented Sep 17, 2024

Fix the tests below and we can merge.

[XX] db/cmd/cmd_pipe rzpipe.py - shared memory (shm://)
RZ_NOPLUGINS=1 /home/runner/bin/rizin -escr.utf8=0 -escr.color=0 -escr.interactive=0 -eflirt.sigdb.load.system=false -eflirt.sigdb.load.home=false -N -qc '%= `env~?^ASAN_LD_PRELOAD=`
%+ env LD_PRELOAD=`env ASAN_LD_PRELOAD`
#!pipe python3 scripts/shared_memory.py
' 'bins/elf/_Exit (42)'
-- stdout
--- expected
+++ actual
@@ -52,7 +52,7 @@
 -------------
 Shared buffer size 0x10e8
 -------------
-{'arch': 'x86', 'baddr': 4294967296, 'binsz': 4328, 'bintype': 'mach0', 'bits': 64, 'class': 'MACH064', 'endian': 'LE', 'intrp': '/usr/lib/dyld', 'laddr': 0, 'lang': 'c', 'machine': 'x86 64 all', 'maxopsz': 16, 'minopsz': 1, 'os': 'darwin', 'pcalign': 0, 'subsys': 'macOS', 'stripped': False, 'crypto': False, 'havecode': True, 'va': True, 'sanitiz': False, 'static': False, 'linenum': False, 'lsyms': False, 'canary': False, 'PIE': True, 'RELROCS': False, 'NX': False}
+{'arch': 'x86', 'baddr': 4294967296, 'binsz': 4328, 'bintype': 'mach0', 'bits': 64, 'class': 'MACH064', 'compiler': '', 'endian': 'LE', 'intrp': '/usr/lib/dyld', 'laddr': 0, 'lang': 'c', 'machine': 'x86 64 all', 'maxopsz': 16, 'minopsz': 1, 'os': 'darwin', 'pcalign': 0, 'subsys': 'macOS', 'stripped': False, 'crypto': False, 'havecode': True, 'va': True, 'sanitiz': False, 'static': False, 'linenum': False, 'lsyms': False, 'canary': False, 'PIE': True, 'RELROCS': False, 'NX': False}
 - offset -    0 1  2 3  4 5  6 7  8 9  A B  C D  E F  0123456789ABCDEF
 0x100000f70  5548 89e5 4883 ec10 c745 fc00 0000 0089  UH..H....E......

@XVilka XVilka merged commit 7cb8b39 into rizinorg:dev Sep 17, 2024
51 checks passed
@tushar3q34 tushar3q34 deleted the dist-rzbin-linker-opt-I branch September 17, 2024 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rz-bin: option: I: add linker version display for PE-based binaries
3 participants