{"id":20152293,"url":"https://github.com/winscripter/dotobfs","last_synced_at":"2025-09-09T21:56:18.372Z","repository":{"id":196565296,"uuid":"694537624","full_name":"winscripter/dotObfs","owner":"winscripter","description":"dotObfs is a library that can help you obfuscate up to 7 programming languages with .NET","archived":false,"fork":false,"pushed_at":"2023-09-25T17:29:33.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-03T01:18:52.821Z","etag":null,"topics":["csharp","dotnet","dotnetframework","obfuscator","security"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/winscripter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-09-21T07:41:52.000Z","updated_at":"2023-09-25T17:28:40.000Z","dependencies_parsed_at":"2023-09-26T06:02:09.827Z","dependency_job_id":null,"html_url":"https://github.com/winscripter/dotObfs","commit_stats":null,"previous_names":["winscripter/dotobfs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/winscripter/dotObfs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winscripter%2FdotObfs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winscripter%2FdotObfs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winscripter%2FdotObfs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winscripter%2FdotObfs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/winscripter","download_url":"https://codeload.github.com/winscripter/dotObfs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winscripter%2FdotObfs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274367808,"owners_count":25272302,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-09T02:00:10.223Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","dotnet","dotnetframework","obfuscator","security"],"created_at":"2024-11-13T23:10:32.093Z","updated_at":"2025-09-09T21:56:18.336Z","avatar_url":"https://github.com/winscripter.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dotObfs\ndotObfs is a library that can help you obfuscate up to 7 programming languages with .NET.\n\n*Warning: **The library has an MIT license, found in the file LICENSE. This means you're allowed to copy the source code, as long as you include the license for dotObfs. Also, please keep in mind that if you corrupt the source code/library, resulting in unintended results, we're NOT RESPONSIBLE FOR ANY DEBUGGING OR FIXES!***\n\nIn most cases, you really don't need to obfuscate .NET. Not a lot of developers do so. Obfuscating languages like JavaScript makes sense, since anyone can see\nthe source with their browser. Most .NET developers make their projects open-source.\n\nIf you still need .NET obfuscators, here's how to use dotObfs.\n\ndotObfs lets you obfuscate these programming languages:\n- C\n- C++\n- Java\n- JavaScript\n- C#\n- Visual Basic\n- F#\n\n# One example (with C#)\n```csharp\nusing System;\nusing System.Collections.Generic;\nusing dotObfs.Core.CSharp;\nusing dotObfs.Core;\n\nnamespace DotObfsClientDemo\n{\n    class Program\n    {\n        static void Main()\n        {\n            string CSharpCode = @\"using System;\nclass Program\n{\n    static void Main()\n    {\n        Console.WriteLine(\"\"Hello, World!\"\");\n        string foo = \"\"bar\"\";\n    }\n}\";\n            CSharpLexer lexer = new CSharpLexer(CSharpCode);\n            List\u003cToken\u003e tokens = new List\u003cToken\u003e();\n            Token last;\n            do\n            {\n                last = lexer.GetNextToken();\n                tokens.Add(last);\n            }\n            while (last.type != TokenType.EOF);\n            \n            Console.WriteLine(CSObfuscator.Obfuscate(\n                ObfuscatorRule.RandomString,\n                tokens));\n        }\n    }\n}\n```\nThe program outputs:\n`using YRqHwQnUomOuLLW;class LvVxhRXxEOD{static void MvOWOr(){RYRfWxngiMUjFo.dFYAxOjLMCEouiyiVSRpG(\"Hello, World!\");string APSChtxasF=\"bar\";}}`\nAs you can see, it has obfuscated every single identifier. This is not great, you don't want to obfuscate everything.\nIn this case, there's a way to add **ignores**. They allow you to obfuscate anything except the specified identifiers.\n\nNow if we add this:\n```csharp\n            Ignore.AllIdentifierIgnores.Add(\"System\");\n            Ignore.AllIdentifierIgnores.Add(\"Program\");\n            Ignore.AllIdentifierIgnores.Add(\"Main\");\n            Ignore.AllIdentifierIgnores.Add(\"Console\");\n            Ignore.AllIdentifierIgnores.Add(\"WriteLine\");\n            \n            Console.WriteLine(CSObfuscator.Obfuscate(\n                ObfuscatorRule.RandomString,\n                tokens));\n```\nThe result is:\n`using System;class Program{static void Main(){Console.WriteLine(\"Hello, World!\");string ctyIwlLmXSQb=\"bar\";}}`\nThere's also a feature called **obfuscator rule**. They specify how to obfuscate your code.\nAs you can see, the obfuscator rule is set to `RandomString`.\nIf we change that to `XOnly`:\n```csharp\n Console.WriteLine(CSObfuscator.Obfuscate(\n                ObfuscatorRule.XOnly, // notice this - ObfuscatorRule.XOnly\n                tokens));\n```\nWe get:\n`using System;class Program{static void Main(){Console.WriteLine(\"Hello, World!\");string XXXXXXXXXXX=\"bar\";}}`\nHowever, this is not recommended, as it can often cause duplicate identifiers, resulting in a `throw` statement.\nSetting `ObfuscatorRule.RandomString` is a much more robust way to prevent getting the `throw` statement, although the performance may degrade a little bit.\n\n# How does dotObfs work?\ndotObfs works by using its lexer for that programming language, and then it replaces the identifiers. It ensures they're not in the ignore list and were not obfuscated before.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwinscripter%2Fdotobfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwinscripter%2Fdotobfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwinscripter%2Fdotobfs/lists"}