Skip to content

Conversation

@CyberForgeEx
Copy link

Summary

This PR introduces obfus-gcc.h, a GCC/MinGW-optimized version of the obfuscation library that addresses compatibility issues while maintaining the core protection features.

Motivation

The original obfus.h works with TinyC but encounters issues with GCC/MinGW due to:

  • Complex section attribute usage.
  • Dynamic library loading mechanisms.
  • Some inline assembly patterns.
  • Pointer arithmetic in certain macros.

Changes Made

New File: obfus-gcc.h

  • Simplified Section Attributes: Removed problematic custom sections that caused linker issues.
  • Portable Inline Assembly: Uses Intel syntax with proper GCC constraints.
  • Streamlined Library Loading: Direct function calls instead of complex dynamic resolution.
  • Fixed Macro Issues: Corrected pointer arithmetic warnings in RET_BY_VAR.
  • Comprehensive Wrappers: All standard library functions properly wrapped.

Testing

Tested successfully on:

  • Windows 10/11 with MinGW-w64 GCC 11.2.0

Compilation

# With features
gcc -O2 -masm=intel -DVIRT=1 -DCFLOW_V2=1 -DANTIDEBUG_V2=1 your_file.c -o output.exe -w

@DosX-dev
Copy link
Owner

DosX-dev commented Nov 8, 2025

Hello, @CyberForgeEx! Thank you for your version of obfus.h. I'll definitely publish it in a separate directory dedicated to experiments after the PR is accepted. For now, I'll leave it under review.

@CyberForgeEx
Copy link
Author

Thanks for the feedback! I'm glad you found it interesting to include. I'm completely fine with it going into an experiments directory. Out of curiosity, is the goal to eventually refine this approach for the main codebase, or is it purely for reference? I'd be happy to iterate on it if there's a specific direction you have in mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants