my basic purpose for doing this is to break my c program , certain reasons
#1 file reading file via functions like fscanf(); is lot faster than rust and lot simpler because given the structure of file directly picking up numbers as integers is possible as file is refined
#2 that dll failed in all languages "ffi" functionality i tried , namely ruby, python , C#
# here is the python code :
from ctypes import cdll
lib = cdll.LoadLibrary("C:/Users/Dell/Desktop/hack/embed.dll")
lib.test.hello()
pass
here is the python error
C:\Users\Dell\Desktop\rust\testlib>C:\Users\Dell\Desktop\hack\sam.py
Traceback (most recent call last):
File "C:\Users\Dell\Desktop\hack\sam.py", line 12, in <module>
lib.test.hello()
File "C:\Users\Dell\AppData\Local\Programs\Python\Python37\lib\ctypes\__init__.py", line 369, in __getattr__
func = self.__getitem__(name)
File "C:\Users\Dell\AppData\Local\Programs\Python\Python37\lib\ctypes\__init__.py", line 374, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: function 'test' not found
here is C# code
using System;
using System.Runtime.InteropServices;
namespace hello_c_sharp
{
class Program
{
[DllImport("C:/Users/Dell/Desktop/rust/testlib/target/release/embed.dll")]
public static extern void Hello();
static void Main(string[] args)
{
Hello();
Console.ReadLine();
// System("pause");
}
}
}
here is the C# error
Exception thrown: 'System.EntryPointNotFoundException' in hello_c_sharp.dll
An unhandled exception of type 'System.EntryPointNotFoundException' occurred in
hello_c_sharp.dll
Unable to find an entry point named 'Hello' in DLL
'C:/Users/Dell/Desktop/rust/testlib/target/release/embed.dll'.