What's the simplest #programming language to call functions in a DLL from? Must also have a good debugger/IDE

#interop #ReverseEngineering #Windows

@voltagex uh. if it's a dotnet dll, dotnet - otherwise I find python and ctypes _ok_ but python and ctypes is a quick way to get segaults in python which I feel shouldn't happen.
@xssfox should have specified native DLL, but thanks, I'd forgotten about ctypes
@xssfox @voltagex can also pinvoke to native functions in .NET, which is pretty easy
@gsuberland @xssfox it was for this case, where I just needed to check if a function worked, but I find native stuff like IntPtr, Hwnd, anything with marshalling and structs really difficult. It will be what pushes me to learn C.
@voltagex @gsuberland @xssfox aww C isn’t that terrible…
@jpm @voltagex @gsuberland *stares at my active gdb session*
@xssfox @voltagex @gsuberland you just know that running it inside a debugger will change the timing enough that the race condition won’t happen anymore…
@voltagex Probably Autohotkey or AutoIt. If the debug capability is too low stick with C.
@voltagex exec('rundll32.exe my.dll,foo') -- works in any language!
@ss23 only if the function has a particular signature, though?

@voltagex depending on the DLL, can be any of the MS languages. If it’s a VB DLL, you’ll want VB.net, if it’s a C DLL, some can be more annoying to interface with than others with C#, so you might want to fall back to C++.

But almost all are easily exposed via C#, which takes very little work to expose and interact with, sometimes as little as three lines of code.

@voltagex an example straight from MSDN to show how simple it can be!