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

SafeArrayRankMismatch #4

Open
kosmosec opened this issue Mar 8, 2021 · 1 comment
Open

SafeArrayRankMismatch #4

kosmosec opened this issue Mar 8, 2021 · 1 comment

Comments

@kosmosec
Copy link

kosmosec commented Mar 8, 2021

Run .exe from memory returns 0x80131538 code (https://github.com/marcussacana/RemoteControl/blob/master/RemoteControl/HResults.cs).
[+] Loaded CLR into this process [+] Got default AppDomain [+] Loaded 3584 bytes into memory from TestExe.exe [+] Crated SafeArray from byte array 2021/03/08 18:30:57 appDomain.Load_3 returned 0x80131538

I've also used your C# code from your blog post and it is also causes error.

The quick fix for this is:
hr = appDomain.Load_3(uintptr(unsafe.Pointer(safeArray)), &rawAssemblyAddr)
instead of
hr = appDomain.Load_3(uintptr(unsafe.Pointer(&safeArray)), &rawAssemblyAddr)

@naweka
Copy link

naweka commented Nov 23, 2021

Thanks!

C-Sto pushed a commit to C-Sto/go-clr that referenced this issue Sep 6, 2023
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

2 participants