Skip to content

lazy_importer/shadow_syscall/inline_syscall in plain C? #337

Closed

Description

Sorry for going off-topic, but I don’t trust third-party Discussions boards like #333. They tend to appear and disappear suddenly, just like the one mentioned in #305 (the maintainer left GitHub and their repositories vanished). So I’ll post it here instead. Ideally, it would be best to have a Discussions board enabled directly on this repository, as I proposed in #305.

Here are the projects I mentioned in the title of this thread:

https://github.com/JustasMasiulis/lazy_importer

https://github.com/annihilatorq/shadow_syscall

https://github.com/JustasMasiulis/inline_syscall

Of course, I don’t do any hacking like the developers of these projects. But I think the idea is cool (at least to me). I don’t want to include a large windows.h. Instead, I can load the shared library and call functions directly without a function pointer prototype or strict type correctness. I’ve seen something similar in some Go code I came across, though I can’t remember exactly where. This is very cool.

Activity

  1. skeeto commented on Mar 14, 2026

    @skeeto
    Owner

    I don’t want to include a large windows.h

    I'm also unhappy with the windows.h situation. There seem to be just two escapes:

    • Pre-compiled headers. Include windows.h in your own header, include that header first in your sources, and pre-compile it. The extra setup generally requires a not-dumb build system, even if simple. That interferes with my goals of single file projects with one-shot builds.
    • Declare the Win32 interfaces yourself. It's tedious, but you can choose better types and names than Microsoft. This is what I usually do.

    As for "lazy importing" I've have a little experiment along these lines here in u-config:

    skeeto/u-config@master...no-imports

    It technically imports and exports nothing (check it with peports), and instead interrogates the PEB to find the handful of needed Win32 functions. It's not meant for obfuscation, and the string names (unhashed) are still present in the PE image.

    They tend to appear and disappear suddenly

    Yeah, don’t build your castle in other people’s kingdoms and all. Though of course we're here in GitHub's kingdom. It comes with lots of benefits and freebees so I'm willing to make the trade-off building, in part, within this kingdom.

    it would be best to have a Discussions board enabled directly on this repository

    Done.

  2. Peter0x44 commented on Mar 14, 2026

    @Peter0x44
    Collaborator

    Though of course we're here in GitHub's kingdom. It comes with lots of benefits and freebees so I'm willing to make the trade-off building, in part, within this kingdom.

    #292 is an easy freebie we could be taking.

  3. Repository owner locked and limited conversation to collaborators on Mar 15, 2026
  4. converted this issue into a discussion #340 on Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions