-
Notifications
You must be signed in to change notification settings - Fork 3
Add custom function registration for unmanaged C++ targets with RemoteRttiType updates #50
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: theXappy <10898152+theXappy@users.noreply.github.com>
Co-authored-by: theXappy <10898152+theXappy@users.noreply.github.com>
Co-authored-by: theXappy <10898152+theXappy@users.noreply.github.com>
…, and missing using Co-authored-by: theXappy <10898152+theXappy@users.noreply.github.com>
Co-authored-by: theXappy <10898152+theXappy@users.noreply.github.com>
|
@copilot The changes should be reflected in any "RemoteType" (or subclass) that the use of the RemoteApp API might've already fetched. Make sure we keep trace of created RemoteType (I belive it's 'Remote RTTI Type') and also update them with the new Method. to keep things consistent, change the API towards the Diver to get back that existing "Method Dump" object (for when you use the "Type Dump" API) and feed that to the same code that generated the rest of the members in the existing Type, to be added as a new member to it. |
… instances - Modified response to return TypeDump.TypeMethod instead of just success/failure - Updated UnmanagedRemoteApp to verify Type is RemoteRttiType and add method to it - Use RttiTypesFactory.AddFunctionImpl to ensure consistent method creation - Updated DiverCommunicator with overload to return method dump - Updated tests to validate RegisteredMethod property - Updated documentation to clarify that existing type instances are updated Co-authored-by: theXappy <10898152+theXappy@users.noreply.github.com>
Updated in cd3cef2. The implementation now:
All existing instances of the type automatically get the new method since they reference the same RemoteRttiType object. |
|
@copilot Change the UnmangedRemoteApp API func from this: To return a MethodInfo, which will represent the new created MethodInfo added to the local 'Remote RTTI Type', as a convinience shortcut for the callers. Also try to fix these compilation errors that occurred when we ran the 'GitHub Action' to try and compile: |
…n errors - Changed return type from bool to MethodInfo (returns null on error) - Added using ScubaDiver.API.Utils to MsvcTypesManager for Filter class - Added using System.Reflection to UnmanagedRemoteApp - Method now returns the newly registered MethodInfo as a convenience - Fixed compilation errors: Filter and CustomUndecoratedFunction now accessible - Updated README with new return type and null-check example Co-authored-by: theXappy <10898152+theXappy@users.noreply.github.com>
... Updated in 6f0bcf3:
The method finds and returns the newly added MethodInfo from the type's method list after successful registration. |
|
@copilot This is silly: Please make it so |
1 similar comment
|
@copilot This is silly: Please make it so |
- Changed AddFunctionImpl signature to return MethodInfo instead of void - Returns the newly created RemoteRttiMethodInfo or RemoteRttiConstructorInfo - UnmanagedRemoteApp now directly returns the MethodInfo from AddFunctionImpl - Removed inefficient O(n) search through all methods by name - More efficient and safer since it returns the exact method that was created Co-authored-by: theXappy <10898152+theXappy@users.noreply.github.com>
... Fixed in caa5782.
... Fixed in caa5782. |
|
@copilot specifically in these 2 projects: ScubaDiver_Net6_x64, ScubaDiver_Net6_86 |
- Added Compile reference to project_net6_x64/ScubaDiver_Net6_x64.csproj - Added Compile reference to project_net6_x86/ScubaDiver_Net6_x86.csproj - Fixes build error: CustomUndecoratedFunction type not found - Projects use explicit file references, so new files must be added manually Co-authored-by: theXappy <10898152+theXappy@users.noreply.github.com>
... Fixed in 4aa39db. Added |
Feature: Custom Function Registration for Unmanaged Targets
This PR implements the feature request to allow users to define custom functions on RemoteTypes for unmanaged (MSVC C++) targets.
Latest Update: Fixed Build Errors in ScubaDiver Projects
CustomUndecoratedFunction now properly referenced in all project files!
Added explicit
<Compile Include>references toCustomUndecoratedFunction.csin:The ScubaDiver projects use explicit file references instead of wildcards, so new source files must be manually added to the .csproj files.
Implementation Complete ✅
Key Features
Usage Example
Includes overflow checking on address arithmetic, exception logging for diagnostics, and automatic propagation of the method to all existing RemoteRttiType instances.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.