Closed 3F closed 7 years ago
I implemented the following:
bool net::r_eg::Conari::UnLib::API::getD_True(void)
?getD_True@API@UnLib@Conari@r_eg@net@@YA_NXZ
using(var l = new ConariL(...))
{
l.Aliases["getD_True"] = "?getD_True@API@UnLib@Conari@r_eg@net@@YA_NXZ";
l.Aliases["getFlag"] = l.Aliases["getD_True"]; // getFlag -> getD_True -> ...
// ...
l.DLR.getD_True<bool>();
l.DLR.getFlag<bool>();
l.Aliases["HelloWorld"] = new ProcAlias("?HelloWorld@API@UnLib@Conari@r_eg@net@@YAPBDXZ");
l.DLR.HelloWorld<CharPtr>(); // "Hello World !"
Even for simple linkage, it easy as:
l.Aliases["Flag"] = l.Aliases["getFlag"] = l.Aliases["xFunc"]; //Flag() -> getFlag() -> xFunc()->...
l.DLR.getFlag<bool>();
l.Aliases["a"] = l.Aliases["b"] = l.Aliases["c"] = l.Aliases["d"];
the PrefixL/R features will be considered later via IAliasCfg:
public interface IAliasCfg
{
//TODO: PrefixL/R, the rules of mangling, ...
}
upd.:
l.Aliases["gmn"] = new ProcAlias(
"GetMagicNum",
new AliasCfg() { NoPrefixR = true } // false by default
);
hmm, just thought that is a good additional variant for: Undecorate functions from C++ compilers #3
Moreover, it will be useful for any other cases like for DllImport
TODO