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

New utility rz-ar to unpack .a and .lib files #4866

Open
wargio opened this issue Jan 28, 2025 · 0 comments
Open

New utility rz-ar to unpack .a and .lib files #4866

wargio opened this issue Jan 28, 2025 · 0 comments
Labels
enhancement New feature or request signatures

Comments

@wargio
Copy link
Member

wargio commented Jan 28, 2025

When you try to unpack windows built static libraries (.a and .lib) with ar x file.a it will fail due the path not being available.

Moreover there are "valid" and "invalid" libraries built by the windows sdk which can and cannot have object files.

rz-ar should be able create the needed subfolder and unpack the object files in the working directory (unless an output dir is specified).

This new utility will be beneficial for creating signatures and more.

Example:

$ rizin -qc 'ol' ar://valid-BufferOverflow.lib 
 3 * r-x 0x0000424a ar://valid-BufferOverflow.lib//d_/8180.public.fre/internal/minwin/priv_sdk/lib/amd64/loadcfg.obj
 4 - r-x 0x00004249 ar://valid-BufferOverflow.lib//d_/8180.public.fre/internal/minwin/priv_sdk/lib/amd64/guard_support.obj
 5 - r-x 0x0000d645 ar://valid-BufferOverflow.lib//e_/8180.obj.amd64fre/minkernel/tools/gs_support/ntdll/objfre/amd64/gs_dllmain.obj
 6 - r-x 0x0000fc91 ar://valid-BufferOverflow.lib//e_/8180.obj.amd64fre/minkernel/tools/gs_support/ntdll/objfre/amd64/gs_support.obj
 7 - r-x 0x00000658 ar://valid-BufferOverflow.lib//e_/8180.obj.amd64fre/minkernel/tools/gs_support/ntdll/objfre/amd64/amdsecgs.obj
$ ar tv valid-BufferOverflow.lib 
r--r--r-- 100444/100444  16970 Feb 27 07:34 2015 d:/8180.public.fre/internal/minwin/priv_sdk/lib/amd64/loadcfg.obj
r--r--r-- 100444/100444  16969 Feb 27 07:34 2015 d:/8180.public.fre/internal/minwin/priv_sdk/lib/amd64/guard_support.obj
rw-rw-rw- 100666/100666  54853 Feb 27 07:36 2015 e:/8180.obj.amd64fre/minkernel/tools/gs_support/ntdll/objfre/amd64/gs_dllmain.obj
rw-rw-rw- 100666/100666  64657 Feb 27 07:36 2015 e:/8180.obj.amd64fre/minkernel/tools/gs_support/ntdll/objfre/amd64/gs_support.obj
rw-rw-rw- 100666/100666   1624 Feb 27 07:36 2015 e:/8180.obj.amd64fre/minkernel/tools/gs_support/ntdll/objfre/amd64/amdsecgs.obj
$ ar tv invalid-audioeng.lib 
--------- 0/0    498 Aug 22 16:03 2013 audioeng.dll
--------- 0/0    251 Aug 22 16:03 2013 audioeng.dll
--------- 0/0    288 Aug 22 16:03 2013 audioeng.dll
--------- 0/0     47 Aug 22 16:03 2013 audioeng.dll
--------- 0/0     43 Aug 22 16:03 2013 audioeng.dll
$ rizin -qc 'ol' ar://invalid-audioeng.lib 
ERROR: Cannot open 'ar://invalid-audioeng.lib'

examples.zip

@wargio wargio added the enhancement New feature or request label Jan 28, 2025
@wargio wargio changed the title Create a new utility called rz-ar to unpack .a and .lib files New utility rz-ar to unpack .a and .lib files Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request signatures
Projects
None yet
Development

No branches or pull requests

1 participant