Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gmgunderground opened this issue Jul 29, 2024 · 0 comments

Comments

@gmgunderground
Copy link

gmgunderground commented Jul 29, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant