unicorn icon indicating copy to clipboard operation
unicorn copied to clipboard

"System.Runtime.InteropServices.SEHException" Only in debug using Visual Studio 2022

Open gmgunderground opened this issue 1 year ago • 0 comments

My test console seams to work correctly if I run it from Explorer, buf in debug inside visual studio I get SEHException when I execute MemMap

// Inizializza Unicorn engine
var uc = new Unicorn(Common.UC_ARCH_TRICORE, Common.UC_MODE_LITTLE_ENDIAN);
Console.WriteLine($"Unicorn version: {uc.Version()}");

// Mappa 2MB di memoria per questa emulazione
const long ADDRESS = 0x80000000;
uc.MemMap(ADDRESS, 0xA00000, Common.UC_PROT_ALL);

// Scrivi il codice macchina da emulare nella memoria
byte[] code = new byte[] { 0x37, 0x00, 0x00, 0x00 }; // Esempio di codice macchina
uc.MemWrite(ADDRESS, code);

// Inizializza i registri della macchina
uc.RegWrite(TriCore.UC_TRICORE_REG_PC, ADDRESS);

// Avvia l'emulazione
uc.EmuStart(ADDRESS, ADDRESS + code.Length, 0, 0);

// Leggi e stampa alcuni registri
long pc = uc.RegRead(TriCore.UC_TRICORE_REG_PC);
Console.WriteLine($">>> PC = 0x{pc:X}");

I use the binding project that there is in the repository. I use dev branch Have I configured in a wrong way something?

gmgunderground avatar Jul 29 '24 13:07 gmgunderground