Skip to content

Instantly share code, notes, and snippets.

View kotenok2000's full-sized avatar

Кирилл Фролов kotenok2000

View GitHub Profile
@kotenok2000
kotenok2000 / wsl1 exec format error fix
Created August 9, 2025 14:27
wsl1 exec format error fix
Given that Microsoft has effectively deprioritized addressing core issues in WSL1, I’ve implemented a workaround for this issue with ELF binaries.
The solution uses a custom wrapper (elf_wrapper.c) with ld.so.preload to automatically intercept and redirect ELF execution through /lib64/ld-linux-x86-64.so.2, enabling system-wide compatibility without user intervention. Unlike direct invocations of /lib64/ld-linux-x86-64.so.2, this approach captures ELF execution at the system level, eliminating the need for wrapper scripts, shell aliases, or direct binary modifications with patchelf.
elf_wrapper.c source code:
#define _GNU_SOURCE
#include <dlfcn.h>
#include <stdio.h>
#include <stdlib.h>
Verifying my Blockstack ID is secured with the address 142YLuKW3kS9R8G1R9pd3SbLbJ3NfZB6BL https://explorer.blockstack.org/address/142YLuKW3kS9R8G1R9pd3SbLbJ3NfZB6BL
@kotenok2000
kotenok2000 / 1.1
Last active January 20, 2019 13:56
1
Verifying my Blockstack ID is secured with the address 142YLuKW3kS9R8G1R9pd3SbLbJ3NfZB6BL https://explorer.blockstack.org/address/142YLuKW3kS9R8G1R9pd3SbLbJ3NfZB6BL