ied206 / joveler.filemagician Goto Github PK
View Code? Open in Web Editor NEWCross-platform libmagic pinvoke library for .NET.
License: Other
Cross-platform libmagic pinvoke library for .NET.
License: Other
This issue can be demonstrated by analyzing a .NET 8.0-targeted version of the Joveler.FileMagician.Cli executable itself.
Steps to reproduce:
<TargetFrameworks>net8.0</TargetFrameworks>
using Joveler.FileMagician.Samples;
using System.Diagnostics;
namespace Joveler.FileMagician.Cli
{
public class Program
{
public static void Main(string[] args)
{
using (var bd = new BinaryDetector())
{
using (var process = Process.GetCurrentProcess())
{
var result = bd.InspectBinary(process.MainModule.FileName);
}
}
}
}
}
if (typeStr.Contains("Mono/.Net assembly", StringComparison.Ordinal))
formatFlags |= PEFormatFlags.NetAssembly;
Debug.Assert(formatFlags.HasFlag(PEFormatFlags.NetAssembly) &&
binFlags.HasFlag(BinFlags.Bit32));
I may be misreading, but looks like it's assuming all .NET assemblies should be 32-bit?
Separately -- I wonder if this assert is meant to be included in the if statement above it?
In this age of modern .NET miracles, I wonder if support for Android and iOS has been considered?
Happy 2024! I started taking a look at requirements for #2, and it seems that a (seemingly) small enhancement could open the door to achieving it.
In .NET MAUI, the modern mobile development framework for .NET, "Content" is not a valid build action for magic.mgc
and magic.src
.
Instead, in this case it's necessary to use the new "MauiAsset" build action to include these files in the build.
Following this, you'd access magic.mgc like so:
async Task LoadMauiAsset()
{
using var stream = await FileSystem.OpenAppPackageFileAsync("magic.mgc");
using var reader = new StreamReader(stream);
var contents = reader.ReadToEnd();
}
This has to do with how MAUI manages assets and abstracts away details of the device's underlying file system.
So, if overrides for Magic.Open() and Magic.GlobalInit() were added that could accept a stream like this as the parameter, then native binaries for iOS and Android could be added, and voila!
I hope you'll consider making this enhancement. I'm at your disposal to assist in any way.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.