Git Product home page Git Product logo

Comments (8)

trufae avatar trufae commented on June 18, 2024 1

Your r2 installation is missing some support files. The sdb files determine info like noreturn functions, signatures, types and structs and other stuff. So copying the files is not enough. Do a proper installation inside the docker and it should work.

alternatively you can build r2 with gperf which statically links the sdb files inside the binary so it doesnt depend on external files to work

from radare2.

trufae avatar trufae commented on June 18, 2024 1

The sys/install.sh uses symlinks for installation. Uou should better use a destdir for that purpose like this:

./configure —prefix=/use
export CFLAGS=“-Os -flto”
make -j4
make install DESTDIR=/tmp/r2

then in the COPY step you just take the files under /tmp/r2/* and place the in the root directory of the target image.

the -Os will reduce the build size and the link time optimization will also help on this

after this you should be able to remove the builddir and only keep the target files.

if you are using debian there’s also a .deb in the release page, no need to build from source

from radare2.

attilamester avatar attilamester commented on June 18, 2024

I mention that IDA Pro 6's output of GenFuncGdl for that entry node matches the local r2 output version - so, ending with call ExitProcess.

from radare2.

trufae avatar trufae commented on June 18, 2024

Uhm seems like you are copying the share directory too.. which should be enough. You can try with the tn command and see if its listed as a noreturn type

from radare2.

attilamester avatar attilamester commented on June 18, 2024

@trufae you were right! Thanks, I somehow overlooked the tiny detail that I have a multistage docker build and am copying the files :D so, I did as you suggested, commented the second build stage and now all is good. But still, what could have been the problem? Does radare store files somewhere outside these paths?

# # =================
# FROM python:3.8-slim as main
# # =================
#
# WORKDIR /usr/callgraph
#
# COPY --from=base /usr/local/bin/python3.8 /usr/local/bin/python3.8
# COPY --from=base /usr/local/lib/python3.8/site-packages /usr/local/lib/python3.8/site-packages
# COPY --from=base /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu
# COPY --from=base /usr/include/graphviz /usr/include/graphviz
# COPY --from=base /usr/share/graphviz /usr/share/graphviz
# COPY --from=base /usr/local/lib/radare2 /usr/local/lib/radare2
# COPY --from=base /usr/local/bin/radare2 /usr/local/bin/radare2
# COPY --from=base /usr/local/share/radare2 /usr/local/share/radare2
# COPY --from=base /usr/local/bin/r2 /usr/local/bin/r2
# COPY --from=base /usr/local/lib/libr_*.so /usr/local/lib/

Because I would need the multistage build, it reduces significantly my image size. Thanks in advance!
Or, could you provide me some docs regarding the gperf installation of radare2? 🙏

from radare2.

attilamester avatar attilamester commented on June 18, 2024

Update
Found out that the missing folder was the original release directory, resulting from this RUN curl -Ls https://github.com/radareorg/radare2/releases/download/5.8.8/radare2-5.8.8.tar.xz | tar xJv && \.
If I keep that folder in the docker container, everything works fine.

But it's 413MB so I would like to keep only those files which are necessary. Can you help me with this please?

Update 2
Adding the following line at the end of the 2. build stage solves the issue. COPY --from=base /usr/callgraph/radare2-5.8.8/libr /usr/callgraph/radare2-5.8.8/libr. But it means 232MB plus size for the container.

from radare2.

trufae avatar trufae commented on June 18, 2024

Hope that helps!

from radare2.

attilamester avatar attilamester commented on June 18, 2024

You are amazing, thanks for you help! Yes, this helps a lot :)

from radare2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.