wargio / libvle

PowerPC VLE disassembler library
GNU Lesser General Public License v3.0
5 stars 5 forks source link

Fix bugs in vle.c and add CLR bridge #14

Closed prj closed 3 years ago

prj commented 3 years ago

Fixed the bugs with se_ load/store instructions as well as e_stb. Added C++/CLI interop layer to be able to use the library from the CLR, if required.

prj commented 3 years ago

Tests should be fixed also. They fail because of stuff like this: {{0x88, 0x18, 0x00, 0x00}, SZ_SE , "selbz r1 0x8(r8)"}, a se instruction can not access registers r8-r23. This should be "se_lbz r1 0x8(r24)" due to the translation.

wargio commented 3 years ago

You can add a special type for this.

prj commented 3 years ago

You can add a special type for this.

You mean for the tests? I already got a little more than I signed up for :) I am not sure if you want to accept the C++/CLI interop into this project or not. But I made it, so I figured I'd contribute it. If you don't want the clutter, you can disregard it. I just needed it to call your library from the CLR.

prj commented 3 years ago

Needs more work to be valid...

wargio commented 3 years ago

i'm ok for having bindings for C++ actually it looked good. i can wait for your PR if you want. just let me know.

prj commented 3 years ago

i'm ok for having bindings for C++ actually it looked good. i can wait for your PR if you want. just let me know.

Bindings are for Microsoft CLR, so usually for C# and so on. They are just written in C++/CLI.

From a C# development perspective it looks like this:

public class PPCVLEParser {
    public PPCVLEParser();

    public static VLEt DecodeOne(byte[] buf, int adr, uint @base);
}
wargio commented 3 years ago

Yes i noticed.