Warning: Undefined array key 0 in /var/www/tgoop/function.php on line 65

Warning: Trying to access array offset on value of type null in /var/www/tgoop/function.php on line 65
3189 - Telegram Web
Telegram Web
https://github.com/graphitemaster/detour

Ого, кто-то сумел это соорудить:

At its core, Detour is a minimal bootstrap layer that gives your application access to the system dynamic linker ld-linux.so without requiring libc at all. It allows:

* Dynamically loading libraries without linking libc
* Capturing libdl functionality (e.g., dlopen, dlsym) inside a fully static executable
* Mixing different libcs in one process
* Creating freestanding, zero-libc ELF executables


TL;DR - статический stub, который умеет загружать в адресное пространство процесса системный динамический загрузчик, и, с его помощью, загружать системные .so.

Сделано весьма изящно:

It works like this:

* We provide a tiny stub ELF executable that is dynamically linked against the system dynamic linker.
* Your actual program (which Detour bootstraps) loads this stub ELF using a minimal ELF loader.
* Detour reads the stub executable's PT_INTERP segment and loads the specified dynamic linker, just like the kernel would.
* Before jumping into the dynamic linker, Detour calls setjmp to capture its current state.
* It then jumps into the dynamic linker, forwarding the stub ELF and original arguments as if it were the kernel.
* The dynamic linker maps in and initializes the stub ELF, then calls its main function. That main receives a string argument containing a function pointer encoded as a hex string. It decodes the address, casts it to a function pointer, and calls it.
* This function captures symbols like dlopen, dlsym, dlclose, dlerror, and then calls longjmp to return to the original application.
* Now, back at your main program's entry point, you have full access to the dynamic linker without ever linking against libc.

It is a trampoline: a short, carefully orchestrated detour through the dynamic linker, giving you just enough of its guts to carry on without ever depending on it directly


Прямо мое уважение.

UPD: зачем это?

* Например, я могу сделать статический бинарь, который загрузит системную mesa, вместо того, чтобы вкомпилять драйвер в себя. Это не нужно в stalix, но для "#IX as a package manager" может быть очень полезно.

* Можно получить бинарь, который работает в ЛЮБОМ Linux, не только в том, где он скомпилен, при этом, он будет использовать системные .so, неважно, musl это, или glibc.
👍21🔥11🤔5🤯21🏆1
Forwarded from Segment@tion fault
This media is not supported in your browser
VIEW IN TELEGRAM
Это я, сижу жду когда ИИ меня наконец заменит на работе
😁506👍3🤝2🆒2🔥1
https://www.opennet.ru/opennews/art.shtml?num=63573
https://metr.org/Early_2025_AI_Experienced_OS_Devs_Study.pdf

Исследовательская группа METR (Model Evaluation & Threat Research) опубликовала результаты эксперимента по оценке эффективности применения AI-инструментов для написания кода. Вопреки ожиданиям, исследование показало, что AI-помощники не ускоряют, а замедляют решение поставленных задач, при том, что субъективно участники эксперимента считали, что AI ускорил их работу.

Фактически при использовании AI-помощника на решение задачи в среднем было потрачено на 19% больше времени, в то время как участники полагали, что благодаря AI смогли выполнить работу на 20% быстрее, а до начала работы считали, что AI поможет им ускорить работу на 24%. Результаты также значительно расходятся с прогнозами экспертов в области экономики и машинного обучения, которые предсказывали экономию времени при использовании AI на 39% и 38%, соответственно


Так и знав, что "гонять джуна" медленнее, чем сделать самому!
😁28👍4🤡3🔥2
2025/07/14 08:02:00
Back to Top
HTML Embed Code: